File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
desktop/src/app/components/resources/widgets Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -1336,6 +1336,14 @@ export class BuiltInConfiguration {
1336
1336
editable : true ,
1337
1337
visible : true ,
1338
1338
inputType : 'relation'
1339
+ } ,
1340
+ {
1341
+ name : 'hasWorkflowStep' ,
1342
+ domain : [ 'Find' , 'Sample' ] ,
1343
+ range : [ 'WorkflowStep' ] ,
1344
+ editable : false ,
1345
+ visible : false ,
1346
+ inputType : 'relation'
1339
1347
}
1340
1348
] ;
1341
1349
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ export namespace Relation {
110
110
*/
111
111
export const SAME_AS = 'isSameAs' ;
112
112
113
+ export const HAS_WORKFLOW_STEP = 'hasWorkflowStep' ;
113
114
114
115
export const UNIDIRECTIONAL = Hierarchy . ALL . concat ( [ IS_PRESENT_IN ] ) ;
115
116
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { UtilTranslations } from '../../../util/util-translations';
8
8
9
9
10
10
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' ;
12
12
13
13
14
14
@Component ( {
@@ -57,7 +57,8 @@ export class ResourcesContextMenuComponent implements OnChanges {
57
57
|| this . isWarningsOptionAvailable ( )
58
58
|| this . isAddQRCodeOptionAvailable ( )
59
59
|| this . isEditQRCodeOptionAvailable ( )
60
- || this . isScanStoragePlaceOptionIsAvailable ( ) ;
60
+ || this . isScanStoragePlaceOptionIsAvailable ( )
61
+ || this . isEditWorkflowOptionAvailable ( ) ;
61
62
}
62
63
63
64
@@ -139,6 +140,17 @@ export class ResourcesContextMenuComponent implements OnChanges {
139
140
}
140
141
141
142
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
+
142
154
private isQrCodeOptionAvailable ( ) : boolean {
143
155
144
156
if ( ! this . isEditOptionAvailable ( ) ) return false ;
You can’t perform that action at this time.
0 commit comments