Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UBERF-4799: Fix migration tasktype doubling #4289

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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