Skip to content

Commit

Permalink
Merge branch 'master' into SHIBUI-1509
Browse files Browse the repository at this point in the history
  • Loading branch information
dima767 committed Oct 2, 2019
2 parents d64ed69 + 7c1b756 commit 1a1000a
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ng-container *ngIf="filters && 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 [ngStyle]="{'width.%': width}" *ngIf="!comparing">Order</strong>
<strong [ngStyle]="{'width.%': width}" *ngIf="comparing">Option</strong>
<strong *ngFor="let date of filters.dates" [ngStyle]="{'width.%': width}">
{{ date | date:DATE_FORMAT }}
</strong>
Expand Down Expand Up @@ -39,13 +39,13 @@
</div>
</ng-container>
</div>
<div class="d-flex justify-content-end my-2">
<div class="alert alert-info m-4" *ngIf="filters ? filters.filters.length < 1 : false">
<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>
<div class="d-flex justify-content-end my-2" *ngIf="filters && filters.filters.length > 0">
<button class="btn btn-primary" [disabled]="!selected" (click)="compareSelected()">
<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>
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,4 @@ <h2 class="title h4 m-0 flex-grow-1">
</div>
</section>
</ng-container>
<ng-container *ngIf="zero">
<div class="alert alert-info" role="alert">
No changes
</div>
</ng-container>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,30 @@ <h2 class="mb-4" [ngSwitch]="type$ | async">
</div>
<metadata-configuration
[configuration]="versions$ | async"></metadata-configuration>
<div class="numbered-header d-flex justify-content-start bg-light align-items-center py-1">
<h2 class="title h4 m-0 flex-grow-1">
<span class="text ml-2" translate="label.metadata-filter">Metadata Filter</span>
</h2>
</div>
<ng-container *ngIf="!(filterCompare$ | async)">
<filter-version-list
class="d-block p-2"
[filters]="filters$ | async"
(compare)="compareFilters($event)">
</filter-version-list>
</ng-container>
<ng-container *ngIf="(filterCompare$ | async)">
<br />
<metadata-configuration
[configuration]="filterCompare$ | async"></metadata-configuration>
<div class="d-flex justify-content-end my-2">
<button class="btn btn-success" (click)="resetCompareFilters()">
<i class="fa fa-arrow-left" aria-hidden="true"></i>&nbsp;
<translate-i18n key="label.filter-versions">Filter Versions</translate-i18n>
</button>
<ng-container *ngIf="isProvider$ | async">
<div class="numbered-header d-flex justify-content-start bg-light align-items-center py-1">
<h2 class="title h4 m-0 flex-grow-1">
<span class="text ml-2" translate="label.metadata-filter">Metadata Filter</span>
</h2>
</div>
<ng-container *ngIf="!(filterCompare$ | async)">
<filter-version-list
class="d-block p-2"
[filters]="filters$ | async"
(compare)="compareFilters($event)">
</filter-version-list>
</ng-container>
<ng-container *ngIf="(filterCompare$ | async)">
<br />
<metadata-configuration [configuration]="filterCompare$ | async"></metadata-configuration>
<div class="d-flex justify-content-end my-2">
<button class="btn btn-success" (click)="resetCompareFilters()">
<i class="fa fa-arrow-left" aria-hidden="true"></i>&nbsp;
<translate-i18n key="label.filter-versions">Filter Versions</translate-i18n>
</button>
</div>
</ng-container>
</ng-container>

</div>
<div *ngIf="loading$ | async" class="d-flex justify-content-center">
<i class="fa fa-spinner fa-pulse fa-4x fa-fw"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ export class MetadataComparisonComponent implements OnDestroy {

limiter: BehaviorSubject<boolean> = new BehaviorSubject(false);

versions$: Observable<MetadataConfiguration>;
numVersions$: Observable<number>;
type$: Observable<string>;
versions$: Observable<MetadataConfiguration> = this.store.select(fromReducer.getLimitedComparisonConfigurations);
numVersions$: Observable<number> = this.store.select(getComparisonConfigurationCount);
type$: Observable<string> = this.store.select(fromReducer.getConfigurationModelType);
loading$: Observable<boolean> = this.store.select(fromReducer.getComparisonLoading);
limited$: Observable<boolean> = this.store.select(fromReducer.getViewChangedOnly);
sub: Subscription;
filters$: Observable<FilterConfiguration> = this.store.select(fromReducer.getComparisonFilterConfiguration);
filterCompare$: Observable<MetadataConfiguration> = this.store.select(fromReducer.getLimitedFilterComparisonConfiguration);
isProvider$: Observable<boolean> = this.type$.pipe(map(t => t !== 'resolver'));

constructor(
private store: Store<ConfigurationState>,
Expand All @@ -39,10 +40,6 @@ export class MetadataComparisonComponent implements OnDestroy {
map(versions => new CompareVersionRequest(versions))
).subscribe(this.store);

this.versions$ = this.store.select(fromReducer.getLimitedComparisonConfigurations);
this.numVersions$ = this.store.select(getComparisonConfigurationCount);
this.type$ = this.store.select(fromReducer.getConfigurationModelType);

this.sub = this.limiter.pipe(
withLatestFrom(this.limited$),
map(([compare, limit]) => new ViewChanged(!limit))
Expand Down
10 changes: 9 additions & 1 deletion ui/src/app/metadata/configuration/reducer/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ export const assignValueToProperties = (models, properties, definition: any): an
if (!array) {
return false;
}
return JSON.stringify(model[prop.id]) !== JSON.stringify(array[0][prop.id]);
let prop1 = model[prop.id];
let prop2 = array[0][prop.id];
if (prop1 && prop1.modifiedDate) {
let { checkedModifiedDate, checkedProp } = prop1;
let { firstModifiedDate, firstProp } = prop2;
prop1 = checkedProp;
prop2 = firstProp;
}
return JSON.stringify(prop1) !== JSON.stringify(prop2);
});

const widget = prop.type === 'array' && prop.widget && prop.widget.data ? ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<router-outlet></router-outlet>
</div>
</div>

<wizard-summary
[summary]="summary$ | async"
(onPageSelect)="gotoPage($event)"
*ngIf="currentPage === 'summary'">
</wizard-summary>
</div>
</div>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class ProviderWizardComponent implements OnDestroy {

this.summary$ = combineLatest(
this.store.select(fromWizard.getWizardDefinition),
this.store.select(fromWizard.getSchemaObject),
this.store.select(fromWizard.getParsedSchema),
this.store.select(fromProvider.getEntityChanges)
).pipe(
map(([ definition, schema, model ]) => ({ definition, schema, model }))
Expand Down

0 comments on commit 1a1000a

Please sign in to comment.