Skip to content

Commit

Permalink
Add relation "hasWorkflowStep"
Browse files Browse the repository at this point in the history
  • Loading branch information
tkleinke committed Mar 3, 2025
1 parent 2c9b9bf commit c6740e5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
8 changes: 8 additions & 0 deletions core/src/configuration/built-in-configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,14 @@ export class BuiltInConfiguration {
editable: true,
visible: true,
inputType: 'relation'
},
{
name: 'hasWorkflowStep',
domain: ['Find', 'Sample'],
range: ['WorkflowStep'],
editable: false,
visible: false,
inputType: 'relation'
}
];

Expand Down
1 change: 1 addition & 0 deletions core/src/model/configuration/relation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export namespace Relation {
*/
export const SAME_AS = 'isSameAs';

export const HAS_WORKFLOW_STEP = 'hasWorkflowStep';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { UtilTranslations } from '../../../util/util-translations';


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


@Component({
Expand Down Expand Up @@ -57,7 +57,8 @@ export class ResourcesContextMenuComponent implements OnChanges {
|| this.isWarningsOptionAvailable()
|| this.isAddQRCodeOptionAvailable()
|| this.isEditQRCodeOptionAvailable()
|| this.isScanStoragePlaceOptionIsAvailable();
|| this.isScanStoragePlaceOptionIsAvailable()
|| this.isEditWorkflowOptionAvailable();
}


Expand Down Expand Up @@ -139,6 +140,17 @@ export class ResourcesContextMenuComponent implements OnChanges {
}


public isEditWorkflowOptionAvailable(): boolean {

return this.contextMenu.documents.length === 1
&& this.projectConfiguration.getWorkflowCategories().length > 0
&& this.projectConfiguration.isAllowedRelationDomainCategory(
this.contextMenu.documents[0].resource.category,
'WorkflowStep', Relation.HAS_WORKFLOW_STEP
);
}


private isQrCodeOptionAvailable(): boolean {

if (!this.isEditOptionAvailable()) return false;
Expand Down

0 comments on commit c6740e5

Please sign in to comment.