Skip to content

Commit

Permalink
(refactor) Add form name instead of form uuild in launch form function (
Browse files Browse the repository at this point in the history
  • Loading branch information
CynthiaKamau authored Apr 15, 2024
1 parent a78e2d6 commit 2bc7fd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const EncounterList: React.FC<EncounterListProps> = ({
const { encounters, isLoading, onFormSave } = useEncounterRows(patientUuid, encounterType, filter);
const { moduleName, workspaceWindowSize, displayText, hideFormLauncher } = launchOptions;

const defaultActions = useMemo(
const defaultActions = useMemo(
() => [
{
label: t('viewEncounter', 'View'),
Expand All @@ -91,7 +91,7 @@ export const EncounterList: React.FC<EncounterListProps> = ({
if (!isLoadingFormsJson) {
const formsWithFilteredIntents = formsJson.map((form) => {
const descriptor = formList.find((formDescriptor) => formDescriptor.name === form.name);
// handle excluded intents
// handle excluded intents
if (descriptor?.excludedIntents?.length) {
form['availableIntents'] = form['availableIntents'].filter(
(intentEntry) => !descriptor.excludedIntents.includes(intentEntry.intent),
Expand Down Expand Up @@ -217,10 +217,10 @@ export const EncounterList: React.FC<EncounterListProps> = ({
}, [encounters, pageSize, constructPaginatedTableRows, currentPage]);

const formLauncher = useMemo(() => {
if (forms.length == 1 && !forms[0]['availableIntents']?.length) {
if (forms.length == 1 && !forms[0]['availableIntents']?.length) {
// we only have one form with no intents
// just return the "Add" button
return (
return (
<Button
kind="ghost"
renderIcon={Add}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function launchEncounterForm(
mutateform: mutateform,
formInfo: {
encounterUuid,
formUuid: form.uuid,
formUuid: form.name,
patientUuid: patientUuid,
visitTypeUuid: '',
visitUuid: '',
Expand Down

0 comments on commit 2bc7fd4

Please sign in to comment.