Skip to content

Commit bf3204e

Browse files
committed
Show correct labels for execution date in workflow editor modal
1 parent 0e98d61 commit bf3204e

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

desktop/src/app/components/resources/actions/edit-workflow/workflow-editor-modal.component.ts

+19-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
22
import { NgbActiveModal, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
33
import { set } from 'tsfun';
44
import { CategoryForm, FieldDocument, Document, RelationsManager, Relation, Resource, Datastore, Labels,
5-
ProjectConfiguration } from 'idai-field-core';
5+
ProjectConfiguration, DateSpecification } from 'idai-field-core';
66
import { Menus } from '../../../../services/menus';
77
import { MenuContext } from '../../../../services/menu-context';
88
import { DoceditComponent } from '../../../docedit/docedit.component';
@@ -11,6 +11,8 @@ import { M } from '../../../messages/m';
1111
import { AngularUtility } from '../../../../angular/angular-utility';
1212
import { sortWorkflowSteps } from './sort-workflow-steps';
1313
import { DeleteWorkflowStepModalComponent } from './delete/delete-workflow-step-modal.component';
14+
import { getSystemTimezone } from '../../../../util/timezones';
15+
import { Settings } from '../../../../services/settings/settings';
1416

1517

1618
@Component({
@@ -45,7 +47,7 @@ export class WorkflowEditorModalComponent {
4547

4648
public getShortDescriptionLabel = (workflowStep: Document) =>
4749
Resource.getShortDescriptionLabel(workflowStep.resource, this.labels, this.projectConfiguration);
48-
50+
4951
public cancel = () => this.activeModal.close();
5052

5153

@@ -149,6 +151,21 @@ export class WorkflowEditorModalComponent {
149151
}
150152

151153

154+
public getExecutionDateLabel(workflowStep: Document): string {
155+
156+
if (!workflowStep.resource.executionDate) return '';
157+
158+
const timeSuffix: string = $localize `:@@revisionLabel.timeSuffix:Uhr`;
159+
160+
return DateSpecification.generateLabel(
161+
workflowStep.resource.executionDate,
162+
getSystemTimezone(),
163+
timeSuffix,
164+
Settings.getLocale()
165+
);
166+
}
167+
168+
152169
private async setRelation(workflowStep: Document) {
153170

154171
const oldVersion: Document = Document.clone(workflowStep);

desktop/src/app/components/resources/actions/edit-workflow/workflow-editor-modal.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
[mandatory]="true"
2929
(onChanges)="updateWorkflowSteps()"></workflow-relations>
3030
</div>
31-
<div class="workflow-step-execution-date">{{workflowStep.resource.executionDate}}</div>
31+
<div class="workflow-step-execution-date">{{getExecutionDateLabel(workflowStep)}}</div>
3232
<div class="workflow-step-category">{{getCategoryLabel(workflowStep)}}</div>
3333
<div class="workflow-step-short-description">{{getShortDescriptionLabel(workflowStep)}}</div>
3434
<div *ngIf="isResultsInRelationAvailable(workflowStep)" class="workflow-step-results-in">

desktop/src/app/components/resources/actions/edit-workflow/workflow-editor-modal.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@
5353
}
5454

5555
.workflow-step-execution-date {
56-
flex: 0 0 102px;
56+
flex: 0 0 230px;
57+
display: flex;
58+
align-items: center;
59+
line-height: 17px;
60+
white-space: break-spaces;
5761
}
5862

5963
.workflow-step-category {

0 commit comments

Comments
 (0)