feat(cluster-link) add cluster link crud#1563
Conversation
50712c4 to
b9845a7
Compare
b9845a7 to
48bc3db
Compare
48bc3db to
63826b0
Compare
f9bdb33 to
2758626
Compare
edb906a to
e843425
Compare
bbeb79e to
aa55af5
Compare
39994ff to
39c88bd
Compare
14e219d to
34c2f9a
Compare
34c2f9a to
1acd87c
Compare
Signed-off-by: David Edler <david.edler@canonical.com>
1acd87c to
ef9c5c2
Compare
| import { ROOT_PATH } from "util/rootPath"; | ||
| import { addEntitlements } from "util/entitlements/api"; | ||
|
|
||
| const clusterLinkEntitlements = ["can_edit", "can_delete"]; |
There was a problem hiding this comment.
| const clusterLinkEntitlements = ["can_edit", "can_delete"]; | |
| const CLUSTER_LINK_ENTITLEMENTS = ["can_edit", "can_delete"]; |
If this constant is just for this file, then the cluster link prefix might not be needed but I don't have a strong opinion on this. However, let's use all capital for constants.
| title={disableReason} | ||
| disabled={disableReason !== undefined} | ||
| > | ||
| <Icon name="plus" light /> |
There was a problem hiding this comment.
Sometimes we the + icon with light, sometimes without. Any reason for that ?
| appearance={"base"} | ||
| className={"u-no-margin--bottom"} |
There was a problem hiding this comment.
| appearance={"base"} | |
| className={"u-no-margin--bottom"} | |
| appearance="base" | |
| className="u-no-margin--bottom" |
No need for curl brackets around constants
| ); | ||
| }) | ||
| .catch((e) => { | ||
| setLoading(false); |
There was a problem hiding this comment.
I know that most our components are built this way, but should setLoading(false); be in finally ?
|
|
||
| const EditClusterLinkBtn: FC<Props> = ({ clusterLink }) => { | ||
| const { canEditClusterLink } = useClusterLinkEntitlements(); | ||
| const panel = usePanelParams(); |
There was a problem hiding this comment.
| const panel = usePanelParams(); | |
| const panelParams = usePanelParams(); |
In the rest of the codebase, we call it panelParams
| const [howToUseActiveTab, setHowToUseActiveTab] = useState("ui-tab"); | ||
|
|
||
| return ( | ||
| <Modal |
There was a problem hiding this comment.
Do you want to match exactly the beautiful CreateIdentityModal ? If so, here are the differences:
- tooltipMessage="Copy token"
- name of the cluster link in the title
- onClose not called in Modal's
close(but I'm not sure what are the consequences)
Done
Still draft as the backend api is pending from canonical/lxd#17554