Added detail modal
This commit is contained in:
parent
bf7f8ebbf7
commit
0a848d9458
|
|
@ -67,6 +67,7 @@ export default function RequestModal(props: ModalProps) {
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (props.type) {
|
switch (props.type) {
|
||||||
|
case "detail":
|
||||||
case "input link": {
|
case "input link": {
|
||||||
if (!props.detailId || !props.opened) return;
|
if (!props.detailId || !props.opened) return;
|
||||||
setFormState("fetching");
|
setFormState("fetching");
|
||||||
|
|
@ -101,6 +102,7 @@ export default function RequestModal(props: ModalProps) {
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setFormState("idle");
|
setFormState("idle");
|
||||||
});
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [props]);
|
}, [props]);
|
||||||
|
|
@ -196,8 +198,10 @@ export default function RequestModal(props: ModalProps) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const disableChange = formState !== "idle";
|
const disableChange = formState !== "idle";
|
||||||
const readonly = props.type === "input link";
|
const readonly = ["input link", "detail"].includes(props.type)
|
||||||
const showSkeleton = formState === "fetching";
|
const showSkeleton = formState === "fetching";
|
||||||
|
const showActivationLink = ["input link", "detail"].includes(props.type)
|
||||||
|
const enableInputActivationLink = props.type === "input link"
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
|
|
@ -286,13 +290,14 @@ export default function RequestModal(props: ModalProps) {
|
||||||
/>
|
/>
|
||||||
</Skeleton>
|
</Skeleton>
|
||||||
</Flex>
|
</Flex>
|
||||||
{["input link", "detail"].includes(
|
{showActivationLink && (
|
||||||
props.type
|
|
||||||
) && (
|
|
||||||
<Skeleton visible={showSkeleton}>
|
<Skeleton visible={showSkeleton}>
|
||||||
<TextInput
|
<TextInput
|
||||||
label="Activation Link"
|
label="Activation Link"
|
||||||
required
|
required
|
||||||
|
disabled={disableChange}
|
||||||
|
readOnly={!enableInputActivationLink}
|
||||||
|
placeholder={enableInputActivationLink ? "Enter link here" : "No link provided"}
|
||||||
/>
|
/>
|
||||||
</Skeleton>
|
</Skeleton>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ export default function RequestTable(props: Props) {
|
||||||
permissions: props.permissions,
|
permissions: props.permissions,
|
||||||
actions: {
|
actions: {
|
||||||
detail: (id) => {
|
detail: (id) => {
|
||||||
console.log(id);
|
openDetailModal(id);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
@ -49,6 +49,15 @@ export default function RequestTable(props: Props) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const openDetailModal = (id: string) => {
|
||||||
|
setModalProps({
|
||||||
|
opened: true,
|
||||||
|
title: "Office 365 Link Request Detail",
|
||||||
|
detailId: id,
|
||||||
|
type: "detail",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
setModalProps(defaultModalProps);
|
setModalProps(defaultModalProps);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user