Skip to content

Commit

Permalink
Merge branch 'master' into feature/SHIBUI-1311-QA
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Smith committed Jul 30, 2019
2 parents 8c70051 + 1c8797b commit abec87b
Show file tree
Hide file tree
Showing 112 changed files with 1,849 additions and 481 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"properties": {
"entityAttributesFilterTargetType": {
"title": "",
"title": "label.filter-target-type",
"type": "string",
"default": "ENTITY",
"oneOf": [
Expand All @@ -71,6 +71,7 @@
]
},
"value": {
"title": "label.filter-target-value",
"type": "array",
"buttons": [
{
Expand Down
13 changes: 13 additions & 0 deletions backend/src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ action.copy=Copy
action.choose-file=Choose File
action.search-by=Search By
action.preview=Preview
action.preview-xml=Preview XML
action.select-metadata-filter-type=Select a metadata filter type
action.add-authentication-method=Add Authentication Method
action.move-up=Move Up
Expand All @@ -51,6 +52,9 @@ action.manage-filters=Manage Filters
action.version-history=Version History
action.options=Options
action.xml=XML
action.manage=Manage
action.close=Close
action.back-to-top=Back to Top

value.enabled=Enabled
value.disabled=Disabled
Expand Down Expand Up @@ -239,7 +243,11 @@ label.filter-name=Filter Name
label.filter-enabled=Filter Enabled
label.filter-target=FilterTarget
label.filter-type=Filter Type
label.filter-target-type=Filter Target Type
label.filter-target-value=Filter Target Value
label.target=Filter Target
label.option=Option
label.options=Options
label.value=Value
label.binding-type=Binding Type
label.sign-assertion=Sign Assertions
Expand All @@ -261,6 +269,8 @@ label.make-default=Make Default
label.metadata-provider-name-dashboard-display-only=Metadata Provider Name (Dashboard Display Only)
label.default-authentication-methods=Default Authentication Method(s)
label.new-of-type=New { type }
label.filters=Filters
label.attributes=Attributes

label.metadata-filter-name=Metadata Filter Name (Dashboard Display Only)
label.filter-enable=Enable this Filter?
Expand Down Expand Up @@ -458,6 +468,9 @@ message.required-for-regex=Required for Regex
message.file-doesnt-exist=The requested file to be processed does not exist on the server.
message.database-constraint=There was a database constraint problem processing the request. Check the request to ensure that fields that must be unique are truly unique.

message.no-filters=No Filters
message.no-filters-added=No filters have been added to this Metadata Provider

tooltip.entity-id=Entity ID
tooltip.service-provider-name=Service Provider Name (Dashboard Display Only)
tooltip.force-authn=Disallows use (or reuse) of authentication results and login flows that don\u0027t provide a real-time proof of user presence in the login process
Expand Down
63 changes: 21 additions & 42 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"file-saver": "^1.3.3",
"font-awesome": "^4.7.0",
"ngx-infinite-scroll": "^7.2.0",
"ngx-schema-form": "^2.2.0-beta.1",
"ngx-schema-form": "2.3.5",
"rxjs": "^6.5.1",
"rxjs-compat": "^6.5.1",
"xml-formatter": "^1.0.1",
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 @@ -15,7 +15,8 @@ const routes: Routes = [

@NgModule({
imports: [RouterModule.forRoot(routes, {
preloadingStrategy: PreloadAllModules
preloadingStrategy: PreloadAllModules,
scrollOffset: [0, 64]
})],
exports: [RouterModule]
})
Expand Down
35 changes: 35 additions & 0 deletions ui/src/app/core/reducer/configuration.reducer.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { reducer } from './configuration.reducer';
import * as fromConfiguration from './configuration.reducer';
import * as actions from '../action/configuration.action';

describe('Configuration Reducer', () => {
const initialState: fromConfiguration.ConfigState = {
roles: []
};

describe('undefined action', () => {
it('should return the default state', () => {
const result = reducer(undefined, {} as any);
expect(result).toEqual(initialState);
});
});

describe('Role Load Request', () => {
it('should set fetching to true', () => {
const action = new actions.LoadRoleSuccess(['ADMIN']);
const result = reducer(initialState, action);
expect(result).toEqual(
{
...initialState,
roles: ['ADMIN']
}
);
});
});

describe('selector functions', () => {
it('should return the roles from state', () => {
expect(fromConfiguration.getRoles(initialState)).toEqual([]);
});
});
});
18 changes: 17 additions & 1 deletion ui/src/app/core/reducer/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe('Core index reducers', () => {
version: fromVersion.initialState as fromVersion.VersionState,
config: fromConfig.initialState as fromConfig.ConfigState
};

describe('getUserStateFn function', () => {
it('should return the user state', () => {
expect(fromIndex.getUserStateFn(state)).toEqual(state.user);
Expand All @@ -21,4 +20,21 @@ describe('Core index reducers', () => {
expect(fromIndex.getVersionStateFn(state)).toEqual(state.version);
});
});
describe('getConfigStateFn function', () => {
it('should return the config state', () => {
expect(fromIndex.getConfigStateFn(state)).toEqual(state.config);
});
});
describe('filterRolesFn', () => {
it('should return the roles that are not `non roles`', () => {
expect(fromIndex.filterRolesFn(['ROLE_ADMIN', 'ROLE_NONE'])).toEqual(['ROLE_ADMIN']);
});
});
describe('isUserAdminFn', () => {
it('should check if the provided user has the ROLE_ADMIN role', () => {
expect(fromIndex.isUserAdminFn({role: 'ROLE_ADMIN'})).toBe(true);
expect(fromIndex.isUserAdminFn({role: 'ROLE_USER'})).toBe(false);
expect(fromIndex.isUserAdminFn(null)).toBe(false);
});
});
});
2 changes: 1 addition & 1 deletion ui/src/app/core/reducer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const getVersionLoading = createSelector(getVersionState, fromVersion.get
export const getVersionError = createSelector(getVersionState, fromVersion.getVersionError);

export const filterRolesFn = (roles: string[]) => roles.filter(r => r !== 'ROLE_NONE');
export const isUserAdminFn = (user) => user ? user.role === 'ROLE_ADMIN' : null;
export const isUserAdminFn = (user) => user ? user.role === 'ROLE_ADMIN' : false;

export const getConfigState = createSelector(getCoreFeature, getConfigStateFn);
export const getRoles = createSelector(getConfigState, fromConfig.getRoles);
Expand Down
Loading

0 comments on commit abec87b

Please sign in to comment.