Merge pull request #69 from sartography/feature/default_display_order_74

chore/fixes 74
This commit is contained in:
Dan Funk 2021-04-16 16:42:52 -04:00 committed by GitHub
commit 18119e96d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 26 deletions

View File

@ -12,7 +12,7 @@ RUN npm install && \
### STAGE 2: Run ###
FROM quay.io/sartography/nginx:alpine
RUN set -x && apk add --update --no-cache bash libintl gettext curl
RUN set -x && apk add --update --no-cache bash libintl gettext curl``
COPY --from=builder /app/dist/* /etc/nginx/html/
COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf

18
package-lock.json generated
View File

@ -11921,9 +11921,9 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sartography-workflow-lib": {
"version": "0.0.415",
"resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.415.tgz",
"integrity": "sha512-dc/JObsAq0TqGra/NuHG23EpmXrfnQqxbhGWXXkTfySDcA9beRNxJ5nd7xlc8EZzbUiWXIKxVM3xiyBCBQ+88A=="
"version": "0.0.447",
"resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.447.tgz",
"integrity": "sha512-xGBS1YQbXKj3O3I8bK58m7D2NApUpZUuzE3FxLTjS52Q1FL6Hgw2GY8urTJ/BF0a4ROEIHUaPm/4BN9yuzx33w=="
},
"sass": {
"version": "1.26.3",
@ -12999,9 +12999,9 @@
}
},
"ssri": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz",
"integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==",
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
"integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==",
"dev": true,
"requires": {
"minipass": "^3.1.1"
@ -15421,9 +15421,9 @@
"dev": true
},
"y18n": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
"integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dev": true
},
"yallist": {

View File

@ -54,7 +54,7 @@
"ngx-markdown": "^9.1.1",
"protractor": "^7.0.0",
"rxjs": "~6.5.4",
"sartography-workflow-lib": "0.0.415",
"sartography-workflow-lib": "0.0.447",
"tslib": "^1.13.0",
"uuid": "^7.0.2",
"zone.js": "^0.10.3"

View File

@ -89,19 +89,7 @@ export class WorkflowSpecDialogComponent {
description: 'Write a few sentences explaining to users why this workflow exists and what it should be used for.',
required: true,
},
},
{
key: 'display_order',
type: 'input',
defaultValue: this.data.display_order,
templateOptions: {
type: 'number',
label: 'Display Order',
placeholder: 'Order in which spec will be displayed',
description: 'Sort order that the spec should appear in within its category. Lower numbers will appear first.',
required: true,
},
},
}
];
});
}

View File

@ -81,6 +81,7 @@ export class FileListComponent implements OnInit, OnChanges {
makePrimary(fmPrimary: FileMeta) {
if (fmPrimary.type === FileType.BPMN) {
let numUpdated = 0;
// Fixme: This buisness rule does not belong here.
this.fileMetas.forEach(fm => {
fm.primary = (fmPrimary.id === fm.id);
this.api.updateFileMeta(fm).subscribe(() => {

View File

@ -23,7 +23,6 @@ import {
} from '../_interfaces/dialog-data';
import { ApiErrorsComponent } from 'sartography-workflow-lib';
import { ActivatedRoute } from '@angular/router';
import { debounceTime, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';
import { Location } from '@angular/common';
import { environment } from '../../environments/environment.runtime';
import { FormControl } from '@angular/forms';
@ -113,6 +112,7 @@ export class WorkflowSpecListComponent implements OnInit {
display_order: hasDisplayOrder ? selectedSpec.display_order : 0,
};
// Open new filename/workflow spec dialog
const dialogRef = this.dialog.open(WorkflowSpecDialogComponent, {
height: '65vh',
@ -122,7 +122,8 @@ export class WorkflowSpecListComponent implements OnInit {
dialogRef.afterClosed().subscribe((data: WorkflowSpecDialogData) => {
if (data && data.id && data.name && data.display_name && data.description) {
this._upsertWorkflowSpecification(selectedSpec == null, data);
data.display_order = this.categories.filter(function (entry) { return entry.id === data.category_id; }).length;
this._upsertWorkflowSpecification(selectedSpec == null, data);
}
});
}