Fixes #410,411

also:

* Several linting errors - I upgraded webstorm and this seemed to have fixed the problems that I was having.

* UI fixes for the left hand side

* Speedup for development - use start:dev in the configuration rather than start
This commit is contained in:
Kelly McDonald 2021-08-24 08:53:16 -04:00
parent a32a77fcbc
commit f0207540ee
12 changed files with 851 additions and 992 deletions

View File

@ -53,6 +53,15 @@
"scripts": []
},
"configurations": {
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
},
"production": {
"optimization": {
"scripts": true,
@ -144,7 +153,11 @@
"configurations": {
"production": {
"browserTarget": "cr-connect-bpmn:build:production"
},
"development": {
"browserTarget": "cr-connect-bpmn:build:development"
}
}
},
"extract-i18n": {

1745
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,11 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"start:dev": "ng serve --configuration development",
"build": "ng build",
"build:prod": "ng build --configuration=production --configuration production --base-href=__REPLACE_ME_WITH_BASE_HREF__ --deploy-url=__REPLACE_ME_WITH_DEPLOY_URL__",
"build:staging": "ng build --configuration=staging --configuration production --base-href=__REPLACE_ME_WITH_BASE_HREF__ --deploy-url=__REPLACE_ME_WITH_DEPLOY_URL__",
"build:dev": "ng build --configuration=development",
"build:test": "ng build --configuration=test",
"test": "ng test",
"test:coverage": "ng test --codeCoverage=true --watch=false --browsers=ChromeHeadless",

View File

@ -4,23 +4,15 @@ import EMAIL_REGEX from './email.regex';
import PHONE_REGEX from './phone.regex';
import URL_REGEX from './url.regex';
export const EmailValidator = (control: FormControl): ValidationErrors => {
return !control.value || EMAIL_REGEX.test(control.value) ? null : {email: true};
};
export const EmailValidator = (control: FormControl): ValidationErrors => !control.value || EMAIL_REGEX.test(control.value) ? null : {email: true};
export const EmailValidatorMessage = (err, field: FormlyFieldConfig) => `"${field.formControl.value}" is not a valid email address`;
export const UrlValidator = (control: FormControl): ValidationErrors => {
return !control.value || URL_REGEX.test(control.value) ? null : {url: true};
};
export const UrlValidator = (control: FormControl): ValidationErrors => !control.value || URL_REGEX.test(control.value) ? null : {url: true};
export const UrlValidatorMessage = (err, field: FormlyFieldConfig) => {
return `We cannot save "${field.formControl.value}". Please provide the full path, including http:// or https://`;
};
export const UrlValidatorMessage = (err, field: FormlyFieldConfig) => `We cannot save "${field.formControl.value}". Please provide the full path, including http:// or https://`;
export const PhoneValidator = (control: FormControl): ValidationErrors => {
return !control.value || PHONE_REGEX.test(control.value) ? null : {phone: true};
};
export const PhoneValidator = (control: FormControl): ValidationErrors => !control.value || PHONE_REGEX.test(control.value) ? null : {phone: true};
export const PhoneValidatorMessage = (err, field: FormlyFieldConfig) => `"${field.formControl.value}" is not a valid phone number`;
@ -42,9 +34,9 @@ export const MinValidationMessage = (err, field) => `This value should be more t
export const MaxValidationMessage = (err, field) => `This value should be less than ${field.templateOptions.max}`;
export const ShowError = (field: FieldType) => field.formControl &&
field.formControl.invalid &&
(
field.formControl.dirty ||
(field.options && field.options.parentForm && field.options.parentForm.submitted) ||
(field.field && field.field.validation && field.field.validation.show)
);
field.formControl.invalid &&
(
field.formControl.dirty ||
(field.options && field.options.parentForm && field.options.parentForm.submitted) ||
(field.field && field.field.validation && field.field.validation.show)
);

View File

@ -1,5 +1,3 @@
import { FileType } from 'sartography-workflow-lib';
export const getDiagramTypeFromXml = (xml: string): FileType => {
return (xml && /dmn\.xsd|dmndi:DMNDiagram/.test(xml) ? FileType.DMN : FileType.BPMN);
};
export const getDiagramTypeFromXml = (xml: string): FileType =>(xml && /dmn\.xsd|dmndi:DMNDiagram/.test(xml) ? FileType.DMN : FileType.BPMN);

View File

@ -1,9 +1,10 @@
<div class="file-list">
<mat-list>
<mat-list-item
*ngFor="let fm of workflowLibraries"
*ngFor="let fm of getCurrentItems()"
>
<mat-checkbox (click)="updateItem(fm,isChecked(fm))" [checked]="isChecked(fm)">{{fm.display_name}}</mat-checkbox>
<mat-checkbox (click)="updateItem(fm,isChecked(fm))" [checked]="isChecked(fm)">{{fm.display_name}}</mat-checkbox>
</mat-list-item>
</mat-list>
</div>

View File

@ -11,11 +11,14 @@ import {
})
export class LibraryListComponent implements OnInit, OnChanges {
@Input() workflowSpecId: string;
@Input() showAll: boolean;
workflowLibraries: WorkflowSpec[];
constructor(
private api: ApiService,
) {
this.showAll = false;
this.workflowLibraries =[];
}
ngOnInit() {
@ -35,6 +38,10 @@ export class LibraryListComponent implements OnInit, OnChanges {
return checked;
}
getCurrentItems(){
return this.workflowLibraries.filter((item)=> this.isChecked(item) || this.showAll)
}
updateItem(library: WorkflowSpec , checked: boolean) {
if (checked) {
this.api.deleteWorkflowLibrary(this.workflowSpecId, library.id).subscribe(() => {

View File

@ -26,8 +26,11 @@
<h4>Workflow Spec Files</h4>
<app-file-list [workflowSpec]="workflowSpec"></app-file-list>
<div *ngIf="!workflowSpec.library">
<h4>Included Libraries</h4>
<app-library-list [workflowSpecId]="workflowSpec.id"></app-library-list>
<h4 class="library-list">
<mat-icon (click)="expandToggle()" class="expand" *ngIf="!showAll">chevron_right</mat-icon>
<mat-icon (click)="expandToggle()" class="expand" *ngIf="showAll">expand_more</mat-icon>
Included Libraries</h4>
<app-library-list [showAll]="showAll" [workflowSpecId]="workflowSpec.id"></app-library-list>
</div>
</mat-card-content>
<mat-card-actions>

View File

@ -48,3 +48,11 @@ mat-card {
}
}
.library-list{
margin-top: 2rem;
}
.expand{
margin-right: 5px;
}

View File

@ -1,5 +1,6 @@
import {Component, Input, TemplateRef} from '@angular/core';
import {ApiService, WorkflowSpec} from 'sartography-workflow-lib';
import { WorkflowSpec} from 'sartography-workflow-lib';
@Component({
selector: 'app-workflow-spec-card',
@ -9,9 +10,11 @@ import {ApiService, WorkflowSpec} from 'sartography-workflow-lib';
export class WorkflowSpecCardComponent {
@Input() workflowSpec: WorkflowSpec;
@Input() actionButtons: TemplateRef<any>;
showAll: boolean;
constructor(
private api: ApiService
) {
}
expandToggle() {
this.showAll = !this.showAll;
}
}

View File

@ -36,9 +36,13 @@
<h4>Libraries</h4>
</mat-panel-title>
</mat-expansion-panel-header>
<ng-container *ngFor="let wfs of workflowLibraries" class="workflow-spec" fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start center">
<span [ngClass]="{'spec_menu_item':true, 'library-selected': selectedSpec && wfs.id === selectedSpec.id}" (click)="selectSpec(wfs)">{{wfs.display_name}}</span>
</ng-container>
<mat-list>
<mat-list-item *ngFor="let wfs of workflowLibraries" class="workflow-spec" fxLayout="row" fxLayoutGap="10px" fxLayoutAlign="start center">
<div>
<span [ngClass]="{'library_item':true, 'spec_menu_item':true, 'library-selected': selectedSpec && wfs.id === selectedSpec.id}" (click)="selectSpec(wfs)">{{wfs.display_name}}</span>
</div>
</mat-list-item>
</mat-list>
</mat-expansion-panel>
</mat-accordion>

View File

@ -54,6 +54,10 @@
cursor: pointer;
}
.library_item {
padding: 10px;
}
.spec_menu_item {
flex-flow: row;
display: inline-block;
@ -74,7 +78,6 @@
}
}
.library-selected {
font-weight: bold;
}