Skip to content

Commit

Permalink
SHIBUI-1361 Fixed titles of config pages
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Aug 9, 2019
1 parent fa8b8b3 commit 8b14299
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
</li>
</ol>
</nav>
<h2 class="mb-4" [ngSwitch]="type$ | async">
<ng-container *ngSwitchCase="'resolver'" translate="label.source">Source</ng-container>
<ng-container *ngSwitchDefault translate="label.provider">Provider</ng-container>
Configuration
</h2>
<ng-container *ngIf="name$ | async">
<router-outlet></router-outlet>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<h2 class="mb-4" [ngSwitch]="type$ | async">
Compare
<ng-container *ngSwitchCase="'resolver'" translate="label.source">Source</ng-container>
<ng-container *ngSwitchDefault translate="label.provider">Provider</ng-container>
Configuration
</h2>
<div class="" [ngClass]="{
'container-fluid': (numVersions$ | async) > 2,
'container': (numVersions$ | async) <= 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Store } from '@ngrx/store';
import { ActivatedRoute } from '@angular/router';
import { map } from 'rxjs/operators';
import { ConfigurationState, getVersionConfigurations, getVersionConfigurationCount } from '../reducer';
import { Metadata } from '../../domain/domain.type';
import { CompareVersionRequest } from '../action/compare.action';
import { MetadataConfiguration } from '../model/metadata-configuration';
import * as fromReducer from '../reducer';

@Component({
selector: 'metadata-comparison',
Expand All @@ -18,6 +18,7 @@ export class MetadataComparisonComponent {

versions$: Observable<MetadataConfiguration>;
numVersions$: Observable<number>;
type$: Observable<string>;

constructor(
private store: Store<ConfigurationState>,
Expand All @@ -30,5 +31,6 @@ export class MetadataComparisonComponent {

this.versions$ = this.store.select(getVersionConfigurations);
this.numVersions$ = this.store.select(getVersionConfigurationCount);
this.type$ = this.store.select(fromReducer.getConfigurationModelType);
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<h2 class="mb-4">
Version History
</h2>
<div class="container">
<history-list
[history]="history$ | async"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<h2 class="mb-4" [ngSwitch]="type$ | async">
<ng-container *ngSwitchCase="'resolver'" translate="label.source">Source</ng-container>
<ng-container *ngSwitchDefault translate="label.provider">Provider</ng-container>
Configuration
</h2>
<div class="container" id="header">
<metadata-header
[isEnabled]="isEnabled$ | async"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Store } from '@ngrx/store';
import { Component, ChangeDetectionStrategy, OnDestroy } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { Router, Event, Scroll } from '@angular/router';
import { Router } from '@angular/router';
import { ViewportScroller } from '@angular/common';
import { takeUntil, filter, delay } from 'rxjs/operators';
import { takeUntil, filter } from 'rxjs/operators';

import {
ConfigurationState,
Expand All @@ -15,7 +15,8 @@ import {
getConfigurationModelEnabled,
getConfigurationHasXml,
getConfigurationModel,
getConfigurationDefinition
getConfigurationDefinition,
getConfigurationModelType
} from '../reducer';
import { MetadataConfiguration } from '../model/metadata-configuration';
import { MetadataVersion } from '../model/version';
Expand All @@ -32,7 +33,6 @@ import {
import { Metadata } from '../../domain/domain.type';
import { DeleteFilterComponent } from '../../provider/component/delete-filter.component';
import { Wizard } from '../../../wizard/model';
import { PreviewEntity } from '../../domain/action/entity.action';

@Component({
selector: 'metadata-options-page',
Expand All @@ -53,6 +53,7 @@ export class MetadataOptionsComponent implements OnDestroy {
filters$: Observable<unknown[]>;
model$: Observable<Metadata>;
definition: Wizard<any>;
type$: Observable<string>;
id: string;
kind: string;

Expand All @@ -73,6 +74,7 @@ export class MetadataOptionsComponent implements OnDestroy {
this.isCurrent$ = this.store.select(getSelectedIsCurrent);
this.hasXml$ = this.store.select(getConfigurationHasXml);
this.filters$ = this.store.select(getAdditionalFilters);
this.type$ = this.store.select(getConfigurationModelType);

this.model$
.pipe(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<h2 class="mb-4" [ngSwitch]="type$ | async">
<ng-container *ngSwitchCase="'resolver'" translate="label.source">Source</ng-container>
<ng-container *ngSwitchDefault translate="label.provider">Provider</ng-container>
Configuration
</h2>
<div class="container-fluid">
<div class="px-3 my-3 d-flex justify-content-end">
<div class="btn-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ describe('Metadata Xml Page Component', () => {

it('should load metadata objects', async(() => {
expect(app).toBeTruthy();
expect(store.select).toHaveBeenCalledTimes(2);
expect(store.select).toHaveBeenCalledTimes(3);
}));
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Store } from '@ngrx/store';
import { Component } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { Observable } from 'rxjs';

import * as fromConfiguration from '../reducer';
import { Metadata } from '../../domain/domain.type';
Expand All @@ -17,12 +17,14 @@ export class MetadataXmlComponent {
entity$: Observable<Metadata>;
xml: string;
xml$: Observable<string>;
type$: Observable<string>;

constructor(
private store: Store<fromConfiguration.ConfigurationState>
) {
this.xml$ = this.store.select(fromConfiguration.getConfigurationXml);
this.entity$ = this.store.select(fromConfiguration.getConfigurationModel);
this.type$ = this.store.select(fromConfiguration.getConfigurationModelType);
}

preview(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<h2 class="mb-4">
Restore Version
</h2>
<div class="d-flex justify-content-center align-items-center">
<div class="card m-4 w-50">
<div class="card-body">
Expand Down

0 comments on commit 8b14299

Please sign in to comment.