diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 3256493456..35f9bff4bb 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -365,9 +365,6 @@ export class TComponent extends TDoc implements Component { @Prop(TypeMarkup(), tracker.string.Description) description?: Markup - @Prop(TypeString(), tracker.string.AssetLabel) - icon!: Asset - @Prop(TypeComponentStatus(), tracker.string.Status) status!: ComponentStatus diff --git a/models/tracker/src/migration.ts b/models/tracker/src/migration.ts index dac14faf94..3e775af4df 100644 --- a/models/tracker/src/migration.ts +++ b/models/tracker/src/migration.ts @@ -310,24 +310,6 @@ async function migrateIssueComponents (client: MigrationClient): Promise { } } -async function upgradeComponentIcons (tx: TxOperations): Promise { - const components = await tx.findAll(tracker.class.Component, {}) - - if (components.length === 0) { - return - } - - for (const component of components) { - const icon = component.icon as unknown - - if (icon !== undefined) { - continue - } - - await tx.update(component, { icon: tracker.icon.Components }) - } -} - async function createDefaults (tx: TxOperations): Promise { await createDefaultProject(tx) await createOrUpdate( @@ -415,10 +397,6 @@ async function upgradeIssues (tx: TxOperations): Promise { } } -async function upgradeComponents (tx: TxOperations): Promise { - await upgradeComponentIcons(tx) -} - async function renameProject (client: MigrationClient): Promise { await client.update( DOMAIN_TRACKER, @@ -786,6 +764,5 @@ export const trackerOperation: MigrateOperation = { await createDefaults(tx) await upgradeProjects(tx) await upgradeIssues(tx) - await upgradeComponents(tx) } } diff --git a/plugins/tracker-resources/src/components/ComponentSelector.svelte b/plugins/tracker-resources/src/components/ComponentSelector.svelte index c831b584aa..e01cd8de67 100644 --- a/plugins/tracker-resources/src/components/ComponentSelector.svelte +++ b/plugins/tracker-resources/src/components/ComponentSelector.svelte @@ -55,7 +55,6 @@ $: handleSelectedComponentIdUpdated(value, rawComponents) $: translate(tracker.string.Component, {}).then((result) => (defaultComponentLabel = result)) - $: componentIcon = selectedComponent?.icon ?? tracker.icon.Components $: componentText = shouldShowLabel ? selectedComponent?.label ?? defaultComponentLabel : undefined const handleSelectedComponentIdUpdated = async ( @@ -81,7 +80,7 @@ { id: null, icon: tracker.icon.Components, label: tracker.string.NoComponent, isSelected: !selectedComponent }, ...rawComponents.map((p) => ({ id: p._id, - icon: p.icon, + icon: tracker.icon.Components, text: p.label, isSelected: selectedComponent ? p._id === selectedComponent._id : false })) @@ -103,7 +102,7 @@ {shape} {width} {justify} - icon={componentIcon} + icon={tracker.icon.Components} disabled={!isEditable} {loading} on:click={handleComponentEditorOpened} @@ -115,7 +114,7 @@ {shape} {width} {justify} - icon={componentIcon} + icon={tracker.icon.Components} disabled={!isEditable} {loading} on:click={handleComponentEditorOpened} diff --git a/plugins/tracker-resources/src/components/components/ComponentTimeline.svelte b/plugins/tracker-resources/src/components/components/ComponentTimeline.svelte index 928f13ebb8..79b305dbe7 100644 --- a/plugins/tracker-resources/src/components/components/ComponentTimeline.svelte +++ b/plugins/tracker-resources/src/components/components/ComponentTimeline.svelte @@ -95,7 +95,6 @@ const tR: TimelineRow = { items: [] } tR.items = [ { - icon: proj.icon, presenter: ComponentPresenter, props: { value: proj }, startDate: proj.startDate as Timestamp, diff --git a/plugins/tracker-resources/src/components/components/ComponentTitlePresenter.svelte b/plugins/tracker-resources/src/components/components/ComponentTitlePresenter.svelte index c18f60be32..463edc363e 100644 --- a/plugins/tracker-resources/src/components/components/ComponentTitlePresenter.svelte +++ b/plugins/tracker-resources/src/components/components/ComponentTitlePresenter.svelte @@ -22,7 +22,7 @@ {#if value} - +
{value.label}
-