Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/SHIBUI-2115-cosmetic-errors
Browse files Browse the repository at this point in the history
Former-commit-id: a90c7e877845b5c25d21afec51cebc07844411e1
  • Loading branch information
rmathis committed Aug 4, 2022
2 parents 30fddd1 + 0649df2 commit d929fc3
Show file tree
Hide file tree
Showing 16 changed files with 223 additions and 128 deletions.
37 changes: 22 additions & 15 deletions backend/src/integration/resources/SHIBUI-1732-4.side
Original file line number Diff line number Diff line change
Expand Up @@ -992,28 +992,35 @@
["xpath=//div[3]/div/div/div[3]/button", "xpath:position"]
],
"value": ""
}, {
"id": "14c486b1-bdff-4474-94e3-b4286303a8fd",
"comment": "",
"command": "pause",
"target": "5000",
"targets": [],
"value": ""
}, {
"id": "e3892564-1a1b-4ee6-bbab-49d3cb3079d7",
"comment": "",
"command": "assertElementNotPresent",
"target": "css=table > tbody > tr",
"targets": [],
"value": ""
},{
"id": "4ec2c493-85e4-403b-9b09-031c5728f498",
"comment": "",
"command": "open",
"target": "/api/heheheheheheheWipeout",
"targets": [],
"value": ""
}, {
"id": "e074980a-8f21-4c22-8412-c4b6fcdcd1a4",
"comment": "",
"command": "assertText",
"target": "css=body",
"targets": [],
"value": "yes, you did it"
}]
}, {
"id": "4ec2c493-85e4-403b-9b09-031c5728f498",
"comment": "",
"command": "open",
"target": "/api/heheheheheheheWipeout",
"targets": [],
"value": ""
}, {
"id": "e074980a-8f21-4c22-8412-c4b6fcdcd1a4",
"comment": "",
"command": "assertText",
"target": "css=body",
"targets": [],
"value": "yes, you did it"
}]
}],
"suites": [{
"id": "575d414c-556d-45f7-b2f2-c9971ad51348",
Expand Down
9 changes: 9 additions & 0 deletions ui/src/app/core/components/Spinner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSpinner } from '@fortawesome/free-solid-svg-icons';

export function Spinner ({ size, className }) {
return (<FontAwesomeIcon icon={faSpinner} size={size} spin={true} pulse={true} className={ className } />)
}

export default Spinner;
11 changes: 8 additions & 3 deletions ui/src/app/dashboard/view/ActionsTab.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import { MetadataActions } from '../../admin/container/MetadataActions';
import UserActions from '../../admin/container/UserActions';
import Spinner from '../../core/components/Spinner';

import Translate from '../../i18n/components/translate';
import SourceList from '../../metadata/domain/source/component/SourceList';

export function ActionsTab({ sources, users, reloadSources, reloadUsers }) {
export function ActionsTab({ sources, users, reloadSources, reloadUsers, loadingSources, loadingUsers }) {

return (
<>
Expand All @@ -21,7 +22,9 @@ export function ActionsTab({ sources, users, reloadSources, reloadUsers }) {
<div className="p-3">
<MetadataActions type="source">
{(enable) =>
<SourceList entities={sources} onDelete={reloadSources} onEnable={(s, e) => enable(s, e, reloadSources)} />
<SourceList entities={sources} onDelete={reloadSources} onEnable={(s, e) => enable(s, e, reloadSources)}>
{loadingSources && <div className="d-flex justify-content-center text-primary"><Spinner size="4x" /></div> }
</SourceList>
}
</MetadataActions>
</div>
Expand All @@ -36,7 +39,9 @@ export function ActionsTab({ sources, users, reloadSources, reloadUsers }) {
</div>
</div>
</div>
<UserActions users={users} reloadUsers={reloadUsers} />
<UserActions users={users} reloadUsers={reloadUsers}>
{loadingUsers && <div className="d-flex justify-content-center text-primary"><Spinner size="4x" /></div> }
</UserActions>
</div>
</section>
</>
Expand Down
5 changes: 4 additions & 1 deletion ui/src/app/dashboard/view/AdminTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import UserMaintenance from '../../admin/component/UserMaintenance';
import API_BASE_PATH from '../../App.constant';

import Translate from '../../i18n/components/translate';
import Spinner from '../../core/components/Spinner';

export function AdminTab () {

const [users, setUsers] = React.useState([]);

const { get, response } = useFetch(`${API_BASE_PATH}/admin/users`, {
const { get, response, loading } = useFetch(`${API_BASE_PATH}/admin/users`, {
cachePolicy: 'no-cache'
}, []);

Expand Down Expand Up @@ -46,7 +47,9 @@ export function AdminTab () {
onChangeUserRole={onChangeUserRole}
onDeleteUser={onDeleteUser}
onChangeUserGroup={onChangeUserGroup} />}

</UserManagement>
{loading && <div className="d-flex justify-content-center text-primary"><Spinner size="4x" /></div> }
</div>
</div>
</section>
Expand Down
14 changes: 10 additions & 4 deletions ui/src/app/dashboard/view/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export function Dashboard () {

const isAdmin = useIsAdmin();

const loading = useCurrentUserLoading();
const loadingUser = useCurrentUserLoading();

const [actions, setActions] = React.useState(0);
const [users, setUsers] = React.useState([]);
const [sources, setSources] = React.useState([]);

const { get, response } = useFetch(`${API_BASE_PATH}`, {
const { get, response, loading } = useFetch(`${API_BASE_PATH}`, {
cachePolicy: 'no-cache'
});

Expand Down Expand Up @@ -64,7 +64,7 @@ export function Dashboard () {

return (
<div className="container-fluid p-3" role="navigation">
{loading ?
{loadingUser ?
<div className="d-flex justify-content-center text-primary mt-5">
<FontAwesomeIcon icon={faSpinner} spin={true} pulse={true} size="3x" />
</div>
Expand Down Expand Up @@ -109,7 +109,13 @@ export function Dashboard () {
} />
<Route path={`${path}/admin/actions`} render={() =>
<ProtectRoute redirectTo="/dashboard">
<ActionsTab sources={sources} users={users} reloadSources={loadSources} reloadUsers={loadUsers} />
<ActionsTab
sources={sources}
users={users}
reloadSources={loadSources}
reloadUsers={loadUsers}
loadingSources={sourceLoader.loading}
loadingUsers={loading} />
</ProtectRoute>
} />
<Route exact path={`${path}/*`}>
Expand Down
7 changes: 5 additions & 2 deletions ui/src/app/dashboard/view/ProvidersTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import { Ordered } from '../component/Ordered';
import { useIsAdmin } from '../../core/user/UserContext';
import Alert from 'react-bootstrap/Alert';
import { MetadataActions } from '../../admin/container/MetadataActions';
import Spinner from '../../core/components/Spinner';
const searchProps = ['name', '@type', 'createdBy'];

export function ProvidersTab () {

const [providers, setProviders] = React.useState([]);

const { get, response } = useMetadataEntities('provider', {
const { get, response, loading } = useMetadataEntities('provider', {
cachePolicy: 'no-cache'
});

Expand Down Expand Up @@ -54,7 +55,9 @@ export function ProvidersTab () {
last={last}
onEnable={(p, e) => enable(p, e, loadProviders)}
onOrderUp={onOrderUp}
onOrderDown={onOrderDown}></ProviderList>
onOrderDown={onOrderDown}>
{loading && <div className="d-flex justify-content-center text-primary"><Spinner size="4x" /></div> }
</ProviderList>
}
</MetadataActions>
}
Expand Down
8 changes: 6 additions & 2 deletions ui/src/app/dashboard/view/SourcesTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import Translate from '../../i18n/components/translate';
import SourceList from '../../metadata/domain/source/component/SourceList';
import { useMetadataEntities, useMetadataEntity } from '../../metadata/hooks/api';
import { Search } from '../component/Search';
import { Spinner } from '../../core/components/Spinner';

import { NotificationContext, createNotificationAction, NotificationTypes } from '../../notifications/hoc/Notifications';


const searchProps = ['serviceProviderName', 'entityId', 'createdBy'];

export function SourcesTab () {
Expand All @@ -16,7 +18,7 @@ export function SourcesTab () {

const [sources, setSources] = React.useState([]);

const { get, response } = useMetadataEntities('source', {
const { get, response, loading } = useMetadataEntities('source', {
cachePolicy: 'no-cache'
});

Expand Down Expand Up @@ -68,7 +70,9 @@ export function SourcesTab () {
entities={searched}
onDelete={(id) => remove(id, loadSources)}
onEnable={(s, e) => enable(s, e, loadSources) }
onChangeGroup={changeSourceGroup} />
onChangeGroup={changeSourceGroup}>
{loading && <div className="d-flex justify-content-center text-primary"><Spinner size="4x" /></div> }
</SourceList>
}
</MetadataActions>
}
Expand Down
17 changes: 5 additions & 12 deletions ui/src/app/metadata/copy/CopySource.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@ import { Translate } from '../../i18n/components/translate';
import { EntityTypeahead } from './EntityTypeahead';
import kebabCase from 'lodash/kebabCase';
import { useMetadataSources } from '../hooks/api';
import { useMetadataSourceSections } from '../domain/source/definition/SourceDefinition';


const sections = [
{ i18nKey: 'organizationInformation', property: 'organization' },
{ i18nKey: 'contacts', property: 'contacts' },
{ i18nKey: 'uiMduiInfo', property: 'mdui' },
{ i18nKey: 'spSsoDescriptorInfo', property: 'serviceProviderSsoDescriptor' },
{ i18nKey: 'logoutEndpoints', property: 'logoutEndpoints' },
{ i18nKey: 'securityDescriptorInfo', property: 'securityInfo' },
{ i18nKey: 'assertionConsumerServices', property: 'assertionConsumerServices' },
{ i18nKey: 'relyingPartyOverrides', property: 'relyingPartyOverrides' },
{ i18nKey: 'attributeRelease', property: 'attributeRelease' }
];

export function CopySource({ copy, onNext }) {

Expand Down Expand Up @@ -64,6 +55,8 @@ export function CopySource({ copy, onNext }) {

const sourceIds = data.map(p => p.entityId);

const sections = useMetadataSourceSections();

return (
<>
<div className="row">
Expand Down Expand Up @@ -162,7 +155,7 @@ export function CopySource({ copy, onNext }) {
<td><span className="mb-0" id={`property-checkbox-${i}`}><Translate value={`label.${kebabCase(item.i18nKey)}`} /></span></td>
<td>
<Form.Check
custom
custom={'true'}
type={'checkbox'}
id={`property-checkbox-${i}-check`}
onChange={({ target: { checked } }) => onSelect(item, checked)}
Expand Down
Loading

0 comments on commit d929fc3

Please sign in to comment.