-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
217 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| [ | ||
| { | ||
| "name": "Foobar", | ||
| "redirect_uris": [], | ||
| "response_types": [], | ||
| "grant_types": "", | ||
| "application_type": "", | ||
| "contacts": "", | ||
| "subject_type": "", | ||
| "jwks": "", | ||
| "jwks_uri": "", | ||
| "token_endpoint_auth_method": "", | ||
| "logo_uri": "", | ||
| "policy_uri": "", | ||
| "tos_uri": "", | ||
| "scope": "" | ||
| } | ||
| ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import React from 'react'; | ||
| // import { useDynamicRegistrationDispatcher } from '../../dynamic-registration/hoc/DynamicRegistrationContext'; | ||
| import Translate from '../../i18n/components/translate'; | ||
| import { Ordered } from '../component/Ordered'; | ||
| import { Search } from '../component/Search'; | ||
|
|
||
| import {DynamicRegistrationList} from '../../dynamic-registration/component/DynamicRegistrationList'; | ||
|
|
||
| const searchProps = ['name']; | ||
|
|
||
| export function DynamicRegistrationsTab () { | ||
|
|
||
| // const dispatcher = useDynamicRegistrationDispatcher(); | ||
|
|
||
| /*eslint-disable react-hooks/exhaustive-deps*/ | ||
| // React.useEffect(() => { loadRegistrations() }, []); | ||
| const registrations = []; | ||
|
|
||
| return ( | ||
| <section className="section"> | ||
| <div className="section-body border border-top-0 border-primary"> | ||
| <> | ||
| <div className="section-header bg-primary p-2 text-light"> | ||
| <span className="lead"> | ||
| <Translate value="label.current-dynamic-registrations">Dynamic Registrations</Translate> | ||
| </span> | ||
| </div> | ||
| <div className="p-3"> | ||
| <Ordered entities={registrations} prop="resourceIds"> | ||
| {(ordered, first, last, onOrderUp, onOrderDown) => | ||
| <Search entities={ordered} searchable={searchProps}> | ||
| {(searched) => | ||
| <DynamicRegistrationList entities={searched} /> | ||
| } | ||
| </Search> | ||
| } | ||
| </Ordered> | ||
| </div> | ||
| </> | ||
| </div> | ||
| </section> | ||
| ) | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import React from 'react'; | ||
| import { useDynamicRegistrationDispatcher } from './hoc/DynamicRegistrationContext'; | ||
| import Translate from '../i18n/components/translate'; | ||
| import { Search } from '../dashboard/component/Search'; | ||
|
|
||
| import {DynamicRegistrationList} from './component/DynamicRegistrationList'; | ||
|
|
||
| const searchProps = ['name']; | ||
|
|
||
| export function DynamicRegistration () { | ||
|
|
||
| // const dispatcher = useDynamicRegistrationDispatcher(); | ||
|
|
||
| /*eslint-disable react-hooks/exhaustive-deps*/ | ||
| // React.useEffect(() => { loadRegistrations() }, []); | ||
| const registrations = []; | ||
|
|
||
| return ( | ||
| <section className="section"> | ||
| <div className="section-body border border-top-0 border-primary"> | ||
| <> | ||
| <div className="section-header bg-primary p-2 text-light"> | ||
| <span className="lead"> | ||
| <Translate value="label.current-dynamic-registrations">Dynamic Registrations</Translate> | ||
| </span> | ||
| </div> | ||
| <div className="p-3"> | ||
| <Search entities={registrations} searchable={searchProps}> | ||
| {(searched) => | ||
| <DynamicRegistrationList entities={searched} /> | ||
| } | ||
| </Search> | ||
| </div> | ||
| </> | ||
| </div> | ||
| </section> | ||
| ) | ||
| } |
5 changes: 5 additions & 0 deletions
5
ui/src/app/dynamic-registration/component/DynamicRegistrationList.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import React from 'react'; | ||
|
|
||
| export function DynamicRegistrationList ({entities}) { | ||
| return <><pre>{JSON.stringify(entities, null, 4)}</pre></> | ||
| } |
91 changes: 91 additions & 0 deletions
91
ui/src/app/dynamic-registration/hoc/DynamicRegistrationContext.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| import React from 'react'; | ||
|
|
||
|
|
||
| const initialState = { | ||
| registrations: [], | ||
| selected: null, | ||
| }; | ||
|
|
||
| const DynamicRegistrationContext = React.createContext(); | ||
|
|
||
| const { Provider, Consumer } = DynamicRegistrationContext; | ||
|
|
||
| export const DynamicRegistrationActions = { | ||
| LOAD_REGISTRATIONS: 'load dynamic registrations (list GET)', | ||
| SELECT_REGISTRATION: 'load dynamic registration (single GET)', | ||
| CREATE_REGISTRATION: 'create dynamic registration (POST)', | ||
| UPDATE_REGISTRATION: 'update dynamic registration (PUT)', | ||
| DELETE_REGISTRATION: 'delete dynamic registration (DELETE)' | ||
| }; | ||
|
|
||
| export const loadRegistrations = (payload) => { | ||
| return { | ||
| type: DynamicRegistrationActions.LOAD_REGISTRATIONS, | ||
| payload | ||
| } | ||
| } | ||
|
|
||
| export const selectRegistration = (payload) => { | ||
| return { | ||
| type: DynamicRegistrationActions.SELECT_REGISTRATION, | ||
| payload | ||
| } | ||
| } | ||
|
|
||
| export const createRegistration = (payload) => { | ||
| return { | ||
| type: DynamicRegistrationActions.CREATE_REGISTRATION, | ||
| payload | ||
| } | ||
| } | ||
|
|
||
| export const updateRegistration = (payload) => { | ||
| return { | ||
| type: DynamicRegistrationActions.UPDATE_REGISTRATION, | ||
| payload | ||
| } | ||
| } | ||
|
|
||
| export const deleteRegistration = (payload) => { | ||
| return { | ||
| type: DynamicRegistrationActions.DELETE_REGISTRATION, | ||
| payload | ||
| } | ||
| } | ||
|
|
||
| function reducer(state, action) { | ||
| switch (action.type) { | ||
| default: | ||
| return state; | ||
| } | ||
| } | ||
|
|
||
| /*eslint-disable react-hooks/exhaustive-deps*/ | ||
| function DynamicRegistrationsApi({ children, initial = {} }) { | ||
|
|
||
| const [contextValue, setContextValue] = React.useState({...initialState}); | ||
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <Provider value={contextValue}>{children}</Provider> | ||
| </React.Fragment> | ||
| ); | ||
| } | ||
|
|
||
|
|
||
| function useDynamicRegistrationContext () { | ||
| return React.useContext(DynamicRegistrationContext); | ||
| } | ||
|
|
||
| function useDynamicRegistrationDispatcher () { | ||
| const { dispatch } = useDynamicRegistrationContext(); | ||
| return dispatch; | ||
| } | ||
|
|
||
| export { | ||
| DynamicRegistrationsApi, | ||
| useDynamicRegistrationContext, | ||
| useDynamicRegistrationDispatcher, | ||
| Provider as MetadataFormProvider, | ||
| Consumer as MetadataFormConsumer | ||
| }; |