UBERF-4799: Fix migration tasktype doubling (#4289)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-12-29 23:29:19 +07:00 committed by GitHub
parent d6291c7d70
commit b782769647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 8 deletions

View File

@ -640,6 +640,10 @@ export async function fixTaskTypes (
const resultProjects: Project[] = []
for (const t of projectTypes) {
if (t.tasks?.length > 0) {
// Already migrated.
continue
}
t.tasks = [...(t.tasks ?? [])]
if (t.targetClass === undefined) {
const targetProjectClassId: Ref<Class<Doc>> = generateId()

View File

@ -55,7 +55,11 @@ async function reorderStates (_client: MigrationUpgradeClient): Promise<void> {
const bIndex = order.indexOf(states.get(b)?.category ?? task.statusCategory.UnStarted)
return aIndex - bIndex
})
await client.diffUpdate(taskType, { statuses })
try {
await client.diffUpdate(taskType, { statuses })
} catch (err: any) {
console.error(err)
}
}
}

View File

@ -173,13 +173,18 @@ export function mouseAttractor (op: () => void, diff = 2): (evt: MouseEvent) =>
* @returns {string} string with replaced URLs
*/
export function replaceURLs (text: string): string {
return autolinker.link(text, {
urls: true,
phone: false,
email: false,
sanitizeHtml: true,
stripPrefix: false
})
try {
return autolinker.link(text, {
urls: true,
phone: false,
email: false,
sanitizeHtml: true,
stripPrefix: false
})
} catch (err: any) {
console.error(err)
return text
}
}
/**

View File

@ -31,6 +31,7 @@ export { default as Reactions } from './components/reactions/Reactions.svelte'
export { default as ActivityMessageTemplate } from './components/activity-message/ActivityMessageTemplate.svelte'
export { default as ActivityMessagePresenter } from './components/activity-message/ActivityMessagePresenter.svelte'
export { default as ActivityExtension } from './components/ActivityExtension.svelte'
export { default as ActivityMessageHeader } from './components/activity-message/ActivityMessageHeader.svelte'
export default async (): Promise<Resources> => ({
component: {