diff --git a/app/assets/javascripts/vue_shared/components/color_select_dropdown/color_select_root.vue b/app/assets/javascripts/vue_shared/components/color_select_dropdown/color_select_root.vue
index 6b79883d76ba64f90f30c3617997baaa10a44640..e567040bc510b33d06b2181a3b77a737cf5f7150 100644
--- a/app/assets/javascripts/vue_shared/components/color_select_dropdown/color_select_root.vue
+++ b/app/assets/javascripts/vue_shared/components/color_select_dropdown/color_select_root.vue
@@ -1,4 +1,5 @@
-
+
+
+
+ {{ buttonText }}
+
-
-
+
+
@@ -38,6 +43,15 @@ export default {
/>
-
+
+
+
+
+
+
diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb
index 07850acd23db73c7cde048a9f20b6e43413f9200..d1a1844b8462f3efbb595f403a3c5211ba15900f 100644
--- a/app/controllers/concerns/issuable_actions.rb
+++ b/app/controllers/concerns/issuable_actions.rb
@@ -74,6 +74,7 @@ def realtime_changes
response = {
title: view_context.markdown_field(issuable, :title),
title_text: issuable.title,
+ color: issuable.color || '',
description: view_context.markdown_field(issuable, :description),
description_text: issuable.description,
task_status: issuable.task_status,
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb
index 486d5bb3866d43df28149d3021a38b7b56913fda..55a15631fd9a84801d8f7b82916182e18bd2f18d 100644
--- a/app/helpers/issuables_helper.rb
+++ b/app/helpers/issuables_helper.rb
@@ -240,6 +240,7 @@ def issuable_initial_data(issuable)
lockVersion: issuable.lock_version,
state: issuable.state,
issuableTemplateNamesPath: template_names_path(parent, issuable),
+ initialColor: issuable.color || '',
initialTitleHtml: markdown_field(issuable, :title),
initialTitleText: issuable.title,
initialDescriptionHtml: markdown_field(issuable, :description),
diff --git a/ee/app/assets/javascripts/epic/components/epic_body.vue b/ee/app/assets/javascripts/epic/components/epic_body.vue
index c1e018f8c36699a4bd352634ecba00d7b869cd21..5eb800e87597faad367e75a19432255e251265a7 100644
--- a/ee/app/assets/javascripts/epic/components/epic_body.vue
+++ b/ee/app/assets/javascripts/epic/components/epic_body.vue
@@ -22,6 +22,7 @@ export default {
'canUpdate',
'canDestroy',
'canAdmin',
+ 'initialColor',
'initialTitleHtml',
'initialTitleText',
'initialDescriptionHtml',
@@ -49,6 +50,7 @@ export default {
:can-update="canUpdate"
:can-destroy="canDestroy"
:show-delete-button="canDestroy"
+ :initial-color="initialColor"
:initial-title-html="initialTitleHtml"
:initial-title-text="initialTitleText"
:lock-version="lockVersion"
diff --git a/ee/app/assets/javascripts/epic/components/epic_form.vue b/ee/app/assets/javascripts/epic/components/epic_form.vue
index 953700cb3fbe9325729e49ae9f38667cd8b7a511..a2151669dab6067df3b977aa0970760a5f0e628e 100644
--- a/ee/app/assets/javascripts/epic/components/epic_form.vue
+++ b/ee/app/assets/javascripts/epic/components/epic_form.vue
@@ -16,25 +16,31 @@ import { visitUrl } from '~/lib/utils/url_utility';
import { s__ } from '~/locale';
import MarkdownField from '~/vue_shared/components/markdown/field.vue';
import LabelsSelectWidget from '~/vue_shared/components/sidebar/labels_select_widget/labels_select_root.vue';
+import ColorSelectDropdown from '~/vue_shared/components/color_select_dropdown/color_select_root.vue';
import { LabelType } from '~/vue_shared/components/sidebar/labels_select_widget/constants';
+import { DEFAULT_COLOR } from '~/vue_shared/components/color_select_dropdown/constants';
+import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import createEpic from '../queries/create_epic.mutation.graphql';
export default {
components: {
+ ColorSelectDropdown,
GlButton,
GlDatepicker,
GlForm,
GlFormCheckbox,
- GlFormInput,
GlFormGroup,
- MarkdownField,
+ GlFormInput,
LabelsSelectWidget,
+ MarkdownField,
},
+ mixins: [glFeatureFlagsMixin()],
inject: ['groupPath', 'groupEpicsPath', 'markdownPreviewPath', 'markdownDocsPath'],
data() {
return {
title: '',
description: '',
+ color: DEFAULT_COLOR,
confidential: false,
labels: [],
startDateFixed: null,
@@ -47,6 +53,9 @@ export default {
labelIds() {
return this.labels.map((label) => label.id);
},
+ isEpicColorEnabled() {
+ return this.glFeatures.epicColorHighlight;
+ },
},
i18n: {
confidentialityLabel: s__(`
@@ -83,24 +92,26 @@ export default {
save() {
this.loading = true;
+ const input = {
+ addLabelIds: this.labelIds,
+ groupPath: this.groupPath,
+ title: this.title,
+ description: this.description,
+ confidential: this.confidential,
+ startDateFixed: this.startDateFixed ? formatDate(this.startDateFixed, 'yyyy-mm-dd') : null,
+ startDateIsFixed: Boolean(this.startDateFixed),
+ dueDateFixed: this.dueDateFixed ? formatDate(this.dueDateFixed, 'yyyy-mm-dd') : null,
+ dueDateIsFixed: Boolean(this.dueDateFixed),
+ };
+
+ if (this.isEpicColorEnabled && this.color?.color !== '') {
+ input.color = this.color.color;
+ }
+
return this.$apollo
.mutate({
mutation: createEpic,
- variables: {
- input: {
- addLabelIds: this.labelIds,
- groupPath: this.groupPath,
- title: this.title,
- description: this.description,
- confidential: this.confidential,
- startDateFixed: this.startDateFixed
- ? formatDate(this.startDateFixed, 'yyyy-mm-dd')
- : null,
- startDateIsFixed: Boolean(this.startDateFixed),
- dueDateFixed: this.dueDateFixed ? formatDate(this.dueDateFixed, 'yyyy-mm-dd') : null,
- dueDateIsFixed: Boolean(this.dueDateFixed),
- },
- },
+ variables: { input },
})
.then(({ data }) => {
const { errors, epic } = data.createEpic;
@@ -131,6 +142,9 @@ export default {
handleUpdateSelectedLabels(labels) {
this.labels = labels.map((label) => ({ ...label, id: getIdFromGraphQLId(label.id) }));
},
+ handleUpdateSelectedColor(color) {
+ this.color = color;
+ },
},
};
@@ -189,6 +203,7 @@ export default {
>{{ $options.i18n.confidentialityLabel }}
+
{{ __('Clear start date') }}
-
+
@@ -238,7 +249,23 @@ export default {
>
-