mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 23:35:45 +00:00
feat(FE-170,175): add module_id prop to approval history modal in RecordingTable
This commit is contained in:
@@ -136,20 +136,28 @@ const ApprovalHistoryModal = ({
|
|||||||
ref,
|
ref,
|
||||||
currentApproval,
|
currentApproval,
|
||||||
module_name = 'RECORDINGS',
|
module_name = 'RECORDINGS',
|
||||||
|
module_id,
|
||||||
}: {
|
}: {
|
||||||
ref: RefObject<HTMLDialogElement | null>;
|
ref: RefObject<HTMLDialogElement | null>;
|
||||||
currentApproval?: BaseApproval;
|
currentApproval?: BaseApproval;
|
||||||
module_name?: string;
|
module_name?: string;
|
||||||
|
module_id?: number | undefined;
|
||||||
}) => {
|
}) => {
|
||||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||||
|
|
||||||
const approvalHistoryUrl = useMemo(() => {
|
const approvalHistoryUrl = useMemo(() => {
|
||||||
if (!isModalOpen) return null;
|
if (!isModalOpen) return null;
|
||||||
return `${ApprovalApi.basePath}?${new URLSearchParams({
|
const params = new URLSearchParams({
|
||||||
module_name: module_name,
|
module_name: module_name,
|
||||||
group_step_number: 'true',
|
group_step_number: 'true',
|
||||||
}).toString()}`;
|
});
|
||||||
}, [module_name, isModalOpen]);
|
|
||||||
|
if (module_id) {
|
||||||
|
params.append('module_id', module_id.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${ApprovalApi.basePath}?${params.toString()}`;
|
||||||
|
}, [module_name, module_id, isModalOpen]);
|
||||||
|
|
||||||
type GroupedApprovalResponse = {
|
type GroupedApprovalResponse = {
|
||||||
step_number: number;
|
step_number: number;
|
||||||
@@ -993,6 +1001,7 @@ const RecordingTable = () => {
|
|||||||
ref={approvalHistoryModal.ref}
|
ref={approvalHistoryModal.ref}
|
||||||
currentApproval={selectedRecording?.approval}
|
currentApproval={selectedRecording?.approval}
|
||||||
module_name={'RECORDINGS'}
|
module_name={'RECORDINGS'}
|
||||||
|
module_id={selectedRecording?.id}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user