-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
193 additions
and
3 deletions.
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
ui/src/app/metadata/configuration/component/filter-version-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| <ng-container *ngIf="filters.dates.length > 0"> | ||
| <div class="d-flex border-bottom border-light border-2 py-2"> | ||
| <span [ngStyle]="{'width.%': width}" *ngIf="!comparing">Order</span> | ||
| <span [ngStyle]="{'width.%': width}" *ngIf="comparing">Option</span> | ||
| <strong *ngFor="let date of filters.dates" [ngStyle]="{'width.%': width}"> | ||
| {{ date | date:'medium' }} | ||
| </strong> | ||
| </div> | ||
| <ng-container *ngIf="!comparing"> | ||
| <div class=""> | ||
| <ng-container *ngFor="let version of filters.filters; let i = index; first as isFirst; last as isLast;" | ||
| class="list-group-item"> | ||
| <div class="d-flex border-bottom border-light"> | ||
| <div [ngStyle]="{'width.%': width}" class="py-2"> | ||
| {{ i + 1 }} | ||
| </div> | ||
| <div *ngFor="let filter of version; let i = index; even as isEven" | ||
| [ngStyle]="{'width.%': width}" | ||
| class="border-primary p-2 d-flex align-items-center" | ||
| [ngClass]="{'bg-lighter': isEven && selected !== filter.id, 'bg-primary-light': selected === filter.id}"> | ||
| <div class="w-50"> | ||
| <p>{{ filter.name }}</p> | ||
| <p class="mb-0 text-muted">{{ filter.type }}</p> | ||
| </div> | ||
| <button class="btn btn-link mx-auto" | ||
| *ngIf="filter.comparable" | ||
| (click)="selected = (selected !== filter.id) ? filter.id : null"> | ||
| <i class="fa fa-lg" | ||
| [ngClass]="{'fa-check-square-o': selected === filter.id, 'fa-square-o': selected !== filter.id}" | ||
| aria-hidden="true"></i> | ||
| <span class="sr-only">Compare</span> | ||
| </button> | ||
| </div> | ||
| </div> | ||
| </ng-container> | ||
| </div> | ||
| <div class="d-flex justify-content-end my-2"> | ||
| <button class="btn btn-primary" [disabled]="!selected" (click)="compare(selected)"> | ||
| <translate-i18n key="label.compare-selected">Compare Selected</translate-i18n> | ||
| </button> | ||
| </div> | ||
| </ng-container> | ||
| <ng-container *ngIf="comparing"> | ||
| <div class="d-flex border-bottom border-light py-2"> | ||
| <span class="d-block" | ||
| role="term" | ||
| [ngStyle]="{'width.%': width}">Type</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">EntityAttributesFilter</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">EntityAttributesFilter</span> | ||
| </div> | ||
| <div class="d-flex border-bottom border-light py-2"> | ||
| <span class="d-block" | ||
| role="term" | ||
| [ngStyle]="{'width.%': width}">Name</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">Test Filter 1</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">Renamed Filter</span> | ||
| </div> | ||
| <div class="d-flex border-bottom border-light py-2"> | ||
| <span class="d-block" | ||
| role="term" | ||
| [ngStyle]="{'width.%': width}">Target Type</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">Entity ID</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">Entity ID</span> | ||
| </div> | ||
| <div class="d-flex border-bottom border-light py-2"> | ||
| <span class="d-block" | ||
| role="term" | ||
| [ngStyle]="{'width.%': width}">Target Value</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">http://idp.unicon.net/idp/shibboleth</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">http://idp.unicon.net/idp/shibboleth</span> | ||
| </div> | ||
| <div class="d-flex border-bottom border-light py-2"> | ||
| <span class="d-block" | ||
| role="term" | ||
| [ngStyle]="{'width.%': width}">Enabled?</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">false</span> | ||
| <span class="d-block" | ||
| role="definition" | ||
| [ngStyle]="{'width.%': width}">true</span> | ||
| </div> | ||
| <div class="d-flex justify-content-end my-2"> | ||
| <button class="btn btn-success" (click)="comparing = null"> | ||
| <i class="fa fa-arrow-left" aria-hidden="true"></i> | ||
| Filter Versions | ||
| </button> | ||
| </div> | ||
| </ng-container> | ||
| </ng-container> | ||
| <div class="alert alert-info m-4" *ngIf="filters && filters.dates.length < 1"> | ||
| <h3 translate="message.no-filters">No Filters</h3> | ||
| <p translate="message.no-filters-added">No filters have been added to this Metadata Provider</p> | ||
| </div> |
73 changes: 73 additions & 0 deletions
73
ui/src/app/metadata/configuration/component/filter-version-list.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import { Component } from '@angular/core'; | ||
|
|
||
| const data = { | ||
| dates: ['2019-08-08T08:40:32.015', '2019-08-08T08:40:19.266'], | ||
| filters: [ | ||
| [ | ||
| { | ||
| id: '1', | ||
| name: 'Example Filter 1', | ||
| type: 'EntityAttributesFilter', | ||
| comparable: true | ||
| }, | ||
| { | ||
| id: '2', | ||
| name: 'Example Filter 2', | ||
| type: 'NameIdFilter', | ||
| comparable: true | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| id: '2', | ||
| name: 'Example Filter 2', | ||
| type: 'NameIdFilter', | ||
| comparable: true | ||
| }, | ||
| { | ||
| id: '1', | ||
| name: 'Example Filter 1', | ||
| type: 'EntityAttributesFilter', | ||
| comparable: true | ||
| } | ||
| ], | ||
| [ | ||
| { | ||
| id: '4', | ||
| name: 'Example Filter 4', | ||
| type: 'EntityAttributesFilter', | ||
| comparable: false | ||
| }, | ||
| { | ||
| id: '3', | ||
| name: 'Example Filter 3', | ||
| type: 'EntityAttributesFilter', | ||
| comparable: false | ||
| } | ||
| ] | ||
| ] | ||
| }; | ||
|
|
||
| @Component({ | ||
| selector: 'filter-version-list', | ||
| templateUrl: './filter-version-list.component.html' | ||
| }) | ||
| export class FilterVersionListComponent { | ||
|
|
||
| filters = data; | ||
| selected: string; | ||
| comparing: string; | ||
|
|
||
| constructor() { | ||
|
|
||
| } | ||
|
|
||
| compare(id: string): void { | ||
| this.comparing = id; | ||
| } | ||
|
|
||
| get width(): string { | ||
| const columns = this.filters.dates.length; | ||
| return `${Math.floor(100 / (columns + 1))}`; | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters