mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
Rename activity->notifications module (#9446)
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
import { defineModule } from '@directus/shared/utils';
|
||||
import ActivityCollection from './routes/collection.vue';
|
||||
import ActivityItem from './routes/item.vue';
|
||||
|
||||
export default defineModule({
|
||||
id: 'activity',
|
||||
hidden: true,
|
||||
name: '$t:activity',
|
||||
icon: 'notifications',
|
||||
routes: [
|
||||
{
|
||||
name: 'activity-collection',
|
||||
path: '',
|
||||
component: ActivityCollection,
|
||||
props: true,
|
||||
children: [
|
||||
{
|
||||
name: 'activity-item',
|
||||
path: ':primaryKey',
|
||||
components: {
|
||||
detail: ActivityItem,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -33,9 +33,9 @@ const checkForSystem: NavigationGuard = (to, from) => {
|
||||
|
||||
if (to.params.collection === 'directus_activity') {
|
||||
if (to.params.primaryKey) {
|
||||
return `/activity/${to.params.primaryKey}`;
|
||||
return `/notifications/${to.params.primaryKey}`;
|
||||
} else {
|
||||
return '/activity';
|
||||
return '/notifications';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
27
app/src/modules/notifications/index.ts
Normal file
27
app/src/modules/notifications/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { defineModule } from '@directus/shared/utils';
|
||||
import NotificationsCollection from './routes/collection.vue';
|
||||
import NotificationsItem from './routes/item.vue';
|
||||
|
||||
export default defineModule({
|
||||
id: 'notifications',
|
||||
hidden: true,
|
||||
name: '$t:notifications',
|
||||
icon: 'notifications',
|
||||
routes: [
|
||||
{
|
||||
name: 'notifications-collection',
|
||||
path: '',
|
||||
component: NotificationsCollection,
|
||||
props: true,
|
||||
children: [
|
||||
{
|
||||
name: 'notifications-item',
|
||||
path: ':primaryKey',
|
||||
components: {
|
||||
detail: NotificationsItem,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -26,7 +26,7 @@
|
||||
</template>
|
||||
|
||||
<template #navigation>
|
||||
<activity-navigation v-model:filter="roleFilter" />
|
||||
<notifications-navigation v-model:filter="roleFilter" />
|
||||
</template>
|
||||
|
||||
<component :is="`layout-${layout}`" v-bind="layoutState" class="layout">
|
||||
@@ -61,7 +61,7 @@
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, computed, ref } from 'vue';
|
||||
import ActivityNavigation from '../components/navigation.vue';
|
||||
import NotificationsNavigation from '../components/navigation.vue';
|
||||
import usePreset from '@/composables/use-preset';
|
||||
import { useLayout } from '@/composables/use-layout';
|
||||
import LayoutSidebarDetail from '@/views/private/components/layout-sidebar-detail';
|
||||
@@ -71,7 +71,7 @@ import { mergeFilters } from '@directus/shared/utils';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ActivityCollection',
|
||||
components: { ActivityNavigation, LayoutSidebarDetail, SearchInput },
|
||||
components: { NotificationsNavigation, LayoutSidebarDetail, SearchInput },
|
||||
props: {
|
||||
primaryKey: {
|
||||
type: String,
|
||||
@@ -39,7 +39,7 @@
|
||||
<v-icon name="launch" />
|
||||
</v-button>
|
||||
|
||||
<v-button v-tooltip.bottom="t('done')" to="/activity" icon rounded>
|
||||
<v-button v-tooltip.bottom="t('done')" to="/notifications" icon rounded>
|
||||
<v-icon name="check" />
|
||||
</v-button>
|
||||
</template>
|
||||
@@ -132,7 +132,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function close() {
|
||||
router.push('/activity');
|
||||
router.push('/notifications');
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -3,7 +3,7 @@
|
||||
<transition-expand tag="div">
|
||||
<div v-if="modelValue" class="inline">
|
||||
<div class="padding-box">
|
||||
<router-link class="link" to="/activity" :class="{ 'has-items': lastFour.length > 0 }">
|
||||
<router-link class="link" to="/notifications" :class="{ 'has-items': lastFour.length > 0 }">
|
||||
{{ t('show_all_activity') }}
|
||||
</router-link>
|
||||
<transition-group tag="div" name="notification" class="transition">
|
||||
|
||||
Reference in New Issue
Block a user