-
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.
SHIBUI-1365 Added mock-up of filter comparison
- Loading branch information
Showing
4 changed files
with
109 additions
and
18 deletions.
There are no files selected for viewing
48 changes: 41 additions & 7 deletions
48
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 |
|---|---|---|
| @@ -1,10 +1,44 @@ | ||
| <ul class="list-group list-group-flush" *ngIf="filters.length > 0"> | ||
| <li *ngFor="let filter of filters; let i = index; first as isFirst; last as isLast;" | ||
| class="list-group-item"> | ||
| {{ filter | json }} | ||
| </li> | ||
| </ul> | ||
| <div class="alert alert-info m-4" *ngIf="filters && filters.length < 1"> | ||
| <ng-container *ngIf="filters.dates.length > 0"> | ||
| <div class="d-flex border-bottom border-light border-2 py-2"> | ||
| <span [ngStyle]="{'width.%': width}">Order</span> | ||
| <strong *ngFor="let date of filters.dates" [ngStyle]="{'width.%': width}"> | ||
| {{ date | date:'medium' }} | ||
| </strong> | ||
| </div> | ||
| <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"> | ||
| <translate-i18n key="label.compare-selected">Compare Selected</translate-i18n> | ||
| </button> | ||
| </div> | ||
| </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> |
64 changes: 62 additions & 2 deletions
64
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 |
|---|---|---|
| @@ -1,8 +1,68 @@ | ||
| import { Component } from '@angular/core'; | ||
| import { FilterListComponent } from '../../filter/component/filter-list.component'; | ||
|
|
||
| const data = { | ||
| dates: ['2019-08-02T12:50:54.282', '2019-08-02T12:12:54.282'], | ||
| 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 extends FilterListComponent { } | ||
| export class FilterVersionListComponent { | ||
|
|
||
| filters = data; | ||
| selected: string; | ||
|
|
||
| constructor() { | ||
|
|
||
| } | ||
|
|
||
| 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