Skip to content

Commit

Permalink
SHIBUI-1511 Fixed issues with comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Oct 1, 2019
1 parent 013f42a commit 9a7e7b7
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 31 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 @@ -39,28 +39,13 @@ <h2 class="title h4 m-0 flex-grow-1">
</ng-container>
<ng-container *ngIf="(filterCompare$ | async)">
<br />
<metadata-configuration
[configuration]="filterCompare$ | async"></metadata-configuration>
<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 *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>
</ng-container>
</div>
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 9a7e7b7

Please sign in to comment.