From 84c336ea4ec7036acf7a6f7cfcaabebe4b6eddb5 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Wed, 19 Jul 2023 14:55:32 -0600 Subject: [PATCH 1/5] Move comment templates into card view Changelog: changed --- .../comment_templates/components/list.vue | 60 ++++++++++++------- .../components/list_item.vue | 6 +- locale/gitlab.pot | 5 +- .../list_users_comment_template_spec.rb | 2 +- .../user_creates_comment_template_spec.rb | 2 +- 5 files changed, 50 insertions(+), 25 deletions(-) diff --git a/app/assets/javascripts/comment_templates/components/list.vue b/app/assets/javascripts/comment_templates/components/list.vue index 46d6b49297d9c0..1de9c72f939818 100644 --- a/app/assets/javascripts/comment_templates/components/list.vue +++ b/app/assets/javascripts/comment_templates/components/list.vue @@ -1,12 +1,15 @@ @@ -47,25 +54,38 @@ export default {
diff --git a/app/assets/javascripts/comment_templates/components/list_item.vue b/app/assets/javascripts/comment_templates/components/list_item.vue index 70ba449113bdba..64ed68fafd8757 100644 --- a/app/assets/javascripts/comment_templates/components/list_item.vue +++ b/app/assets/javascripts/comment_templates/components/list_item.vue @@ -74,7 +74,7 @@ export default { diff --git a/app/assets/javascripts/comment_templates/components/list.vue b/app/assets/javascripts/comment_templates/components/list.vue index 1de9c72f939818..b0397472358b63 100644 --- a/app/assets/javascripts/comment_templates/components/list.vue +++ b/app/assets/javascripts/comment_templates/components/list.vue @@ -1,23 +1,13 @@ diff --git a/app/assets/javascripts/comment_templates/components/list_item.vue b/app/assets/javascripts/comment_templates/components/list_item.vue index 64ed68fafd8757..eb861de0a51f52 100644 --- a/app/assets/javascripts/comment_templates/components/list_item.vue +++ b/app/assets/javascripts/comment_templates/components/list_item.vue @@ -94,9 +94,9 @@ export default { -
{{ - template.content - }}
+
+ {{ template.content }} +
+import { GlCard, GlLoadingIcon, GlIcon, GlButton } from '@gitlab/ui'; import { fetchPolicies } from '~/lib/graphql'; import CreateForm from '../components/form.vue'; import savedRepliesQuery from '../queries/saved_replies.query.graphql'; @@ -27,6 +28,10 @@ export default { }, }, components: { + GlCard, + GlButton, + GlLoadingIcon, + GlIcon, CreateForm, List, }, @@ -36,34 +41,50 @@ export default { count: 0, pageInfo: {}, pagination: {}, + showForm: false, }; }, methods: { refetchSavedReplies() { this.pagination = {}; this.$apollo.queries.savedReplies.refetch(); + this.toggleShowForm(); }, changePage(pageInfo) { this.pagination = pageInfo; }, + toggleShowForm() { + this.showForm = !this.showForm; + }, }, }; -- GitLab From d6195708446229425cd378d6b2cf9b38bddaeee9 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Fri, 28 Jul 2023 10:46:13 -0600 Subject: [PATCH 3/5] Fix specs and alignment --- .../javascripts/comment_templates/components/list.vue | 2 +- .../javascripts/comment_templates/components/list_item.vue | 4 ++-- .../features/profiles/user_creates_comment_template_spec.rb | 1 + .../components/__snapshots__/list_item_spec.js.snap | 6 ++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/comment_templates/components/list.vue b/app/assets/javascripts/comment_templates/components/list.vue index b0397472358b63..aac3b48b868d43 100644 --- a/app/assets/javascripts/comment_templates/components/list.vue +++ b/app/assets/javascripts/comment_templates/components/list.vue @@ -33,7 +33,7 @@ export default {