diff --git a/.github/workflows/deploy-test-environment.yml b/.github/workflows/deploy-test-environment.yml index 66b15beb91..be49843a0f 100644 --- a/.github/workflows/deploy-test-environment.yml +++ b/.github/workflows/deploy-test-environment.yml @@ -33,19 +33,13 @@ jobs: - name: Check allowed users id: check-allowed-users env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ORG_ID: ${{ github.repository_owner_id }} - COMMENT_AUTHOR: ${{ github.event.comment.user.login }} + ALLOWED_USER: ${{ github.repository_owner_id }} + COMMENT_AUTHOR: ${{ github.event.comment.user.id }} run: | - MEMBERSHIP_STATUS=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "https://api.github.com/organizations/$ORG_ID/public_members/$COMMENT_AUTHOR" \ - -o /dev/null -w '%{http_code}\n' -s) - if [ "$MEMBERSHIP_STATUS" -eq 204 ]; then - echo "is-allowed-user=true" > $GITHUB_OUTPUT + if ["$COMMENT_AUTHOR" = "$ALLOWED_USER"]; then + echo "is-allowed-user=true" >> $GITHUB_OUTPUT else - echo "is-allowed-user=false" > $GITHUB_OUTPUT + echo "is-allowed-user=false" >> $GITHUB_OUTPUT fi - name: Get PR ref diff --git a/CHANGELOG_engawa.md b/CHANGELOG_engawa.md index 77c24011e8..26c7845a61 100644 --- a/CHANGELOG_engawa.md +++ b/CHANGELOG_engawa.md @@ -15,7 +15,23 @@ ### Misc --> -## x.x.x (unreleased) +## 0.5.1(unreleased) + +### Release Date + +### General +- スプラッシュスクリーン(画面ロード時にぐるぐるが表示される画面)にカスタムテキストを適用できるように + +### Client +- + +### Server +- + +### Misc + + +## 0.5.0 ### Release Date diff --git a/locales/en-US.yml b/locales/en-US.yml index e019b6ee02..b0f36547e7 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1179,6 +1179,8 @@ sensitiveWordsDescription2: "Using spaces will create AND expressions and surrou prohibitedWords: "Prohibited words" prohibitedWordsDescription: "Enables an error when attempting to post a note containing the set word(s). Multiple words can be set, separated by a new line." prohibitedWordsDescription2: "Using spaces will create AND expressions and surrounding keywords with slashes will turn them into a regular expression." +customSplashText: "Custom splash text" +customSplashTextDescription: "This text will be displayed on the loading page." hiddenTags: "Hidden hashtags" hiddenTagsDescription: "Select tags which will not shown on trend list.\nMultiple tags could be registered by lines." notesSearchNotAvailable: "Note search is unavailable." diff --git a/locales/index.d.ts b/locales/index.d.ts index 90a3be076b..7ac618b411 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -4756,6 +4756,14 @@ export interface Locale extends ILocale { * スペースで区切るとAND指定になり、キーワードをスラッシュで囲むと正規表現になります。 */ "prohibitedWordsDescription2": string; + /** + * カスタムスプラッシュテキスト + */ + "customSplashText": string; + /** + * ロード画面に表示されるテキストを設定します。改行で区切って複数設定できます。 + */ + "customSplashTextDescription": string; /** * 非表示ハッシュタグ */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 6389c4affd..9fb1dd8664 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1183,6 +1183,8 @@ sensitiveWordsDescription2: "スペースで区切るとAND指定になり、キ prohibitedWords: "禁止ワード" prohibitedWordsDescription: "設定したワードが含まれるノートを投稿しようとした際、エラーとなるようにします。改行で区切って複数設定できます。" prohibitedWordsDescription2: "スペースで区切るとAND指定になり、キーワードをスラッシュで囲むと正規表現になります。" +customSplashText: "カスタムスプラッシュテキスト" +customSplashTextDescription: "ロード画面に表示されるテキストを設定します。改行で区切って複数設定できます。" hiddenTags: "非表示ハッシュタグ" hiddenTagsDescription: "設定したタグをトレンドに表示させないようにします。改行で区切って複数設定できます。" notesSearchNotAvailable: "ノート検索は利用できません。" diff --git a/packages/backend/migration/1723982389378-AddCustomSplash.js b/packages/backend/migration/1723982389378-AddCustomSplash.js new file mode 100644 index 0000000000..a69d208d70 --- /dev/null +++ b/packages/backend/migration/1723982389378-AddCustomSplash.js @@ -0,0 +1,11 @@ +export class AddCustomSplash1723982389378 { + name = 'AddCustomSplash1723982389378' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "customSplashText" character varying(1024) array NOT NULL DEFAULT '{}'`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "customSplashText"`); + } +} diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts index 803c80513e..7acb3ca9cc 100644 --- a/packages/backend/src/models/Meta.ts +++ b/packages/backend/src/models/Meta.ts @@ -765,4 +765,11 @@ export class MiMeta { nullable: true, }) public skipCherryPickVersion: string | null; + + @Column('varchar', { + length: 1024, + array: true, + default: '{}', + }) + public customSplashText: string[]; } diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index ce0fcb4110..0fabcd7bee 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -567,6 +567,13 @@ export const meta = { type: 'string', optional: true, nullable: true, }, + customSplashText: { + type: 'array', + optional: false, nullable: false, + items: { + type: 'string', + }, + }, }, }, } as const; @@ -731,6 +738,7 @@ export default class extends Endpoint { // eslint- enableReceivePrerelease: instance.enableReceivePrerelease, skipVersion: instance.skipVersion, skipCherryPickVersion: instance.skipCherryPickVersion, + customSplashText: instance.customSplashText, }; }); } diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 8b36af3e5a..89fb8c9fd1 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -195,6 +195,9 @@ export const paramDef = { enableReceivePrerelease: { type: 'boolean' }, skipVersion: { type: 'boolean' }, skipCherryPickVersion: { type: 'string', nullable: true }, + customSplashText: { type: 'array', nullable: true, items: { + type: 'string', + }}, }, required: [], } as const; @@ -769,6 +772,10 @@ export default class extends Endpoint { // eslint- set.skipCherryPickVersion = ps.skipCherryPickVersion; } + if (Array.isArray(ps.customSplashText)) { + set.customSplashText = ps.customSplashText.filter(Boolean); + } + const before = await this.metaService.fetch(true); await this.metaService.update(set); diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index ceed7adcb8..8eafaa1adc 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -194,6 +194,7 @@ export class ClientServerService { instanceUrl: this.config.url, metaJson: htmlSafeJsonStringify(await this.metaEntityService.packDetailed(meta)), now: Date.now(), + customSplashText: meta.customSplashText[Math.floor(Math.random() * meta.customSplashText.length)], }; } diff --git a/packages/backend/src/server/web/style.css b/packages/backend/src/server/web/style.css index e1ba956168..556c7a5b17 100644 --- a/packages/backend/src/server/web/style.css +++ b/packages/backend/src/server/web/style.css @@ -10,7 +10,7 @@ html { } #splash { - position: fixed; + position: relative; z-index: 10000; top: 0; left: 0; @@ -45,7 +45,7 @@ html { display: inline-block; width: 28px; height: 28px; - transform: translateY(70px); + transform: translateY(80px); color: var(--accent); } #splashSpinner > .spinner { @@ -62,6 +62,17 @@ html { animation: dash 1.2s ease-in-out infinite; } +#splashText { + position: absolute; + inset: 0; + margin: auto; + display: inline-block; + inline-size: 70%; + block-size: 0; + text-align: center; + padding-block-start: 200px; +} + @keyframes splashSpinner { 0% { transform: rotate(0deg); diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 2b2623cb6d..f355338df4 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -86,6 +86,9 @@ html | JavaScript를 활성화해주세요 div#splash img#splashIcon(src= icon || '/static-assets/splash.png') + span#splashText + block customSplashText + = customSplashText div#splashSpinner diff --git a/packages/cherrypick-js/src/autogen/types.ts b/packages/cherrypick-js/src/autogen/types.ts index 0c8b4e68d7..a5d797b1ab 100644 --- a/packages/cherrypick-js/src/autogen/types.ts +++ b/packages/cherrypick-js/src/autogen/types.ts @@ -5407,6 +5407,7 @@ export type operations = { enableReceivePrerelease: boolean; skipVersion: boolean; skipCherryPickVersion?: string | null; + customSplashText: string[]; }; }; }; @@ -10205,6 +10206,7 @@ export type operations = { enableReceivePrerelease?: boolean; skipVersion?: boolean; skipCherryPickVersion?: string | null; + customSplashText?: string[] | null; }; }; }; diff --git a/packages/frontend/src/pages/admin/branding.vue b/packages/frontend/src/pages/admin/branding.vue index fe1b7c561d..c057878d82 100644 --- a/packages/frontend/src/pages/admin/branding.vue +++ b/packages/frontend/src/pages/admin/branding.vue @@ -89,6 +89,11 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + @@ -133,6 +138,7 @@ const notFoundImageUrl = ref(null); const repositoryUrl = ref(null); const feedbackUrl = ref(null); const manifestJsonOverride = ref('{}'); +const customSplashText = ref(''); async function init() { const meta = await misskeyApi('admin/meta'); @@ -150,6 +156,7 @@ async function init() { repositoryUrl.value = meta.repositoryUrl; feedbackUrl.value = meta.feedbackUrl; manifestJsonOverride.value = meta.manifestJsonOverride === '' ? '{}' : JSON.stringify(JSON.parse(meta.manifestJsonOverride), null, '\t'); + customSplashText.value = meta.customSplashText.join('\n'); } function save() { @@ -168,6 +175,7 @@ function save() { repositoryUrl: repositoryUrl.value === '' ? null : repositoryUrl.value, feedbackUrl: feedbackUrl.value === '' ? null : feedbackUrl.value, manifestJsonOverride: manifestJsonOverride.value === '' ? '{}' : JSON.stringify(JSON5.parse(manifestJsonOverride.value)), + customSplashText: customSplashText.value.split('\n'), }).then(() => { fetchInstance(true); });