-
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 Implemented filter component
- Loading branch information
Showing
25 changed files
with
421 additions
and
82 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
48 changes: 48 additions & 0 deletions
48
ui/src/app/metadata/configuration/component/filter-configuration-list-item.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,48 @@ | ||
<div class="d-flex justify-content-start align-items-center"> | ||
<span class="mr-2">{{ index + 1 }}</span> | ||
<div class="d-flex justify-content-between"> | ||
<button class="btn btn-link btn-sm" (click)="onUpdateOrderUp.emit(filter)" [disabled]="isFirst"> | ||
<i class="fa fa-arrow-circle-up fa-2x sr-hidden"></i> | ||
<span class="sr-only" translate="action.move-up">Move Up</span> | ||
</button> | ||
<button class="btn btn-link btn-sm" (click)="onUpdateOrderDown.emit(filter)" [disabled]="isLast"> | ||
<i class="fa fa-arrow-circle-down fa-2x sr-hidden"></i> | ||
<span class="sr-only" translate="action.move-up">Move Down</span> | ||
</button> | ||
</div> | ||
<button class="btn btn-link mx-4" (click)="open = !open">{{ filter.name }}</button> | ||
<span class="">{{ filter['@type'] }}</span> | ||
<span class="ml-4"> | ||
<span class="badge badge-primary" *ngIf="filter.filterEnabled">Enabled</span> | ||
<span class="badge badge-primary" *ngIf="!filter.filterEnabled">Disabled</span> | ||
</span> | ||
</div> | ||
<div *ngIf="open"> | ||
<hr class="my-2" /> | ||
<div class="d-flex justify-content-between mb-2"> | ||
<a class="btn btn-link" routerLink=""> | ||
<i class="fa fa-eye sr-hidden"></i> | ||
<translate-i18n key="action.preview-xml">Preview XML</translate-i18n> | ||
</a> | ||
<div class="d-flex justify-content-between"> | ||
<a class="btn btn-link" | ||
[routerLink]="['../../', 'filter', filter.resourceId, 'edit']"> | ||
<i class="fa fa-edit sr-hidden"></i> | ||
<translate-i18n key="action.edit">Edit</translate-i18n> | ||
</a> | ||
<button class="btn btn-link" | ||
(click)="onRemove.emit(filter.resourceId)"> | ||
<i class="fa fa-trash sr-hidden"></i> | ||
<translate-i18n key="action.delete">Delete</translate-i18n> | ||
</button> | ||
</div> | ||
</div> | ||
<metadata-configuration | ||
[numbered]="false" | ||
[editable]="false" | ||
[configuration]="configuration"></metadata-configuration> | ||
<button class="btn btn-link btn-sm" (click)="open = !open" [disabled]="isLast"> | ||
<i class="fa fa-chevron-up sr-hidden"></i> | ||
<span translate="action.close">Close</span> | ||
</button> | ||
</div> |
40 changes: 40 additions & 0 deletions
40
ui/src/app/metadata/configuration/component/filter-configuration-list-item.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,40 @@ | ||
import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core'; | ||
import { MetadataFilter } from '../../domain/model'; | ||
import { MetadataConfigurationService } from '../service/configuration.service'; | ||
import { Wizard } from '../../../wizard/model'; | ||
import { MetadataConfiguration } from '../model/metadata-configuration'; | ||
|
||
@Component({ | ||
selector: 'filter-configuration-list-item', | ||
templateUrl: './filter-configuration-list-item.component.html' | ||
}) | ||
export class FilterConfigurationListItemComponent implements OnChanges { | ||
@Input() filter: MetadataFilter; | ||
@Input() index: number; | ||
@Input() isFirst: boolean; | ||
@Input() isLast: boolean; | ||
|
||
@Output() onUpdateOrderUp: EventEmitter<MetadataFilter> = new EventEmitter(); | ||
@Output() onUpdateOrderDown: EventEmitter<MetadataFilter> = new EventEmitter(); | ||
@Output() onRemove: EventEmitter<string> = new EventEmitter(); | ||
|
||
open = false; | ||
configuration: MetadataConfiguration; | ||
|
||
constructor( | ||
private configService: MetadataConfigurationService | ||
) {} | ||
|
||
ngOnChanges(changes: SimpleChanges): void { | ||
if (changes.filter) { | ||
const definition = this.configService.getDefinition(this.filter['@type']); | ||
this.configService.loadSchema(definition.schema).subscribe(schema => { | ||
this.configuration = this.configService.getMetadataConfiguration( | ||
this.filter, | ||
definition, | ||
schema | ||
); | ||
}); | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
ui/src/app/metadata/configuration/component/filter-configuration-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,13 @@ | ||
<ul class="list-group list-group-flush"> | ||
<li *ngFor="let filter of filters; let i = index; first as isFirst; last as isLast;" | ||
class="list-group-item"> | ||
<filter-configuration-list-item | ||
[filter]="filter" | ||
[index]="i" | ||
[isFirst]="isFirst" | ||
[isLast]="isLast" | ||
(onUpdateOrderDown)="onUpdateOrderDown.emit($event)" | ||
(onUpdateOrderUp)="onUpdateOrderUp.emit($event)" | ||
(onRemove)="onRemove.emit($event)"></filter-configuration-list-item> | ||
</li> | ||
</ul> |
8 changes: 8 additions & 0 deletions
8
ui/src/app/metadata/configuration/component/filter-configuration-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,8 @@ | ||
import { Component } from '@angular/core'; | ||
import { FilterListComponent } from '../../filter/container/filter-list.component'; | ||
|
||
@Component({ | ||
selector: 'filter-configuration-list', | ||
templateUrl: './filter-configuration-list.component.html' | ||
}) | ||
export class FilterConfigurationListComponent extends FilterListComponent { } |
11 changes: 7 additions & 4 deletions
11
ui/src/app/metadata/configuration/component/metadata-configuration.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
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
2 changes: 1 addition & 1 deletion
2
ui/src/app/metadata/configuration/container/configuration.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
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.