Skip to content

Commit

Permalink
Merged in feature/SHIBUI-1760 (pull request #466)
Browse files Browse the repository at this point in the history
Feature/SHIBUI-1760
  • Loading branch information
rmathis authored and Jonathan Johnson committed Apr 13, 2021
2 parents eaea799 + af8c08a commit e02aebe
Show file tree
Hide file tree
Showing 42 changed files with 911 additions and 446 deletions.
6 changes: 3 additions & 3 deletions ui/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('karma-spec-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
coverageReporter: {
dir: require('path').join(__dirname, 'coverage'), reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true,
skipFilesWithNoCoverage: false,
Expand All @@ -41,7 +41,7 @@ module.exports = function (config) {
angularCli: {
environment: 'dev'
},
reporters: ['spec', 'coverage-istanbul'],
reporters: ['spec', 'coverage'],
port: 9876,
colors: true,
logLevel: config.LOG_WARN,
Expand Down
207 changes: 76 additions & 131 deletions ui/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-cli": "^2.0.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"karma-coverage": "^2.0.3",
"karma-spec-reporter": "0.0.32",
"ncp": "^2.0.0",
"path": "^0.12.7",
Expand Down
3 changes: 2 additions & 1 deletion ui/src/app/app.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ const routes: Routes = [
scrollOffset: [0, 64],
anchorScrolling: 'enabled',
scrollPositionRestoration: 'enabled',
relativeLinkResolution: 'legacy'
relativeLinkResolution: 'legacy',
paramsInheritanceStrategy: 'always'
})],
exports: [RouterModule]
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,17 @@ export class MetadataOptionsComponent implements OnDestroy {
}

updateOrderUp(filter: MetadataFilter): void {
this.store.dispatch(new ChangeFilterOrderUp(filter.resourceId));
this.store.dispatch(new ChangeFilterOrderUp({
id: filter.resourceId,
providerId: this.activatedRoute.snapshot.params.providerId
}));
}

updateOrderDown(filter: MetadataFilter): void {
this.store.dispatch(new ChangeFilterOrderDown(filter.resourceId));
this.store.dispatch(new ChangeFilterOrderDown({
id: filter.resourceId,
providerId: this.activatedRoute.snapshot.params.providerId
}));
}

removeFilter(id: string): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<a *ngFor="let route of routes$ | async"
href=""
class="dropdown-item"
[routerLink]="['../', 'edit', route.path]"
[routerLink]="['../', path, route.path]"
[ngClass]="{'active': (currentPage$ | async) === route.path}"
[attr.aria-label]="route.label"
role="button">
Expand All @@ -32,7 +32,7 @@
href=""
class="nav-link"
[ngClass]="{'active': (currentPage$ | async) === route.path}"
[routerLink]="['../', 'edit', route.path]"
[routerLink]="['../', path, route.path]"
role="button"
[attr.aria-label]="route.label">
<translate-i18n [key]="route.label"></translate-i18n>
Expand Down
3 changes: 2 additions & 1 deletion ui/src/app/metadata/domain/component/editor-nav.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
import { Store } from '@ngrx/store';

import { Observable } from 'rxjs';
import { skipWhile, combineLatest, map } from 'rxjs/operators';
import { skipWhile, map } from 'rxjs/operators';

import { WizardStep } from '../../../wizard/model';
import * as fromWizard from '../../../wizard/reducer';
Expand All @@ -21,6 +21,7 @@ export enum NAV_FORMATS {
export class EditorNavComponent {
@Input() format: string;
@Input() status: string[] = [];
@Input() path: string = 'edit';

@Output() onPageSelect: EventEmitter<string> = new EventEmitter();

Expand Down
42 changes: 33 additions & 9 deletions ui/src/app/metadata/filter/action/collection.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,19 @@ export class LoadFilterError implements Action {
export class UpdateFilterRequest implements Action {
readonly type = FilterCollectionActionTypes.UPDATE_FILTER_REQUEST;

constructor(public payload: MetadataFilter) { }
constructor(public payload: {
filter: MetadataFilter,
providerId: string;
}) { }
}

export class UpdateFilterSuccess implements Action {
readonly type = FilterCollectionActionTypes.UPDATE_FILTER_SUCCESS;

constructor(public payload: Update<MetadataFilter>) { }
constructor(public payload: {
providerId: string,
update: Update<MetadataFilter>
}) { }
}

export class UpdateFilterFail implements Action {
Expand All @@ -97,19 +103,28 @@ export class UpdateFilterFail implements Action {
export class UpdateFilterConflict implements Action {
readonly type = FilterCollectionActionTypes.UPDATE_FILTER_CONFLICT;

constructor(public payload: MetadataFilter) { }
constructor(public payload: {
providerId: string,
filter: MetadataFilter
}) { }
}

export class AddFilterRequest implements Action {
readonly type = FilterCollectionActionTypes.ADD_FILTER_REQUEST;

constructor(public payload: MetadataFilter) { }
constructor(public payload: {
filter: MetadataFilter,
providerId: string
}) { }
}

export class AddFilterSuccess implements Action {
readonly type = FilterCollectionActionTypes.ADD_FILTER_SUCCESS;

constructor(public payload: MetadataFilter) { }
constructor(public payload: {
filter: MetadataFilter,
providerId: string
}) { }
}

export class AddFilterFail implements Action {
Expand Down Expand Up @@ -143,13 +158,16 @@ export class ClearFilters implements Action {
export class SetOrderFilterRequest implements Action {
readonly type = FilterCollectionActionTypes.SET_ORDER_FILTER_REQUEST;

constructor(public payload: string[]) { }
constructor(public payload: {
order: string[],
providerId: string
}) { }
}

export class SetOrderFilterSuccess implements Action {
readonly type = FilterCollectionActionTypes.SET_ORDER_FILTER_SUCCESS;

constructor() { }
constructor(public payload: string) { }
}

export class SetOrderFilterFail implements Action {
Expand Down Expand Up @@ -179,13 +197,19 @@ export class GetOrderFilterFail implements Action {
export class ChangeFilterOrderUp implements Action {
readonly type = FilterCollectionActionTypes.CHANGE_FILTER_ORDER_UP;

constructor(public payload: string) { }
constructor(public payload: {
id: string,
providerId: string
}) { }
}

export class ChangeFilterOrderDown implements Action {
readonly type = FilterCollectionActionTypes.CHANGE_FILTER_ORDER_DOWN;

constructor(public payload: string) { }
constructor(public payload: {
id: string,
providerId: string
}) { }
}

export type FilterCollectionActionsUnion =
Expand Down
20 changes: 20 additions & 0 deletions ui/src/app/metadata/filter/action/editor.action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Action } from '@ngrx/store';

export enum EditorActionTypes {
UPDATE_STATUS = '[Filter Editor] Update Status',
CLEAR = '[Filter Editor] Clear'
}

export class UpdateStatus implements Action {
readonly type = EditorActionTypes.UPDATE_STATUS;

constructor(public payload: { [key: string]: string }) { }
}

export class ClearEditor implements Action {
readonly type = EditorActionTypes.CLEAR;
}

export type EditorActionUnion =
| UpdateStatus
| ClearEditor;
2 changes: 1 addition & 1 deletion ui/src/app/metadata/filter/action/filter.action.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FilterActionTypes, CancelCreateFilter, SelectId } from './filter.action

describe('Filter Actions', () => {
it('should provide actions', () => {
expect(new CancelCreateFilter().type).toBe(FilterActionTypes.CANCEL_CREATE_FILTER);
expect(new CancelCreateFilter('id').type).toBe(FilterActionTypes.CANCEL_CREATE_FILTER);
expect(new SelectId('foo').type).toBe(FilterActionTypes.SELECT_ID);
});
});
13 changes: 11 additions & 2 deletions ui/src/app/metadata/filter/action/filter.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export enum FilterActionTypes {
CLEAR_FILTER = '[Filter] Clear Filter',
LOAD_ENTITY_PREVIEW = '[Filter] Load Preview data',
LOAD_ENTITY_PREVIEW_SUCCESS = '[Filter] Load Preview data success',
LOAD_ENTITY_PREVIEW_ERROR = '[Filter] Load Preview data error'
LOAD_ENTITY_PREVIEW_ERROR = '[Filter] Load Preview data error',

RESET_CHANGES = '[Filter] Reset Changes'
}

export class SelectId implements Action {
Expand All @@ -37,6 +39,8 @@ export class LoadEntityPreviewError implements Action {

export class CancelCreateFilter implements Action {
readonly type = FilterActionTypes.CANCEL_CREATE_FILTER;

constructor(public payload: string) { }
}

export class ClearFilter implements Action {
Expand All @@ -55,6 +59,10 @@ export class SelectFilterType implements Action {
constructor(public payload: string) { }
}

export class ResetChanges implements Action {
readonly type = FilterActionTypes.RESET_CHANGES;
}

export type FilterActionsUnion =
| SelectId
| SelectFilterType
Expand All @@ -63,4 +71,5 @@ export type FilterActionsUnion =
| LoadEntityPreview
| LoadEntityPreviewSuccess
| LoadEntityPreviewError
| ClearFilter;
| ClearFilter
| ResetChanges;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<ng-container *ngIf="definition$ | async">
<div class="alert alert-danger d-flex justify-content-between font-weight-bold mb-3" *ngIf="(step$ | async).locked">
<span class="d-flex justify-content-between">
<toggle-switch id="toggle" [formControl]="lock"></toggle-switch>
<span class="p-1">{{ lock.value ? 'Locked' : 'Unlocked' }}</span>
</span>
<span class="p-1">For Advanced Knowledge Only</span>
</div>
<sf-form
[schema]="schema$ | async"
[model]="model$ | async"
[validators]="validators$ | async"
[bindings]="bindings$ | async"
(onChange)="valueChangeSubject.next($event)"
(onErrorChange)="statusChangeSubject.next($event)"></sf-form>
</ng-container>
Loading

0 comments on commit e02aebe

Please sign in to comment.