Skip to content

Commit

Permalink
fix: [DHIS2-17352] Changing program in event workspace does nothing (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikhaugstulen authored Aug 13, 2024
1 parent 1b4be20 commit c3ce444
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const ProgramSelectorPlain = ({
const [programsArray, setProgramsArray] = useState<Array<Program>>([]);
const selectedProgram = selectedProgramId ? programCollection.get(selectedProgramId) : null;
const programOptions = getOptions(selectedOrgUnitId, programsArray);
const isMenuDisabled = !handleClickProgram;

useEffect(() => {
setProgramsArray(Array.from(programCollection.values()));
Expand Down Expand Up @@ -83,7 +84,8 @@ const ProgramSelectorPlain = ({
noValueMessage={i18n.t('Choose a program')}
value={selectedProgram && <OptionLabel icon={selectedProgram.icon} label={selectedProgram.name} />}
open={open}
setOpen={openSelectorBarItem => setOpen(openSelectorBarItem)}
setOpen={openSelectorBarItem => (isMenuDisabled ? null : setOpen(openSelectorBarItem))}
displayOnly={isMenuDisabled}
onClearSelectionClick={() => onResetProgramId(resetProgramIdBase())}
dataTest="program-selector-container"
>
Expand Down

0 comments on commit c3ce444

Please sign in to comment.