Commit 55762458 authored by Justin Ho's avatar Justin Ho

Add empty state and remove old HAML views

Add changelog
parent 42857501
<script> <script>
import { GlButton, GlTable } from '@gitlab/ui'; import { GlButton, GlEmptyState, GlTable } from '@gitlab/ui';
import { isEmpty } from 'lodash';
import { removeSubscription } from '~/jira_connect/api'; import { removeSubscription } from '~/jira_connect/api';
import { reloadPage } from '~/jira_connect/utils'; import { reloadPage } from '~/jira_connect/utils';
import { __, s__ } from '~/locale'; import { __, s__ } from '~/locale';
...@@ -9,6 +10,7 @@ import GroupItemName from './group_item_name.vue'; ...@@ -9,6 +10,7 @@ import GroupItemName from './group_item_name.vue';
export default { export default {
components: { components: {
GlButton, GlButton,
GlEmptyState,
GlTable, GlTable,
GroupItemName, GroupItemName,
TimeagoTooltip, TimeagoTooltip,
...@@ -33,7 +35,14 @@ export default { ...@@ -33,7 +35,14 @@ export default {
label: '', label: '',
}, },
], ],
i18n: {
emptyTitle: s__('Integrations|No linked namespaces'),
emptyDescription: s__(
'Integrations|Namespaces are the GitLab groups and subgroups you link to this Jira instance.',
),
},
methods: { methods: {
isEmpty,
onClick(item) { onClick(item) {
removeSubscription(item.unlink_path) removeSubscription(item.unlink_path)
.then(() => { .then(() => {
...@@ -47,17 +56,24 @@ export default { ...@@ -47,17 +56,24 @@ export default {
</script> </script>
<template> <template>
<gl-table :items="subscriptions" :fields="$options.fields"> <div>
<template #cell(name)="{ item }"> <gl-empty-state
<group-item-name :group="item.group" /> v-if="isEmpty(subscriptions)"
</template> :title="$options.i18n.emptyTitle"
<template #cell(created_at)="{ item }"> :description="$options.i18n.emptyDescription"
<timeago-tooltip :time="item.created_at" /> />
</template> <gl-table v-else :items="subscriptions" :fields="$options.fields">
<template #cell(actions)="{ item }"> <template #cell(name)="{ item }">
<gl-button category="secondary" :loading="false" @click.prevent="onClick(item)">{{ <group-item-name :group="item.group" />
__('Unlink') </template>
}}</gl-button> <template #cell(created_at)="{ item }">
</template> <timeago-tooltip :time="item.created_at" />
</gl-table> </template>
<template #cell(actions)="{ item }">
<gl-button category="secondary" :loading="false" @click.prevent="onClick(item)">{{
__('Unlink')
}}</gl-button>
</template>
</gl-table>
</div>
</template> </template>
...@@ -22,25 +22,6 @@ ...@@ -22,25 +22,6 @@
- else - else
.js-jira-connect-app{ data: jira_connect_app_data(@subscriptions) } .js-jira-connect-app{ data: jira_connect_app_data(@subscriptions) }
.jira-connect-app-body
- if @subscriptions.present?
%table.subscriptions.gl-w-full
%thead
%tr
%th= _('Namespace')
%th= _('Added')
%th
%tbody
- @subscriptions.each do |subscription|
%tr
%td= subscription.namespace.full_path
%td= subscription.created_at
%td= link_to _('Remove'), jira_connect_subscription_path(subscription), class: 'js-jira-connect-remove-subscription'
- else
.gl-text-center
%h4= s_('Integrations|No linked namespaces')
%p= s_('Integrations|Namespaces are the GitLab groups and subgroups you link to this Jira instance.')
%p.jira-connect-app-body.gl-mt-7.gl-font-base.gl-text-center %p.jira-connect-app-body.gl-mt-7.gl-font-base.gl-text-center
%strong= s_('Integrations|Browser limitations') %strong= s_('Integrations|Browser limitations')
- firefox_link_url = 'https://www.mozilla.org/en-US/firefox/' - firefox_link_url = 'https://www.mozilla.org/en-US/firefox/'
......
---
title: Update Jira subscriptions list to use Vue
merge_request: 57561
author:
type: changed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment