Skip to content

Commit c6740e5

Browse files
committed
Add relation "hasWorkflowStep"
1 parent 2c9b9bf commit c6740e5

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

core/src/configuration/built-in-configuration.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,14 @@ export class BuiltInConfiguration {
13361336
editable: true,
13371337
visible: true,
13381338
inputType: 'relation'
1339+
},
1340+
{
1341+
name: 'hasWorkflowStep',
1342+
domain: ['Find', 'Sample'],
1343+
range: ['WorkflowStep'],
1344+
editable: false,
1345+
visible: false,
1346+
inputType: 'relation'
13391347
}
13401348
];
13411349

core/src/model/configuration/relation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export namespace Relation {
110110
*/
111111
export const SAME_AS = 'isSameAs';
112112

113+
export const HAS_WORKFLOW_STEP = 'hasWorkflowStep';
113114

114115
export const UNIDIRECTIONAL = Hierarchy.ALL.concat([IS_PRESENT_IN]);
115116

desktop/src/app/components/resources/widgets/resources-context-menu.component.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { UtilTranslations } from '../../../util/util-translations';
88

99

1010
export type ResourcesContextMenuAction = 'edit'|'move'|'delete'|'warnings'|'edit-qr-code'|'edit-images'
11-
|'scan-storage-place'|'create-polygon'|'create-line-string'|'create-point'|'edit-geometry';
11+
|'scan-storage-place'|'edit-workflow'|'create-polygon'|'create-line-string'|'create-point'|'edit-geometry';
1212

1313

1414
@Component({
@@ -57,7 +57,8 @@ export class ResourcesContextMenuComponent implements OnChanges {
5757
|| this.isWarningsOptionAvailable()
5858
|| this.isAddQRCodeOptionAvailable()
5959
|| this.isEditQRCodeOptionAvailable()
60-
|| this.isScanStoragePlaceOptionIsAvailable();
60+
|| this.isScanStoragePlaceOptionIsAvailable()
61+
|| this.isEditWorkflowOptionAvailable();
6162
}
6263

6364

@@ -139,6 +140,17 @@ export class ResourcesContextMenuComponent implements OnChanges {
139140
}
140141

141142

143+
public isEditWorkflowOptionAvailable(): boolean {
144+
145+
return this.contextMenu.documents.length === 1
146+
&& this.projectConfiguration.getWorkflowCategories().length > 0
147+
&& this.projectConfiguration.isAllowedRelationDomainCategory(
148+
this.contextMenu.documents[0].resource.category,
149+
'WorkflowStep', Relation.HAS_WORKFLOW_STEP
150+
);
151+
}
152+
153+
142154
private isQrCodeOptionAvailable(): boolean {
143155

144156
if (!this.isEditOptionAvailable()) return false;

0 commit comments

Comments
 (0)