mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-02-04 12:53:26 +00:00
Displays tooltip with file and workflow spec metadata
This commit is contained in:
parent
9adb103f18
commit
60841c85b6
@ -12,7 +12,14 @@
|
|||||||
Open previously saved...
|
Open previously saved...
|
||||||
</button>
|
</button>
|
||||||
<mat-menu #dbMenu="matMenu">
|
<mat-menu #dbMenu="matMenu">
|
||||||
<button mat-menu-item *ngFor="let bf of bpmnFiles" (click)="loadDbFile(bf)">
|
<button
|
||||||
|
mat-menu-item
|
||||||
|
*ngFor="let bf of bpmnFiles"
|
||||||
|
(click)="loadDbFile(bf)"
|
||||||
|
[matTooltip]="getFileMetaTooltipText(bf)"
|
||||||
|
matTooltipClass="tooltip-text"
|
||||||
|
matTooltipPosition="right"
|
||||||
|
>
|
||||||
{{getFileMetaDisplayString(bf)}}
|
{{getFileMetaDisplayString(bf)}}
|
||||||
</button>
|
</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
@ -38,7 +45,7 @@
|
|||||||
<button mat-menu-item (click)="diagram.saveXML()"><mat-icon>code</mat-icon> Download XML File</button>
|
<button mat-menu-item (click)="diagram.saveXML()"><mat-icon>code</mat-icon> Download XML File</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
|
|
||||||
<button mat-button *ngIf="diagramFileMeta" (click)="editFileMeta()">
|
<button mat-button *ngIf="diagramFileMeta && diagramFileMeta.workflow_spec_id" (click)="editFileMeta()">
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>edit</mat-icon>
|
||||||
{{getFileMetaDisplayString(diagramFileMeta)}}
|
{{getFileMetaDisplayString(diagramFileMeta)}}
|
||||||
</button>
|
</button>
|
||||||
|
@ -28,3 +28,8 @@ mat-toolbar {
|
|||||||
mat-toolbar.expanded {
|
mat-toolbar.expanded {
|
||||||
height: 128px;
|
height: 128px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::ng-deep .tooltip-text {
|
||||||
|
white-space: pre-line;
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
@ -182,7 +182,6 @@ export class AppComponent implements AfterViewInit {
|
|||||||
if (data && data.fileName && data.workflowSpecId) {
|
if (data && data.fileName && data.workflowSpecId) {
|
||||||
this._upsertSpecAndFileMeta(data);
|
this._upsertSpecAndFileMeta(data);
|
||||||
}
|
}
|
||||||
this._upsertSpecAndFileMeta(data);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,9 +236,22 @@ export class AppComponent implements AfterViewInit {
|
|||||||
return this.workflowSpecs.find(wfs => workflow_spec_id === wfs.id);
|
return this.workflowSpecs.find(wfs => workflow_spec_id === wfs.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
getFileMetaDisplayString(bf: FileMeta) {
|
getFileMetaDisplayString(fileMeta: FileMeta) {
|
||||||
const wfsName = this.getWorkflowSpec(bf.workflow_spec_id).display_name;
|
const wfsName = this.getWorkflowSpec(fileMeta.workflow_spec_id).display_name;
|
||||||
const lastUpdated = new DatePipe('en-us').transform(bf.last_updated);
|
const lastUpdated = new DatePipe('en-us').transform(fileMeta.last_updated);
|
||||||
return `${wfsName} (${bf.name}) - v${bf.version} (${lastUpdated})`;
|
return `${wfsName} (${fileMeta.name}) - v${fileMeta.version} (${lastUpdated})`;
|
||||||
|
}
|
||||||
|
|
||||||
|
getFileMetaTooltipText(fileMeta: FileMeta) {
|
||||||
|
const wfs = this.getWorkflowSpec(fileMeta.workflow_spec_id);
|
||||||
|
const lastUpdated = new DatePipe('en-us').transform(fileMeta.last_updated);
|
||||||
|
return `
|
||||||
|
Workflow spec ID: ${wfs.id}
|
||||||
|
Display name: ${wfs.display_name}
|
||||||
|
Description: ${wfs.description}
|
||||||
|
File name: ${fileMeta.name}
|
||||||
|
Last updated: ${lastUpdated}
|
||||||
|
Version: ${fileMeta.version}
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import {MatMenuModule} from '@angular/material/menu';
|
|||||||
import {MatSnackBarModule} from '@angular/material/snack-bar';
|
import {MatSnackBarModule} from '@angular/material/snack-bar';
|
||||||
import {MatTabsModule} from '@angular/material/tabs';
|
import {MatTabsModule} from '@angular/material/tabs';
|
||||||
import {MatToolbarModule} from '@angular/material/toolbar';
|
import {MatToolbarModule} from '@angular/material/toolbar';
|
||||||
|
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||||
import {BrowserModule} from '@angular/platform-browser';
|
import {BrowserModule} from '@angular/platform-browser';
|
||||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||||
import {AppComponent} from './app.component';
|
import {AppComponent} from './app.component';
|
||||||
@ -39,6 +40,7 @@ import { NewFileDialogComponent } from './new-file-dialog/new-file-dialog.compon
|
|||||||
MatToolbarModule,
|
MatToolbarModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
MatDividerModule,
|
MatDividerModule,
|
||||||
|
MatTooltipModule,
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
entryComponents: [NewFileDialogComponent],
|
entryComponents: [NewFileDialogComponent],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user