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>2022-05-02 15:10:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-02 15:10:01 +0300
commit610d783b61f3c3c7d19e6167df26368a7e8a0075 (patch)
tree53e302bba3a9820bb613130bb8526e003928e869 /app/assets/javascripts/work_items
parentf3b405856d99583bcd2f27c909abe779a48db512 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/work_items')
-rw-r--r--app/assets/javascripts/work_items/constants.js2
-rw-r--r--app/assets/javascripts/work_items/pages/create_work_item.vue8
2 files changed, 10 insertions, 0 deletions
diff --git a/app/assets/javascripts/work_items/constants.js b/app/assets/javascripts/work_items/constants.js
index a942c3f280d..e914500108f 100644
--- a/app/assets/javascripts/work_items/constants.js
+++ b/app/assets/javascripts/work_items/constants.js
@@ -10,3 +10,5 @@ export const i18n = {
fetchError: s__('WorkItem|Something went wrong when fetching the work item. Please try again.'),
updateError: s__('WorkItem|Something went wrong while updating the work item. Please try again.'),
};
+
+export const DEFAULT_MODAL_TYPE = 'Task';
diff --git a/app/assets/javascripts/work_items/pages/create_work_item.vue b/app/assets/javascripts/work_items/pages/create_work_item.vue
index 58a4d2cdba3..be3359dac7e 100644
--- a/app/assets/javascripts/work_items/pages/create_work_item.vue
+++ b/app/assets/javascripts/work_items/pages/create_work_item.vue
@@ -6,6 +6,7 @@ import workItemQuery from '../graphql/work_item.query.graphql';
import createWorkItemMutation from '../graphql/create_work_item.mutation.graphql';
import createWorkItemFromTaskMutation from '../graphql/create_work_item_from_task.mutation.graphql';
import projectWorkItemTypesQuery from '../graphql/project_work_item_types.query.graphql';
+import { DEFAULT_MODAL_TYPE } from '../constants';
import ItemTitle from '../components/item_title.vue';
@@ -77,6 +78,13 @@ export default {
text: node.name,
}));
},
+ result() {
+ if (!this.selectedWorkItemType && this.isModal) {
+ this.selectedWorkItemType = this.formOptions.find(
+ (options) => options.text === DEFAULT_MODAL_TYPE,
+ )?.value;
+ }
+ },
error() {
this.error = this.$options.fetchTypesErrorText;
},