diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index eae02d3f6d..1ecd35ff04 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1907,3 +1907,7 @@ _deck: _dialog: charactersExceeded: "最大文字数を超えています! 現在 {current} / 制限 {max}" charactersBelow: "最小文字数を下回っています! 現在 {current} / 制限 {min}" + +_disabledTimeline: + title: "無効化されたタイムライン" + description: "現在のロールでは、このタイムラインを使用することはできません。" diff --git a/packages/frontend/src/ui/deck/tl-column.vue b/packages/frontend/src/ui/deck/tl-column.vue index a947e27e57..c23943d4db 100644 --- a/packages/frontend/src/ui/deck/tl-column.vue +++ b/packages/frontend/src/ui/deck/tl-column.vue @@ -8,12 +8,12 @@ {{ column.name }} -
+

- - {{ $t('disabled-timeline.title') }} + + {{ i18n.ts._disabledTimeline.title }}

-

{{ $t('disabled-timeline.description') }}

+

{{ i18n.ts._disabledTimeline.description }}

@@ -27,6 +27,7 @@ import MkTimeline from '@/components/MkTimeline.vue'; import * as os from '@/os'; import { $i } from '@/account'; import { i18n } from '@/i18n'; +import { instance } from '@/instance'; const props = defineProps<{ column: Column; @@ -40,11 +41,16 @@ const emit = defineEmits<{ let disabled = $ref(false); +const isLocalTimelineAvailable = (($i == null && instance.policies.ltlAvailable) || ($i != null && $i.policies.ltlAvailable)); +const isGlobalTimelineAvailable = (($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable)); + onMounted(() => { if (props.column.tl == null) { setType(); } else if ($i) { - disabled = false; // TODO + disabled = ( + (!((instance.policies.ltlAvailable) || ($i.policies.ltlAvailable)) && ['local', 'social'].includes(props.column.tl)) || + (!((instance.policies.gtlAvailable) || ($i.policies.gtlAvailable)) && ['global'].includes(props.column.tl))); } }); diff --git a/packages/frontend/src/widgets/WidgetTimeline.vue b/packages/frontend/src/widgets/WidgetTimeline.vue index f8e1af5e66..0f6f25b0a9 100644 --- a/packages/frontend/src/widgets/WidgetTimeline.vue +++ b/packages/frontend/src/widgets/WidgetTimeline.vue @@ -15,7 +15,14 @@ -
+
+

+ + {{ i18n.ts._disabledTimeline.title }} +

+

{{ i18n.ts._disabledTimeline.description }}

+
+
@@ -29,8 +36,12 @@ import * as os from '@/os'; import MkContainer from '@/components/MkContainer.vue'; import MkTimeline from '@/components/MkTimeline.vue'; import { i18n } from '@/i18n'; +import { $i } from '@/account'; +import { instance } from '@/instance'; const name = 'timeline'; +const isLocalTimelineAvailable = (($i == null && instance.policies.ltlAvailable) || ($i != null && $i.policies.ltlAvailable)); +const isGlobalTimelineAvailable = (($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable)); const widgetPropsDef = { showHeader: { @@ -128,3 +139,17 @@ defineExpose({ id: props.widget ? props.widget.id : null, }); + +