1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-21 14:35:29 +02:00

enhance(frontend): IDにUUIDを使うのをやめる (#16138)

* wip

* Update flash-edit.vue
This commit is contained in:
syuilo
2025-06-03 07:31:19 +09:00
committed by GitHub
parent 2a077de148
commit 3bc81522c6
25 changed files with 78 additions and 57 deletions

View File

@@ -66,7 +66,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref, watch } from 'vue';
import { v4 as uuid } from 'uuid';
import { genId } from '@/utility/id.js';
import MkInput from '@/components/MkInput.vue';
import MkSelect from '@/components/MkSelect.vue';
import MkButton from '@/components/MkButton.vue';
@@ -104,7 +104,7 @@ const type = computed({
set: (t) => {
if (t === 'and') v.value.values = [];
if (t === 'or') v.value.values = [];
if (t === 'not') v.value.value = { id: uuid(), type: 'isRemote' };
if (t === 'not') v.value.value = { id: genId(), type: 'isRemote' };
if (t === 'roleAssignedTo') v.value.roleId = '';
if (t === 'createdLessThan') v.value.sec = 86400;
if (t === 'createdMoreThan') v.value.sec = 86400;
@@ -119,7 +119,7 @@ const type = computed({
});
function addValue() {
v.value.values.push({ id: uuid(), type: 'isRemote' });
v.value.values.push({ id: genId(), type: 'isRemote' });
}
function valuesItemUpdated(item) {

View File

@@ -21,7 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { computed, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { v4 as uuid } from 'uuid';
import { genId } from '@/utility/id.js';
import XEditor from './roles.editor.vue';
import * as os from '@/os.js';
import { misskeyApi } from '@/utility/misskey-api.js';
@@ -55,7 +55,7 @@ if (props.id) {
color: null,
iconUrl: null,
target: 'manual',
condFormula: { id: uuid(), type: 'isRemote' },
condFormula: { id: genId(), type: 'isRemote' },
isPublic: false,
isExplorable: false,
asBadge: false,

View File

@@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
import { defineAsyncComponent, inject, onMounted, watch, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { v4 as uuid } from 'uuid';
import { genId } from '@/utility/id.js';
import XContainer from '../page-editor.container.vue';
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
@@ -73,7 +73,7 @@ async function add() {
});
if (canceled) return;
const id = uuid();
const id = genId();
children.value.push({ id, type });
}

View File

@@ -62,7 +62,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { computed, provide, watch, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { v4 as uuid } from 'uuid';
import { genId } from '@/utility/id.js';
import { url } from '@@/js/config.js';
import XBlocks from './page-editor.blocks.vue';
import MkButton from '@/components/MkButton.vue';
@@ -200,7 +200,7 @@ async function add() {
});
if (canceled) return;
const id = uuid();
const id = genId();
content.value.push({ id, type });
}
@@ -240,7 +240,7 @@ async function init() {
content.value = page.value.content;
eyeCatchingImageId.value = page.value.eyeCatchingImageId;
} else {
const id = uuid();
const id = genId();
content.value = [{
id,
type: 'text',

View File

@@ -119,7 +119,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { computed, ref, watch } from 'vue';
import { v4 as uuid } from 'uuid';
import { genId } from '@/utility/id.js';
import XPalette from './emoji-palette.palette.vue';
import MkRadios from '@/components/MkRadios.vue';
import MkButton from '@/components/MkButton.vue';
@@ -159,7 +159,7 @@ function addPalette() {
prefer.commit('emojiPalettes', [
...prefer.s.emojiPalettes,
{
id: uuid(),
id: genId(),
name: '',
emojis: [],
},

View File

@@ -17,7 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { onMounted, ref, computed } from 'vue';
import * as Misskey from 'misskey-js';
import { v4 as uuid } from 'uuid';
import { genId } from '@/utility/id.js';
import XStatusbar from './statusbar.statusbar.vue';
import MkFolder from '@/components/MkFolder.vue';
import MkButton from '@/components/MkButton.vue';
@@ -38,7 +38,7 @@ onMounted(() => {
async function add() {
prefer.commit('statusbars', [...statusbars.value, {
id: uuid(),
id: genId(),
type: null,
black: false,
size: 'medium',

View File

@@ -75,7 +75,7 @@ SPDX-License-Identifier: AGPL-3.0-only
import { watch, ref, computed } from 'vue';
import { toUnicode } from 'punycode.js';
import tinycolor from 'tinycolor2';
import { v4 as uuid } from 'uuid';
import { genId } from '@/utility/id.js';
import JSON5 from 'json5';
import lightTheme from '@@/themes/_light.json5';
import darkTheme from '@@/themes/_dark.json5';
@@ -192,7 +192,7 @@ async function saveAs() {
});
if (canceled) return;
theme.value.id = uuid();
theme.value.id = genId();
theme.value.name = name;
theme.value.author = `@${$i.username}@${toUnicode(host)}`;
if (description.value) theme.value.desc = description.value;