diff --git a/smp-angular/src/app/app.component.html b/smp-angular/src/app/app.component.html index ea081424a763ee3d43dbedb9961c6fc8bd5185ba..4957b3e62a203a083267dc15e4bbc37ed0624638 100644 --- a/smp-angular/src/app/app.component.html +++ b/smp-angular/src/app/app.component.html @@ -9,11 +9,11 @@ </div> <button mat-raised-button class="sideNavButton" [routerLink]="['/']" id="search_id"> - <mat-icon matTooltip="Search participants" matTooltipDisabled="{{fullMenu}}" matTooltipDisabled="right">search</mat-icon> + <mat-icon matTooltip="Search" matTooltipDisabled="{{fullMenu}}" matTooltipDisabled="right">search</mat-icon> <span>Search</span> </button> - <button mat-raised-button class="sideNavButton" [routerLink]="['/']" id="edit_id"> - <mat-icon matTooltip="Search participants" matTooltipDisabled="{{fullMenu}}" matTooltipDisabled="right">edit</mat-icon> + <button mat-raised-button class="sideNavButton" [routerLink]="['/edit']" id="edit_id"> + <mat-icon matTooltip="Edit" matTooltipDisabled="{{fullMenu}}" matTooltipDisabled="right">edit</mat-icon> <span>Edit</span> </button> <button mat-raised-button class="sideNavButton" [routerLink]="['/domain']" id="domain_id"> diff --git a/smp-angular/src/app/app.routes.ts b/smp-angular/src/app/app.routes.ts index 784b9cfe20cd8183a6b93c032af96bf37d224fb6..6d09b43e6dbb38723cc9d1b084e9be070f88bd43 100644 --- a/smp-angular/src/app/app.routes.ts +++ b/smp-angular/src/app/app.routes.ts @@ -4,13 +4,13 @@ import {ServiceGroupSearchComponent} from './service-group-search/service-group- import {ServiceGroupComponent} from './service-group-edit/service-group.component'; import {DomainComponent} from './domain/domain.component'; import {AuthenticatedGuard} from './guards/authenticated.guard'; -import {AuthorizedAdminGuard} from './guards/authorized-admin.guard'; import {UserComponent} from './user/user.component'; const appRoutes: Routes = [ {path: '', component: ServiceGroupSearchComponent}, {path: 'search', component: ServiceGroupSearchComponent}, + {path: 'edit', component: ServiceGroupComponent}, {path: 'domain', component: DomainComponent}, {path: 'user', component: UserComponent}, diff --git a/smp-angular/src/app/common/search-table/search-table.component.css b/smp-angular/src/app/common/search-table/search-table.component.css index 163929e63bb1ffe88f047c87a83d0045c52a8263..9cdb4f04898b062cc8287c4f9a45e319793a9ce3 100644 --- a/smp-angular/src/app/common/search-table/search-table.component.css +++ b/smp-angular/src/app/common/search-table/search-table.component.css @@ -25,3 +25,7 @@ left: 8px; bottom: 8px; } +.table-button-expand { + padding: 0 !important; + margin: 0 !important; +} diff --git a/smp-angular/src/app/common/search-table/search-table.component.html b/smp-angular/src/app/common/search-table/search-table.component.html index 5dc0ced5abff0e528d700a330621dffce4524976..5f1075801fcdb3a60f2f369d58779014170d600a 100644 --- a/smp-angular/src/app/common/search-table/search-table.component.html +++ b/smp-angular/src/app/common/search-table/search-table.component.html @@ -57,7 +57,7 @@ <!-- Row Detail Template --> <ngx-datatable-row-detail id="rowDetail" [rowHeight]="'auto'" #searchTableDetailRow (toggle)="onDetailToggle($event)"> - <ng-template let-row="row" let-expanded="expanded" ngx-datatable-row-detail-template> + <ng-template let-row="row" let-expanded="expanded" let-enabled="enabled" ngx-datatable-row-detail-template> <ng-container [ngTemplateOutlet]="tableRowDetailContainer" [ngTemplateOutletContext]="{row:row}"></ng-container> </ng-template> @@ -81,13 +81,12 @@ </div> </ng-template> - <ng-template #rowExpand let-row="row" let-expanded="expanded" ngx-datatable-cell-template> - <a + <ng-template #rowExpand let-row="row" let-expanded="expanded" let-disabled="disabled" ngx-datatable-cell-template > + <span *ngIf="!!disabled">( )</span> + <a *ngIf="!disabled" class="table-button-expand" href="javascript:void(0)" - [class.datatable-icon-right]="!expanded" - [class.datatable-icon-down]="expanded" title="Expand/Collapse Row" - (click)="toggleExpandRow(row)"> + (click)="toggleExpandRow(row)">{{expanded?'(-)':'(+)'}} </a> </ng-template> </div> diff --git a/smp-angular/src/app/common/search-table/search-table.component.ts b/smp-angular/src/app/common/search-table/search-table.component.ts index c72fa207398460c858303acc8a039cccdeb6ee01..ce94644e28ddfde4cdbac44bb2e1049becef49cd 100644 --- a/smp-angular/src/app/common/search-table/search-table.component.ts +++ b/smp-angular/src/app/common/search-table/search-table.component.ts @@ -41,6 +41,7 @@ export class SearchTableComponent implements OnInit { @Input() filter: any = {}; @Input() showActionButtons: boolean = true; @Input() showSearchPanel: boolean = true; + @Input() showIndexColumn: boolean = false; loading = false; @@ -71,6 +72,7 @@ export class SearchTableComponent implements OnInit { cellTemplate: this.rowIndex, name: 'Index', width: 50, + maxWidth:80, sortable: false }; @@ -78,24 +80,29 @@ export class SearchTableComponent implements OnInit { cellTemplate: this.rowActions, name: 'Actions', width: 80, + maxWidth:80, sortable: false }; this.columnExpandDetails= { cellTemplate: this.rowExpand, name: ' ', - width: 20, + width: 40, + maxWidth:50, sortable: false }; // Add actions to last column if (this.columnPicker) { - this.columnPicker.allColumns.unshift(this.columnIndex); - this.columnPicker.selectedColumns.unshift(this.columnIndex); - + // prepend columns if (!!this.tableRowDetailContainer){ this.columnPicker.allColumns.unshift(this.columnExpandDetails); this.columnPicker.selectedColumns.unshift(this.columnExpandDetails); } + if (this.showIndexColumn){ + this.columnPicker.allColumns.unshift(this.columnIndex); + this.columnPicker.selectedColumns.unshift(this.columnIndex); + } + if (this.showActionButtons) { this.columnPicker.allColumns.push(this.columnActions); this.columnPicker.selectedColumns.push(this.columnActions); diff --git a/smp-angular/src/app/service-group-edit/service-group.component.html b/smp-angular/src/app/service-group-edit/service-group.component.html index f8b1282f6f9ac55349981aa4ad019258577a1be5..0bdf69b5bfde596a446e45656788df3b8e5b5049 100644 --- a/smp-angular/src/app/service-group-edit/service-group.component.html +++ b/smp-angular/src/app/service-group-edit/service-group.component.html @@ -2,7 +2,7 @@ page_id='participants_id' title='Participants' [columnPicker]="columnPicker" - url="ui/servicegroup" + url="rest/servicegroup" [additionalToolButtons]="additionalToolButtons" [searchPanel]="searchPanel" [filter]="filter" diff --git a/smp-angular/src/app/service-group-edit/service-group.component.ts b/smp-angular/src/app/service-group-edit/service-group.component.ts index 0edccfd6a11400e469def552ec3264672cd8a69e..3edbb969c6be831ee961e2b6427594dc51ff3688 100644 --- a/smp-angular/src/app/service-group-edit/service-group.component.ts +++ b/smp-angular/src/app/service-group-edit/service-group.component.ts @@ -1,7 +1,6 @@ import {Component, OnInit, TemplateRef, ViewChild} from '@angular/core'; import {ColumnPicker} from '../common/column-picker/column-picker.model'; import {MatDialog, MatDialogRef} from '@angular/material'; -import {ServiceGroupDetailsDialogComponent} from './service-group-details-dialog/service-group-details-dialog.component'; import {AlertService} from '../alert/alert.service'; import {ServiceGroupController} from './service-group-controller'; import {HttpClient} from '@angular/common/http'; diff --git a/smp-angular/src/app/service-group-search/service-group-ro.model.ts b/smp-angular/src/app/service-group-search/service-group-ro.model.ts deleted file mode 100644 index 613bf2b3fceb9dc2571b49626400cbaf14aab23a..0000000000000000000000000000000000000000 --- a/smp-angular/src/app/service-group-search/service-group-ro.model.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ServiceMetadataRo } from './service-metadata-ro.model'; -import {SearchTableEntity} from "../common/search-table/search-table-entity.model"; - -export interface ServiceGroupRo extends SearchTableEntity { - participantIdentifier: string; - participantScheme: string; - serviceMetadata: Array<ServiceMetadataRo>; -} diff --git a/smp-angular/src/app/service-group-search/service-group-search-controller.ts b/smp-angular/src/app/service-group-search/service-group-search-controller.ts index bdf2e3da0afbfeb91cce73bb78b09b6657e06e92..28c1698b66eeffa59163d88512b243bde5630a89 100644 --- a/smp-angular/src/app/service-group-search/service-group-search-controller.ts +++ b/smp-angular/src/app/service-group-search/service-group-search-controller.ts @@ -1,25 +1,17 @@ import {SearchTableController} from '../common/search-table/search-table-controller'; import {MatDialog, MatDialogConfig, MatDialogRef} from '@angular/material'; - -import {UserDetailsDialogComponent} from '../user/user-details-dialog/user-details-dialog.component'; -import {SearchTableEntity} from '../common/search-table/search-table-entity.model'; -import {ServiceGroupRo} from './service-group-ro.model'; -import {SearchTableEntityStatus} from '../common/search-table/search-table-entity-status.model'; +import {ServiceGroupSearchRo} from './service-group-search-ro.model'; export class ServiceGroupSearchController implements SearchTableController { constructor(public dialog: MatDialog) { } public showDetails(row: any) { - } public showExtension(row: any) { - } - - public edit(row: any) { } public delete(row: any) { } @@ -28,8 +20,7 @@ export class ServiceGroupSearchController implements SearchTableController { return null; } - public newRow(): ServiceGroupRo { + public newRow(): ServiceGroupSearchRo { return null; } - } diff --git a/smp-angular/src/app/service-group-search/service-group-search-ro.model.ts b/smp-angular/src/app/service-group-search/service-group-search-ro.model.ts new file mode 100644 index 0000000000000000000000000000000000000000..f20d01a53d4aa8c52d24b9375f98f98f4b915b8f --- /dev/null +++ b/smp-angular/src/app/service-group-search/service-group-search-ro.model.ts @@ -0,0 +1,8 @@ +import { ServiceMetadataSearchRo } from './service-metadata-search-ro.model'; +import {SearchTableEntity} from "../common/search-table/search-table-entity.model"; + +export interface ServiceGroupSearchRo extends SearchTableEntity { + participantIdentifier: string; + participantScheme: string; + serviceMetadata: Array<ServiceMetadataSearchRo>; +} diff --git a/smp-angular/src/app/service-group-search/service-group-search.component.html b/smp-angular/src/app/service-group-search/service-group-search.component.html index 3881811ef79fd27a4e35fd8d0437bcc2c3ac0a28..d9f40a701964ec8f183017c322dffa907e7b87e9 100644 --- a/smp-angular/src/app/service-group-search/service-group-search.component.html +++ b/smp-angular/src/app/service-group-search/service-group-search.component.html @@ -9,6 +9,7 @@ [searchTableController]="serviceGroupSearchController" [tableRowDetailContainer]="tableRowDetailContainer" [showActionButtons]="false" + [showIndexColumn]="true" > @@ -24,7 +25,7 @@ <ng-template #rowSMPUrlLinkAction let-row="row" let-value="value" ngx-datatable-cell-template> <a target="_blank" - href="{{contextPath}}{{row.participantScheme}}::{{row.participantIdentifier}}" >{{row.participantScheme}}::{{row.participantIdentifier}}</a> + href="{{contextPath}}{{row.participantScheme}}::{{row.participantIdentifier}}" >Open URL</a> </ng-template> @@ -53,21 +54,39 @@ <ng-template #additionalToolButtons> - <button mat-raised-button color="primary" + <!-- button mat-raised-button color="primary" id="extensionbutton_id"> <mat-icon>code</mat-icon> <span>Extension</span> - </button> + </button --> </ng-template> <ng-template #tableRowDetailContainer let-row="row"> <div *ngIf="row.serviceMetadata.length===0" style="padding-left:20px;"> - No service metadata; + No service metadata </div> <div *ngIf="row.serviceMetadata.length !== 0" > - <table style="width: 100%"> + <!-- ngx-datatable + class='material striped' + style="width: 80%" + [loadingIndicator]="loading" + [rows]='row.serviceMetadata' + [columns]='[{name:"Domain", prop:"domainCode", maxWidth: 250 },{name:"Document identifier scheme",prop:"documentIdentifierScheme",maxWidth: 350},{name:"Document identifier", prop:"documentIdentifier"},{name:"OASIS SMP URL",maxWidth: 350}]' + [columnMode]='"force"' + [headerHeight]='50' + [footerHeight]='50' + [rowHeight]='"auto"'> + <ng-template #rowMetadataSMPUrlLinkAction let-row="smdRow" let-value="value" ngx-datatable-cell-template> + + <a target="_blank" + href="{{contextPath}}{{row.participantScheme}}::{{row.participantIdentifier}}/services/{{smdRow.documentIdentifierScheme}}::{{smdRow.documentIdentifier}}" >Open URL</a> + + </ng-template> + </ngx-datatable --> + + <table style="width: 80%"> <tr> <th>Domain</th> <th>Document identifier scheme</th> @@ -80,7 +99,7 @@ <td >{{smd.documentIdentifier}}</td> <td style="width: 50em"> <a target="_blank" - href="{{contextPath}}{{row.participantScheme}}::{{row.participantIdentifier}}/services/{{smd.documentIdentifierScheme}}::{{smd.documentIdentifier}}">Oasis URL</a> + href="{{contextPath}}{{row.participantScheme}}::{{row.participantIdentifier}}/services/{{smd.documentIdentifierScheme}}::{{smd.documentIdentifier}}">OASIS ServiceMetadata URL</a> </td> </tr> </table> diff --git a/smp-angular/src/app/service-group-search/service-group-search.component.ts b/smp-angular/src/app/service-group-search/service-group-search.component.ts index 8481c552e27cd876442072d508a5fc524d2505bf..c2768351135ab9b90256a7ec3973d8cd0198a228 100644 --- a/smp-angular/src/app/service-group-search/service-group-search.component.ts +++ b/smp-angular/src/app/service-group-search/service-group-search.component.ts @@ -7,7 +7,6 @@ import {HttpClient} from '@angular/common/http'; import {Observable} from "rxjs/index"; import {SearchTableResult} from "../common/search-table/search-table-result.model"; import {DomainRo} from "../domain/domain-ro.model"; -import {SearchTableEntityStatus} from "../common/search-table/search-table-entity-status.model"; @Component({ moduleId: module.id, @@ -29,7 +28,6 @@ export class ServiceGroupSearchComponent implements OnInit { constructor(protected http: HttpClient, protected alertService: AlertService, public dialog: MatDialog) { this.domainObserver = this.http.get<SearchTableResult>('rest/domain'); - this.domainObserver.subscribe((domains: SearchTableResult) => { this.domainlist = new Array(domains.serviceEntities.length) .map((v, index) => domains.serviceEntities[index] as DomainRo); @@ -51,34 +49,37 @@ export class ServiceGroupSearchComponent implements OnInit { { name: 'Metadata count', prop: 'serviceMetadata.length', - width: 60 + width: 60, + maxWidth: 80 }, { name: 'Participant scheme', prop: 'participantScheme', + maxWidth: 300 }, { name: 'Participant identifier', prop: 'participantIdentifier', - width: 275 }, { cellTemplate: this.rowSMPUrlLinkAction, - name: 'SMP Url', - width: 80, + name: 'OASIS ServiceGroup URL', + width: 150, + maxWidth: 250, sortable: false }, + /* { cellTemplate: this.rowExtensionAction, name: 'Extension', width: 80, sortable: false - } + }*/ ]; this.columnPicker.selectedColumns = this.columnPicker.allColumns.filter(col => { - return ["Metadata count", "Participant scheme", "Participant identifier","SMP Url", "Extension"].indexOf(col.name) != -1 + return ["Metadata count", "Participant scheme", "Participant identifier","OASIS ServiceGroup URL"].indexOf(col.name) != -1 }); } diff --git a/smp-angular/src/app/service-group-search/service-metadata-ro.model.ts b/smp-angular/src/app/service-group-search/service-metadata-search-ro.model.ts similarity index 74% rename from smp-angular/src/app/service-group-search/service-metadata-ro.model.ts rename to smp-angular/src/app/service-group-search/service-metadata-search-ro.model.ts index 9b97f060a8f434757aab48cec326105fb8a7300f..d6260aa78e784f02c4b08b7469819e42568d2511 100644 --- a/smp-angular/src/app/service-group-search/service-metadata-ro.model.ts +++ b/smp-angular/src/app/service-group-search/service-metadata-search-ro.model.ts @@ -1,6 +1,6 @@ import {SearchTableEntity} from "../common/search-table/search-table-entity.model"; -export interface ServiceMetadataRo extends SearchTableEntity { +export interface ServiceMetadataSearchRo extends SearchTableEntity { documentIdentifier: string; documentIdentifierScheme: string; smlSubdomain: string;