Skip to content

Commit

Permalink
Merge branch 'develop' into feature/gh-363
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesrwelch authored Oct 23, 2021
2 parents 5ee21fd + d0f3fa4 commit abda7a0
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 64 deletions.
74 changes: 35 additions & 39 deletions src/app/admin/home/active-sessions/active-sessions.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ <h4 class="marginless">
</span>
</td>
</ng-container>
<ng-container matColumnDef="lastAccessedUrl">
<th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]="!hideFilters" style="cursor: pointer; max-width: 20%; width: 20%;" columnName="lastAccessedUrl">
<span [hidden]="!hideFilters">Last Access URL</span>
<div [hidden]="hideFilters">
<mat-form-field class="filter" [style.width.px]="100" floatLabel="never">
<mat-label>Last Access Url</mat-label>
<input #filters matInput name="last" (keyup)="applyFilter()">
</mat-form-field>
</div>
</th>
<td mat-cell *matCellDef="let record" style="max-width: 20%; width: 20%; text-align: left; word-wrap: break-word;">
{{record.lastAccessedUrl}}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let record; columns: displayedColumns;"></tr>
</table>
Expand All @@ -136,56 +150,24 @@ <h4 class="marginless">
</div>
<div class="table-responsive">
<table mat-table matSort [dataSource]="unauthorised" class="mdm--mat-table table table-striped marginless">
<ng-container matColumnDef="userEmailAddress">
<th mat-header-cell *matHeaderCellDef mat-sort-header="userEmailAddress" [disabled]="!hideFilters" style="cursor: pointer; max-width: 35%; width: 35%;" columnName="userEmailAddress">
<span [hidden]="!hideFilters">Email</span>
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef mat-sort-header="id" [disabled]="!hideFilters" style="cursor: pointer; max-width: 35%; width: 35%;" columnName="id">
<span [hidden]="!hideFilters">Session Id</span>
<div [hidden]="hideFilters">
<mat-form-field class="filter" floatLabel="never">
<mat-label>Email</mat-label>
<input #filters matInput name="userEmailAddress" (keyup)="applyFilter()">
<mat-label>Session Id</mat-label>
<input #filters matInput name="Id" (keyup)="applyFilter()">
</mat-form-field>
</div>
</th>
<td mat-cell *matCellDef="let record" style="max-width: 35%; width: 35%; text-align: left; word-wrap: break-word;">
<div>
<i class="fas fa-circle onlineUser" aria-hidden="true" matTooltip="Online"></i>
{{ record.userEmailAddress }}
{{ record.id }}
</div>
</td>
</ng-container>
<ng-container matColumnDef="userName">
<th mat-header-cell *matHeaderCellDef mat-sort-header="userName" [disabled]="!hideFilters" style="cursor: pointer; max-width: 20%; width: 20%;" columnName="userName">
<span [hidden]="!hideFilters">Name</span>
<div [hidden]="hideFilters">
<mat-form-field class="filter" [style.width.px]="100" floatLabel="never">
<mat-label>Name</mat-label>
<input #filters matInput name="userName" (keyup)="applyFilter()">
</mat-form-field>
</div>
</th>
<td mat-cell *matCellDef="let record" style="max-width: 20%; width: 20%; text-align: left; word-wrap: break-word;">
<div>
{{record.userName}}
</div>
</td>
</ng-container>
<ng-container matColumnDef="userOrganisation">
<th mat-header-cell *matHeaderCellDef mat-sort-header="userOrganisation" [disabled]="!hideFilters" style="cursor: pointer; max-width: 22%; width: 22%;" columnName="userOrganisation">
<span [hidden]="!hideFilters">Organisation</span>
<div [hidden]="hideFilters">
<mat-form-field class="filter" [style.width.px]="100" floatLabel="never">
<mat-label>Organisation</mat-label>
<input #filters matInput name="userOrganisation" (keyup)="applyFilter()">
</mat-form-field>
</div>
</th>
<td mat-cell *matCellDef="let record" style="max-width: 22%; width: 22%; text-align: left; word-wrap: break-word;">
<div>
{{record.userOrganisation}}
</div>
</td>
</ng-container>
<ng-container matColumnDef="start">
<ng-container matColumnDef="start">
<th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]="!hideFilters" style="cursor: pointer; max-width: 10%; width: 10%;" columnName="start">
<span [hidden]="!hideFilters">Start</span>
<div [hidden]="hideFilters">
Expand Down Expand Up @@ -223,6 +205,20 @@ <h4 class="marginless">
</span>
</td>
</ng-container>
<ng-container matColumnDef="lastAccessedUrl">
<th mat-header-cell *matHeaderCellDef mat-sort-header [disabled]="!hideFilters" style="cursor: pointer; max-width: 20%; width: 20%;" columnName="lastAccessedUrl">
<span [hidden]="!hideFilters">Last Access URL</span>
<div [hidden]="hideFilters">
<mat-form-field class="filter" [style.width.px]="100" floatLabel="never">
<mat-label>Last Access Url</mat-label>
<input #filters matInput name="last" (keyup)="applyFilter()">
</mat-form-field>
</div>
</th>
<td mat-cell *matCellDef="let record" style="max-width: 20%; width: 20%; text-align: left; word-wrap: break-word;">
{{record.lastAccessedUrl}}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumnsUnauthorised"></tr>
<tr mat-row *matRowDef="let record; columns: displayedColumnsUnauthorised;"></tr>
</table>
Expand Down
31 changes: 17 additions & 14 deletions src/app/admin/home/active-sessions/active-sessions.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export class ActiveSessionsComponent implements OnInit, AfterViewInit {
hideFilters = true;
dataSource = new MatTableDataSource<any>();

constructor(private messageHandler: MessageHandlerService, private resourcesService: MdmResourcesService) {
this.displayedColumns = ['userEmailAddress', 'userName', 'userOrganisation', 'start', 'lastAccess'];
this.displayedColumnsUnauthorised = ['userEmailAddress', 'userName', 'userOrganisation', 'start', 'lastAccess'];
constructor(private messageHandler: MessageHandlerService, private resourcesService: MdmResourcesService) {
this.displayedColumns = ['userEmailAddress', 'userName', 'userOrganisation', 'start', 'lastAccess','lastAccessedUrl'];
this.displayedColumnsUnauthorised = ['id', 'start', 'lastAccess','lastAccessedUrl'];
}

ngOnInit() {
Expand All @@ -72,18 +72,21 @@ export class ActiveSessionsComponent implements OnInit, AfterViewInit {
order: 'asc'
};

this.resourcesService.admin.activeSessions(options).subscribe(resp => {
for (const [key] of Object.entries(resp.body.items)) {
resp.body.items[key].creationDateTime = new Date(resp.body.items[key].creationDateTime);
resp.body.items[key].lastAccessedDateTime = new Date(resp.body.items[key].lastAccessedDateTime);
if (resp.body.countAuthorised > 0) {
this.records.push(resp.body.items[key]);
}

if (resp.body.countUnauthorised > 0) {
this.unauthorised.push(resp.body.items[key]);
}


this.resourcesService.session.activeSessions({},options).subscribe(resp => {
for (const [key] of Object.entries(resp.body.authorisedItems)) {
resp.body.authorisedItems[key].creationDateTime = new Date(resp.body.authorisedItems[key].creationDateTime);
resp.body.authorisedItems[key].lastAccessedDateTime = new Date(resp.body.authorisedItems[key].lastAccessedDateTime);
this.records.push(resp.body.authorisedItems[key]);
}

for (const [key] of Object.entries(resp.body.unauthorisedItems)) {
resp.body.unauthorisedItems[key].creationDateTime = new Date(resp.body.unauthorisedItems[key].creationDateTime);
resp.body.unauthorisedItems[key].lastAccessedDateTime = new Date(resp.body.unauthorisedItems[key].lastAccessedDateTime);
this.unauthorised.push(resp.body.unauthorisedItems[key]);
}

this.totalItemCount = resp.body.countAuthorised;
this.unauthorisedCount = resp.body.countUnauthorised;
this.dataSource.data = this.records;
Expand Down
16 changes: 9 additions & 7 deletions src/app/import-models/import-models.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class ImportModelsComponent implements OnInit {
private uiRouterGlobals: UIRouterGlobals,
private modelTree: ModelTreeService,
private shared: SharedService
) {}
) { }

ngOnInit() {
this.importType = this.uiRouterGlobals.params.importType
Expand Down Expand Up @@ -150,7 +150,7 @@ export class ImportModelsComponent implements OnInit {
selectedItem.name
);

this.resources.importer.get(selectedItem.namespace,selectedItem.name,selectedItem.version).subscribe((res) => {
this.resources.importer.get(selectedItem.namespace, selectedItem.name, selectedItem.version).subscribe((res) => {
const result = res.body;
this.selectedImporterGroups = result.parameterGroups;

Expand Down Expand Up @@ -254,11 +254,13 @@ export class ImportModelsComponent implements OnInit {
this.messageHandler.showSuccess('Models imported successfully!');
this.broadcast.reloadCatalogueTree();
if (result && result.body.count === 1) {
this.stateHandler.Go(
ModelDomainRequestType[this.importType],
{ id: result.body.items[0].id },
{ reload: true, location: true }
);
setTimeout(() => {
this.stateHandler.Go(
ModelDomainRequestType[this.importType],
{ id: result.body.items[0].id },
{ reload: true, location: true }
);
}, 500);
}
},
(error) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h5 class="marginless">Created</h5>
</div>

<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12" *ngIf="context && context.domainType === 'Folder'">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12" >
<div style="padding: 10px;">
<h4>Classifiers</h4>
<span style="font-size: 12px; font-style: italic;">Filter result based on the following classifier(s):</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,19 @@ export class ElementOwnedDataTypeListComponent implements AfterViewInit, OnInit
const value = x.nativeElement.value;
if (value !== '') {
filter[name] = value;
}
});
}
});

if (this.domainType) {
if (this.domainType.id !== 'DataType') {
filter['domainType'] = this.domainType.id;
}
}

this.filter = filter;
this.filterEvent.emit(filter);

};
};

applyMatSelectFilter() {
this.applyFilter();
Expand Down

0 comments on commit abda7a0

Please sign in to comment.