Skip to content

Commit

Permalink
fix: fix organizations and federations link disabled(#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jandiasnow authored and Carrotzpc committed Feb 17, 2023
1 parent 0856f8e commit 9455b27
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
19 changes: 13 additions & 6 deletions src/pages/Federation/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
Input,
Card,
Table,
UnifiedLink,
Status,
Dropdown,
} from "@tenx-ui/materials";
Expand Down Expand Up @@ -946,13 +945,21 @@ class Federation$$Page extends React.Component {
key: "name",
render: (text, record, index) =>
((__$$context) => (
<UnifiedLink
__component_name="UnifiedLink"
target="_self"
to={__$$eval(() => "/federation/" + record.name)}
<Button
__component_name="Button"
block={false}
danger={false}
disabled={__$$eval(
() => record.status !== "FederationActivated"
)}
ghost={false}
href={__$$eval(() => "/federation/" + record.name)}
icon=""
shape="default"
type="link"
>
{__$$eval(() => record.name)}
</UnifiedLink>
</Button>
))(
__$$createChildContext(__$$context, {
text,
Expand Down
22 changes: 16 additions & 6 deletions src/pages/Organization/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
Input,
Card,
Table,
UnifiedLink,
Status,
Modal,
FormilyForm,
Expand Down Expand Up @@ -470,13 +469,24 @@ class Organization$$Page extends React.Component {
key: "name",
render: (text, record, index) =>
((__$$context) => (
<UnifiedLink
__component_name="UnifiedLink"
target="_self"
to={__$$eval(() => "/organization/" + record.name)}
<Button
__component_name="Button"
block={false}
danger={false}
disabled={__$$eval(() =>
record?.admin ===
__$$context.props.authData?.user?.name
? undefined
: "disabled"
)}
ghost={false}
href={__$$eval(() => "/organization/" + record.name)}
icon=""
shape="default"
type="link"
>
{__$$eval(() => record.name)}
</UnifiedLink>
</Button>
))(
__$$createChildContext(__$$context, {
text,
Expand Down

0 comments on commit 9455b27

Please sign in to comment.