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 {
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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { UtilTranslations } from '../../../util/util-translations';
88
99
1010export 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 ;
You can’t perform that action at this time.
0 commit comments