summaryrefslogtreecommitdiff
path: root/packages/frontend/src
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2023-10-07 13:13:13 +0900
committerGitHub <noreply@github.com>2023-10-07 13:13:13 +0900
commit5e8c0deab3d62c2c2cfd1fda14dc63179f65257d (patch)
tree230920c73d7350cf22b1cc1dc25880c62317dd52 /packages/frontend/src
parentバックエンドのテストの改善 (#11978) (diff)
downloadmisskey-5e8c0deab3d62c2c2cfd1fda14dc63179f65257d.tar.gz
misskey-5e8c0deab3d62c2c2cfd1fda14dc63179f65257d.tar.bz2
misskey-5e8c0deab3d62c2c2cfd1fda14dc63179f65257d.zip
プライバシーポリシー・運営者情報のリンクを追加 (#11925)
* 運営者情報・プライバシーポリシーリンクを追加 * Update Changelog * Run api extractor * プライバシーポリシー・利用規約の同意をまとめる * Update Changelog * fix lint * fix * api extractor * improve design * nodeinfoにプライバシーポリシー・運営者情報を追加
Diffstat (limited to 'packages/frontend/src')
-rw-r--r--packages/frontend/src/components/MkSignupDialog.rules.vue43
-rw-r--r--packages/frontend/src/components/MkVisitorDashboard.vue20
-rw-r--r--packages/frontend/src/pages/about.vue18
-rw-r--r--packages/frontend/src/pages/admin/moderation.vue8
-rw-r--r--packages/frontend/src/pages/admin/settings.vue9
-rw-r--r--packages/frontend/src/ui/_common_/common.ts20
6 files changed, 96 insertions, 22 deletions
diff --git a/packages/frontend/src/components/MkSignupDialog.rules.vue b/packages/frontend/src/components/MkSignupDialog.rules.vue
index aa4a184d7b..76163ab68b 100644
--- a/packages/frontend/src/components/MkSignupDialog.rules.vue
+++ b/packages/frontend/src/components/MkSignupDialog.rules.vue
@@ -30,13 +30,15 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch :modelValue="agreeServerRules" style="margin-top: 16px;" @update:modelValue="updateAgreeServerRules">{{ i18n.ts.agree }}</MkSwitch>
</MkFolder>
- <MkFolder v-if="availableTos" :defaultOpen="true">
- <template #label>{{ i18n.ts.termsOfService }}</template>
- <template #suffix><i v-if="agreeTos" class="ti ti-check" style="color: var(--success)"></i></template>
+ <MkFolder v-if="availableTos || availablePrivacyPolicy" :defaultOpen="true">
+ <template #label>{{ tosPrivacyPolicyLabel }}</template>
+ <template #suffix><i v-if="agreeTosAndPrivacyPolicy" class="ti ti-check" style="color: var(--success)"></i></template>
+ <div class="_gaps_s">
+ <div v-if="availableTos"><a :href="instance.tosUrl" class="_link" target="_blank">{{ i18n.ts.termsOfService }} <i class="ti ti-external-link"></i></a></div>
+ <div v-if="availablePrivacyPolicy"><a :href="instance.privacyPolicyUrl" class="_link" target="_blank">{{ i18n.ts.privacyPolicy }} <i class="ti ti-external-link"></i></a></div>
+ </div>
- <a :href="instance.tosUrl" class="_link" target="_blank">{{ i18n.ts.termsOfService }} <i class="ti ti-external-link"></i></a>
-
- <MkSwitch :modelValue="agreeTos" style="margin-top: 16px;" @update:modelValue="updateAgreeTos">{{ i18n.ts.agree }}</MkSwitch>
+ <MkSwitch :modelValue="agreeTosAndPrivacyPolicy" style="margin-top: 16px;" @update:modelValue="updateAgreeTosAndPrivacyPolicy">{{ i18n.ts.agree }}</MkSwitch>
</MkFolder>
<MkFolder :defaultOpen="true">
@@ -70,14 +72,15 @@ import MkInfo from '@/components/MkInfo.vue';
import * as os from '@/os.js';
const availableServerRules = instance.serverRules.length > 0;
-const availableTos = instance.tosUrl != null;
+const availableTos = instance.tosUrl != null && instance.tosUrl !== '';
+const availablePrivacyPolicy = instance.privacyPolicyUrl != null && instance.privacyPolicyUrl !== '';
const agreeServerRules = ref(false);
-const agreeTos = ref(false);
+const agreeTosAndPrivacyPolicy = ref(false);
const agreeNote = ref(false);
const agreed = computed(() => {
- return (!availableServerRules || agreeServerRules.value) && (!availableTos || agreeTos.value) && agreeNote.value;
+ return (!availableServerRules || agreeServerRules.value) && ((!availableTos && !availablePrivacyPolicy) || agreeTosAndPrivacyPolicy.value) && agreeNote.value;
});
const emit = defineEmits<{
@@ -85,6 +88,18 @@ const emit = defineEmits<{
(ev: 'done'): void;
}>();
+const tosPrivacyPolicyLabel = computed(() => {
+ if (availableTos && availablePrivacyPolicy) {
+ return i18n.ts.tosAndPrivacyPolicy;
+ } else if (availableTos) {
+ return i18n.ts.termsOfService;
+ } else if (availablePrivacyPolicy) {
+ return i18n.ts.privacyPolicy;
+ } else {
+ return "";
+ }
+});
+
async function updateAgreeServerRules(v: boolean) {
if (v) {
const confirm = await os.confirm({
@@ -99,17 +114,19 @@ async function updateAgreeServerRules(v: boolean) {
}
}
-async function updateAgreeTos(v: boolean) {
+async function updateAgreeTosAndPrivacyPolicy(v: boolean) {
if (v) {
const confirm = await os.confirm({
type: 'question',
title: i18n.ts.doYouAgree,
- text: i18n.t('iHaveReadXCarefullyAndAgree', { x: i18n.ts.termsOfService }),
+ text: i18n.t('iHaveReadXCarefullyAndAgree', {
+ x: tosPrivacyPolicyLabel.value,
+ }),
});
if (confirm.canceled) return;
- agreeTos.value = true;
+ agreeTosAndPrivacyPolicy.value = true;
} else {
- agreeTos.value = false;
+ agreeTosAndPrivacyPolicy.value = false;
}
}
diff --git a/packages/frontend/src/components/MkVisitorDashboard.vue b/packages/frontend/src/components/MkVisitorDashboard.vue
index e4520bbb2d..40493a5d06 100644
--- a/packages/frontend/src/components/MkVisitorDashboard.vue
+++ b/packages/frontend/src/components/MkVisitorDashboard.vue
@@ -104,7 +104,25 @@ function showMenu(ev) {
action: () => {
os.pageWindow('/about-misskey');
},
- }, null, {
+ }, null, (instance.impressumUrl) ? {
+ text: i18n.ts.impressum,
+ icon: 'ti ti-file-invoice',
+ action: () => {
+ window.open(instance.impressumUrl, '_blank');
+ },
+ } : undefined, (instance.tosUrl) ? {
+ text: i18n.ts.termsOfService,
+ icon: 'ti ti-notebook',
+ action: () => {
+ window.open(instance.tosUrl, '_blank');
+ },
+ } : undefined, (instance.privacyPolicyUrl) ? {
+ text: i18n.ts.privacyPolicy,
+ icon: 'ti ti-shield-lock',
+ action: () => {
+ window.open(instance.privacyPolicyUrl, '_blank');
+ },
+ } : undefined, (!instance.impressumUrl && !instance.tosUrl && !instance.privacyPolicyUrl) ? undefined : null, {
text: i18n.ts.help,
icon: 'ti ti-help-circle',
action: () => {
diff --git a/packages/frontend/src/pages/about.vue b/packages/frontend/src/pages/about.vue
index 02768b0774..ee4043f9a5 100644
--- a/packages/frontend/src/pages/about.vue
+++ b/packages/frontend/src/pages/about.vue
@@ -46,14 +46,18 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #value>{{ instance.maintainerEmail }}</template>
</MkKeyValue>
</FormSplit>
- <MkFolder v-if="instance.serverRules.length > 0">
- <template #label>{{ i18n.ts.serverRules }}</template>
+ <FormLink v-if="instance.impressumUrl" :to="instance.impressumUrl" external>{{ i18n.ts.impressum }}</FormLink>
+ <div class="_formLinks">
+ <MkFolder v-if="instance.serverRules.length > 0">
+ <template #label>{{ i18n.ts.serverRules }}</template>
- <ol class="_gaps_s" :class="$style.rules">
- <li v-for="item in instance.serverRules" :class="$style.rule"><div :class="$style.ruleText" v-html="item"></div></li>
- </ol>
- </MkFolder>
- <FormLink v-if="instance.tosUrl" :to="instance.tosUrl" external>{{ i18n.ts.termsOfService }}</FormLink>
+ <ol class="_gaps_s" :class="$style.rules">
+ <li v-for="item, index in instance.serverRules" :key="index" :class="$style.rule"><div :class="$style.ruleText" v-html="item"></div></li>
+ </ol>
+ </MkFolder>
+ <FormLink v-if="instance.tosUrl" :to="instance.tosUrl" external>{{ i18n.ts.termsOfService }}</FormLink>
+ <FormLink v-if="instance.privacyPolicyUrl" :to="instance.privacyPolicyUrl" external>{{ i18n.ts.privacyPolicy }}</FormLink>
+ </div>
</div>
</FormSection>
diff --git a/packages/frontend/src/pages/admin/moderation.vue b/packages/frontend/src/pages/admin/moderation.vue
index 46f92729e8..8b160635f7 100644
--- a/packages/frontend/src/pages/admin/moderation.vue
+++ b/packages/frontend/src/pages/admin/moderation.vue
@@ -25,6 +25,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.tosUrl }}</template>
</MkInput>
+ <MkInput v-model="privacyPolicyUrl">
+ <template #prefix><i class="ti ti-link"></i></template>
+ <template #label>{{ i18n.ts.privacyPolicyUrl }}</template>
+ </MkInput>
+
<MkTextarea v-model="preservedUsernames">
<template #label>{{ i18n.ts.preservedUsernames }}</template>
<template #caption>{{ i18n.ts.preservedUsernamesDescription }}</template>
@@ -69,6 +74,7 @@ let emailRequiredForSignup: boolean = $ref(false);
let sensitiveWords: string = $ref('');
let preservedUsernames: string = $ref('');
let tosUrl: string | null = $ref(null);
+let privacyPolicyUrl: string | null = $ref(null);
async function init() {
const meta = await os.api('admin/meta');
@@ -77,6 +83,7 @@ async function init() {
sensitiveWords = meta.sensitiveWords.join('\n');
preservedUsernames = meta.preservedUsernames.join('\n');
tosUrl = meta.tosUrl;
+ privacyPolicyUrl = meta.privacyPolicyUrl;
}
function save() {
@@ -84,6 +91,7 @@ function save() {
disableRegistration: !enableRegistration,
emailRequiredForSignup,
tosUrl,
+ privacyPolicyUrl,
sensitiveWords: sensitiveWords.split('\n'),
preservedUsernames: preservedUsernames.split('\n'),
}).then(() => {
diff --git a/packages/frontend/src/pages/admin/settings.vue b/packages/frontend/src/pages/admin/settings.vue
index 09a6cc7e2c..2e3f1611dc 100644
--- a/packages/frontend/src/pages/admin/settings.vue
+++ b/packages/frontend/src/pages/admin/settings.vue
@@ -34,6 +34,12 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkInput>
</FormSplit>
+ <MkInput v-model="impressumUrl">
+ <template #label>{{ i18n.ts.impressumUrl }}</template>
+ <template #prefix><i class="ti ti-link"></i></template>
+ <template #caption>{{ i18n.ts.impressumDescription }}</template>
+ </MkInput>
+
<MkTextarea v-model="pinnedUsers">
<template #label>{{ i18n.ts.pinnedUsers }}</template>
<template #caption>{{ i18n.ts.pinnedUsersDescription }}</template>
@@ -135,6 +141,7 @@ let shortName: string | null = $ref(null);
let description: string | null = $ref(null);
let maintainerName: string | null = $ref(null);
let maintainerEmail: string | null = $ref(null);
+let impressumUrl: string | null = $ref(null);
let pinnedUsers: string = $ref('');
let cacheRemoteFiles: boolean = $ref(false);
let cacheRemoteSensitiveFiles: boolean = $ref(false);
@@ -153,6 +160,7 @@ async function init(): Promise<void> {
description = meta.description;
maintainerName = meta.maintainerName;
maintainerEmail = meta.maintainerEmail;
+ impressumUrl = meta.impressumUrl;
pinnedUsers = meta.pinnedUsers.join('\n');
cacheRemoteFiles = meta.cacheRemoteFiles;
cacheRemoteSensitiveFiles = meta.cacheRemoteSensitiveFiles;
@@ -172,6 +180,7 @@ function save(): void {
description,
maintainerName,
maintainerEmail,
+ impressumUrl,
pinnedUsers: pinnedUsers.split('\n'),
cacheRemoteFiles,
cacheRemoteSensitiveFiles,
diff --git a/packages/frontend/src/ui/_common_/common.ts b/packages/frontend/src/ui/_common_/common.ts
index ca4a71a67f..e075e05db3 100644
--- a/packages/frontend/src/ui/_common_/common.ts
+++ b/packages/frontend/src/ui/_common_/common.ts
@@ -68,7 +68,25 @@ export function openInstanceMenu(ev: MouseEvent) {
text: i18n.ts.manageCustomEmojis,
icon: 'ti ti-icons',
} : undefined],
- }, null, {
+ }, null, (instance.impressumUrl) ? {
+ text: i18n.ts.impressum,
+ icon: 'ti ti-file-invoice',
+ action: () => {
+ window.open(instance.impressumUrl, '_blank');
+ },
+ } : undefined, (instance.tosUrl) ? {
+ text: i18n.ts.termsOfService,
+ icon: 'ti ti-notebook',
+ action: () => {
+ window.open(instance.tosUrl, '_blank');
+ },
+ } : undefined, (instance.privacyPolicyUrl) ? {
+ text: i18n.ts.privacyPolicy,
+ icon: 'ti ti-shield-lock',
+ action: () => {
+ window.open(instance.privacyPolicyUrl, '_blank');
+ },
+ } : undefined, (!instance.impressumUrl && !instance.tosUrl && !instance.privacyPolicyUrl) ? undefined : null, {
text: i18n.ts.help,
icon: 'ti ti-help-circle',
action: () => {