-
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-1332 converted filter list to re-usable component
- Loading branch information
Showing
18 changed files
with
198 additions
and
94 deletions.
There are no files selected for viewing
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
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
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
62 changes: 62 additions & 0 deletions
62
ui/src/app/metadata/filter/container/filter-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,62 @@ | ||
<table class="table table-striped table-hover"> | ||
<thead class=""> | ||
<tr> | ||
<th></th> | ||
<th></th> | ||
<th translate="label.filter-name">Filter Name</th> | ||
<th translate="label.filter-type">Filter Type</th> | ||
<th translate="label.filter-enabled">Enabled?</th> | ||
<th translate="action.edit">Edit</th> | ||
<th translate="action.delete">Delete</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr *ngFor="let filter of filters; let i = index; first as isFirst; last as isLast;"> | ||
<td class="td-sm"> | ||
<div class="d-flex justify-content-center"> | ||
<button class="btn btn-link" (click)="onUpdateOrderUp.emit(filter)" [disabled]="isFirst"> | ||
<i class="fa fa-arrow-circle-up fa-lg sr-hidden"></i> | ||
<span class="sr-only" translate="action.move-up">Move Up</span> | ||
</button> | ||
<button class="btn btn-link" (click)="onUpdateOrderDown.emit(filter)" [disabled]="isLast"> | ||
<i class="fa fa-arrow-circle-down fa-lg sr-hidden"></i> | ||
<span class="sr-only" translate="action.move-up">Move Down</span> | ||
</button> | ||
</div> | ||
</td> | ||
<td class="td-xs">{{ i + 1 }}</td> | ||
<td class="td-lg">{{ filter.name }}</td> | ||
<td class="td-lg">{{ filter['@type'] }}</td> | ||
<td class="td-sm"> | ||
<div class="d-flex justify-content-center"> | ||
<div class="custom-control custom-switch"> | ||
<input type="checkbox" | ||
class="custom-control-input" | ||
[disabled]="disabled" | ||
[id]="'customSwitch' + i" | ||
[value]="filter.filterEnabled" | ||
[checked]="filter.filterEnabled" | ||
(change)="onToggleEnabled.emit(filter)"> | ||
<label class="custom-control-label" [for]="'customSwitch' + i"> | ||
<span class="sr-only">Toggle this switch element</span> | ||
</label> | ||
</div> | ||
<i class="fa fa-spinner fa-pulse fa-lg fa-fw" *ngIf="disabled"></i> | ||
</div> | ||
</td> | ||
<td class="td-sm"> | ||
<a class="btn btn-link" [class.disabled]="disabled" | ||
[routerLink]="['../', 'filter', filter.resourceId, 'edit']"> | ||
<i class="fa fa-edit fa-lg sr-hidden text-info"></i> | ||
<span class="sr-only" translate="action.edit">Edit</span> | ||
</a> | ||
</td> | ||
<td class="td-sm"> | ||
<button class="btn btn-link" (click)="onRemove.emit(filter.resourceId)"> | ||
<i class="fa fa-trash fa-lg sr-hidden text-danger"></i> | ||
<span class="sr-only" translate="action.edit">Delete</span> | ||
</button> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> |
17 changes: 17 additions & 0 deletions
17
ui/src/app/metadata/filter/container/filter-list.component.scss
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,17 @@ | ||
:host { | ||
.table { | ||
.td-sm { | ||
max-width: 100px; | ||
} | ||
.td-xs { | ||
max-width: 20px; | ||
} | ||
.td-lg { | ||
width: 30%; | ||
} | ||
|
||
td { | ||
vertical-align: middle; | ||
} | ||
} | ||
} |
Empty file.
25 changes: 25 additions & 0 deletions
25
ui/src/app/metadata/filter/container/filter-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,25 @@ | ||
import { Component, Input, Output, EventEmitter } from '@angular/core'; | ||
import { MetadataFilter } from '../../domain/model'; | ||
|
||
import {} from '../../filter/action/collection.action'; | ||
import { NAV_FORMATS } from '../../domain/component/editor-nav.component'; | ||
|
||
@Component({ | ||
selector: 'filter-list', | ||
templateUrl: './filter-list.component.html', | ||
styleUrls: ['./filter-list.component.scss'] | ||
}) | ||
export class FilterListComponent { | ||
|
||
@Input() filters: MetadataFilter[]; | ||
@Input() disabled: boolean; | ||
|
||
@Output() onUpdateOrderUp: EventEmitter<MetadataFilter> = new EventEmitter(); | ||
@Output() onUpdateOrderDown: EventEmitter<MetadataFilter> = new EventEmitter(); | ||
@Output() onRemove: EventEmitter<MetadataFilter> = new EventEmitter(); | ||
@Output() onToggleEnabled: EventEmitter<MetadataFilter> = new EventEmitter(); | ||
|
||
formats = NAV_FORMATS; | ||
|
||
constructor() {} | ||
} |
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
Oops, something went wrong.