Skip to content

Commit

Permalink
Fixed status for enabled registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Dec 1, 2022
1 parent 893f006 commit 3aebda8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function DynamicRegistrationList ({entities, children, onChangeGroup, onD
</td>
<td className="text-center align-middle">
<span className="d-flex justify-content-center align-items-center">
{onEnable && canEnable(reg.approved) ?
{!reg.enabled &&onEnable && canEnable(reg.approved) ?
<Form.Check
type="switch"
id={`enable-switch-${idx}`}
Expand Down Expand Up @@ -117,7 +117,7 @@ export function DynamicRegistrationList ({entities, children, onChangeGroup, onD
<OverlayTrigger trigger={reg.enabled ? ['hover', 'focus'] : []} placement="left"
overlay={
<Popover id={`delete-source-btn-${idx}`}>
<Popover.Body>A metadata source must be disabled before it can be deleted.</Popover.Body>
<Popover.Body>An enabled registration cannot be deleted.</Popover.Body>
</Popover>
}>
<span className="d-inline-block">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export function DynamicRegistrationDetail () {
</GroupsProvider>
}
</h5>
{!detail.enabled &&
<div className="d-flex align-items-start btn-group">
{enable && (canEnable && detail?.approved) &&
<Button variant={detail.enabled ? 'outline-secondary' : 'outline-secondary' } size="sm" className=""
Expand All @@ -119,6 +120,7 @@ export function DynamicRegistrationDetail () {
</Button>
}
</div>
}
</div>

<p className="card-text">
Expand All @@ -134,7 +136,7 @@ export function DynamicRegistrationDetail () {
{(schema) =>
<Configuration entities={[detail]} schema={schema} definition={definition}>
{(config) =>
<MetadataConfiguration configuration={config} onEdit={() => edit()} />
<MetadataConfiguration configuration={config} onEdit={!detail.enabled ? () => edit() : null} />
}
</Configuration>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export const DynamicRegistrationApi = createApi({
query: () => ({
url: `/DynamicRegistrations`
}),
providesTags: ['DynamicRegistration']
providesTags: ['DynamicRegistration'],
}),
selectDynamicRegistration: builder.query({
query: ({id}) => ({
url: `/DynamicRegistration/${id}`
}),
providesTags: ['DynamicRegistration']
providesTags: ['DynamicRegistration'],
}),
getDisabledRegistrations: builder.query({
query: () => ({
Expand Down

0 comments on commit 3aebda8

Please sign in to comment.