Skip to content

Commit

Permalink
UBERF-4799: Fix migration tasktype doubling
Browse files Browse the repository at this point in the history
  • Loading branch information
haiodo committed Dec 29, 2023
1 parent d6291c7 commit 4bde7fa
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
4 changes: 4 additions & 0 deletions models/task/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion models/task/src/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down
19 changes: 12 additions & 7 deletions packages/ui/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions plugins/activity-resources/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 4bde7fa

Please sign in to comment.