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>2021-12-03 09:10:53 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-03 09:10:53 +0300
commitb29d7709c1c992d4e5aa481155ef60003cd43d55 (patch)
treeb201a427596491432f78aadadabce70df9c71a6a /app/assets/javascripts/crm
parentc657078ecb4bff69e58f6911713e143c99f2c71f (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/crm')
-rw-r--r--app/assets/javascripts/crm/components/contacts_root.vue29
-rw-r--r--app/assets/javascripts/crm/contacts_bundle.js4
2 files changed, 29 insertions, 4 deletions
diff --git a/app/assets/javascripts/crm/components/contacts_root.vue b/app/assets/javascripts/crm/components/contacts_root.vue
index 83c02f7d5fe..97220a3409d 100644
--- a/app/assets/javascripts/crm/components/contacts_root.vue
+++ b/app/assets/javascripts/crm/components/contacts_root.vue
@@ -1,15 +1,20 @@
<script>
-import { GlLoadingIcon, GlTable } from '@gitlab/ui';
+import { GlButton, GlLoadingIcon, GlTable, GlTooltipDirective } from '@gitlab/ui';
import createFlash from '~/flash';
import { s__, __ } from '~/locale';
+import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import getGroupContactsQuery from './queries/get_group_contacts.query.graphql';
export default {
components: {
+ GlButton,
GlLoadingIcon,
GlTable,
},
- inject: ['groupFullPath'],
+ directives: {
+ GlTooltip: GlTooltipDirective,
+ },
+ inject: ['groupFullPath', 'groupIssuesPath'],
data() {
return { contacts: [] };
},
@@ -59,9 +64,17 @@ export default {
},
sortable: true,
},
+ {
+ key: 'id',
+ label: __('Issues'),
+ formatter: (id) => {
+ return getIdFromGraphQLId(id);
+ },
+ },
],
i18n: {
emptyText: s__('Crm|No contacts found'),
+ issuesButtonLabel: __('View issues'),
},
};
</script>
@@ -75,6 +88,16 @@ export default {
:fields="$options.fields"
:empty-text="$options.i18n.emptyText"
show-empty
- />
+ >
+ <template #cell(id)="data">
+ <gl-button
+ v-gl-tooltip.hover.bottom="$options.i18n.issuesButtonLabel"
+ data-testid="issues-link"
+ icon="issues"
+ :aria-label="$options.i18n.issuesButtonLabel"
+ :href="`${groupIssuesPath}?scope=all&state=opened&crm_contact_id=${data.value}`"
+ />
+ </template>
+ </gl-table>
</div>
</template>
diff --git a/app/assets/javascripts/crm/contacts_bundle.js b/app/assets/javascripts/crm/contacts_bundle.js
index 6438953596e..b0edd0107b6 100644
--- a/app/assets/javascripts/crm/contacts_bundle.js
+++ b/app/assets/javascripts/crm/contacts_bundle.js
@@ -16,10 +16,12 @@ export default () => {
return false;
}
+ const { groupFullPath, groupIssuesPath } = el.dataset;
+
return new Vue({
el,
apolloProvider,
- provide: { groupFullPath: el.dataset.groupFullPath },
+ provide: { groupFullPath, groupIssuesPath },
render(createElement) {
return createElement(CrmContactsRoot);
},