Skip to content

Commit

Permalink
Added annotationConfigurationPanel option
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunrajlab committed Sep 27, 2024
1 parent b0e3b7a commit d1083f7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/store/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ export interface IWorkerLabels {
annotationShape?: AnnotationShape;
description?: string;
advancedOptionsPanel?: string;
annotationConfigurationPanel?: string;
}

export interface IWorkerImageList {
Expand Down
7 changes: 7 additions & 0 deletions src/store/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,13 @@ export class Properties extends VuexModule {
return labels ? labels.advancedOptionsPanel !== "False" : true;
};
}

get showAnnotationConfigurationPanel() {
return (image: string) => {
const labels = this.workerImageList[image];
return labels ? labels.annotationConfigurationPanel !== "False" : true;
};
}
}

export default getModule(Properties);
12 changes: 12 additions & 0 deletions src/tools/creation/ToolConfiguration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<v-container v-if="basicInternalTemplate.length > 0">
<template v-for="(item, index) in basicInternalTemplate">
<tool-configuration-item
v-if="shouldShowConfigurationItem(item)"
:key="index"
:item="item"
:advanced="false"
Expand All @@ -24,6 +25,7 @@
<v-container>
<template v-for="(item, index) in advancedInternalTemplate">
<tool-configuration-item
v-if="shouldShowConfigurationItem(item)"
:key="index"
:item="item"
:advanced="true"
Expand Down Expand Up @@ -239,5 +241,15 @@ export default class ToolConfiguration extends Vue {
? this.propertiesStore.showAdvancedOptionsPanel(dockerImage)
: true;
}
shouldShowConfigurationItem(item: any) {
if (item.type !== "annotation") {
return true;
}
const dockerImage = this.toolValues?.image?.image;
return dockerImage
? this.propertiesStore.showAnnotationConfigurationPanel(dockerImage)
: true;
}
}
</script>

0 comments on commit d1083f7

Please sign in to comment.