Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-31 18:10:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-31 18:10:14 +0300
commitea937d0916c4a3325daf45edd420aeea7da32944 (patch)
treea58f9456f0b8dab30c9621b0dad6015d77bce755 /app/assets/javascripts/incidents
parent2f2c8f84bf1dd181f28f71505c6216f34d67532e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/incidents')
-rw-r--r--app/assets/javascripts/incidents/components/incidents_list.vue34
-rw-r--r--app/assets/javascripts/incidents/constants.js1
-rw-r--r--app/assets/javascripts/incidents/graphql/queries/get_incidents.query.graphql1
-rw-r--r--app/assets/javascripts/incidents/list.js9
4 files changed, 41 insertions, 4 deletions
diff --git a/app/assets/javascripts/incidents/components/incidents_list.vue b/app/assets/javascripts/incidents/components/incidents_list.vue
index 66443a36b5c..0071ed77779 100644
--- a/app/assets/javascripts/incidents/components/incidents_list.vue
+++ b/app/assets/javascripts/incidents/components/incidents_list.vue
@@ -72,11 +72,18 @@ export default {
GlPagination,
GlTabs,
GlTab,
+ PublishedCell: () => import('ee_component/incidents/components/published_cell.vue'),
},
directives: {
GlTooltip: GlTooltipDirective,
},
- inject: ['projectPath', 'newIssuePath', 'incidentTemplateName', 'issuePath'],
+ inject: [
+ 'projectPath',
+ 'newIssuePath',
+ 'incidentTemplateName',
+ 'issuePath',
+ 'publishedAvailable',
+ ],
apollo: {
incidents: {
query: getIncidents,
@@ -144,6 +151,20 @@ export default {
newIncidentPath() {
return mergeUrlParams({ issuable_template: this.incidentTemplateName }, this.newIssuePath);
},
+ availableFields() {
+ return this.publishedAvailable
+ ? [
+ ...this.$options.fields,
+ ...[
+ {
+ key: 'published',
+ label: s__('IncidentManagement|Published'),
+ thClass: 'gl-pointer-events-none',
+ },
+ ],
+ ]
+ : this.$options.fields;
+ },
},
methods: {
onInputChange: debounce(function debounceSearch(input) {
@@ -230,7 +251,7 @@ export default {
</h4>
<gl-table
:items="incidents.list || []"
- :fields="$options.fields"
+ :fields="availableFields"
:show-empty="true"
:busy="loading"
stacked="md"
@@ -245,7 +266,7 @@ export default {
<gl-icon
v-if="item.state === 'closed'"
name="issue-close"
- class="gl-fill-blue-500"
+ class="gl-ml-1 gl-fill-blue-500"
data-testid="incident-closed"
/>
</div>
@@ -285,6 +306,13 @@ export default {
</div>
</template>
+ <template v-if="publishedAvailable" #cell(published)="{ item }">
+ <published-cell
+ :status-page-published-incident="item.statusPagePublishedIncident"
+ :un-published="$options.i18n.unPublished"
+ />
+ </template>
+
<template #table-busy>
<gl-loading-icon size="lg" color="dark" class="mt-3" />
</template>
diff --git a/app/assets/javascripts/incidents/constants.js b/app/assets/javascripts/incidents/constants.js
index 3a3efa98f25..0fc5c911cfe 100644
--- a/app/assets/javascripts/incidents/constants.js
+++ b/app/assets/javascripts/incidents/constants.js
@@ -6,6 +6,7 @@ export const I18N = {
unassigned: s__('IncidentManagement|Unassigned'),
createIncidentBtnLabel: s__('IncidentManagement|Create incident'),
searchPlaceholder: __('Search or filter results...'),
+ unPublished: s__('IncidentManagement|Unpublished'),
};
export const INCIDENT_STATE_TABS = [
diff --git a/app/assets/javascripts/incidents/graphql/queries/get_incidents.query.graphql b/app/assets/javascripts/incidents/graphql/queries/get_incidents.query.graphql
index d717d898ef0..c0942b629e5 100644
--- a/app/assets/javascripts/incidents/graphql/queries/get_incidents.query.graphql
+++ b/app/assets/javascripts/incidents/graphql/queries/get_incidents.query.graphql
@@ -37,6 +37,7 @@ query getIncidents(
webUrl
}
}
+ statusPagePublishedIncident
}
pageInfo {
hasNextPage
diff --git a/app/assets/javascripts/incidents/list.js b/app/assets/javascripts/incidents/list.js
index 6e39e631815..3809742e32b 100644
--- a/app/assets/javascripts/incidents/list.js
+++ b/app/assets/javascripts/incidents/list.js
@@ -8,7 +8,13 @@ export default () => {
const selector = '#js-incidents';
const domEl = document.querySelector(selector);
- const { projectPath, newIssuePath, incidentTemplateName, issuePath } = domEl.dataset;
+ const {
+ projectPath,
+ newIssuePath,
+ incidentTemplateName,
+ issuePath,
+ publishedAvailable,
+ } = domEl.dataset;
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
@@ -21,6 +27,7 @@ export default () => {
incidentTemplateName,
newIssuePath,
issuePath,
+ publishedAvailable,
},
apolloProvider,
components: {