Skip to content

Commit

Permalink
Hide edit and create response actions on public builder questionnaires
Browse files Browse the repository at this point in the history
  • Loading branch information
olimsaidov committed Nov 11, 2024
1 parent 14aa959 commit e2a628d
Showing 1 changed file with 31 additions and 27 deletions.
58 changes: 31 additions & 27 deletions aidbox-forms-smart-launch/src/pages/questionnaires.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,14 @@ export const Questionnaires = () => {
<Eye />
Preview
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link to={`/questionnaires/${questionnaire.id}`}>
<Edit />
Edit
</Link>
</DropdownMenuItem>
{source !== "library" && (
<DropdownMenuItem asChild>
<Link to={`/questionnaires/${questionnaire.id}`}>
<Edit />
Edit
</Link>
</DropdownMenuItem>
)}
{source === "library" && (
<DropdownMenuItem
onClick={() => {
Expand All @@ -298,27 +300,29 @@ export const Questionnaires = () => {
Delete
</DropdownMenuItem>
)}
<DropdownMenuItem
onClick={() => {
createQuestionnaireMutation.mutate({
client,
questionnaire: {
...questionnaire,
// used to link questionnaire response
url:
source === "library"
? `${publicBuilderClient.state.serverUrl}/Questionnaire/${questionnaire.id}`
: undefined,
},
subject: patient,
encounter,
author: user,
});
}}
>
<Plus />
Create response
</DropdownMenuItem>
{source !== "library" && (
<DropdownMenuItem
onClick={() => {
createQuestionnaireMutation.mutate({
client,
questionnaire: {
...questionnaire,
// used to link questionnaire response
url:
source === "library"
? `${publicBuilderClient.state.serverUrl}/Questionnaire/${questionnaire.id}`
: undefined,
},
subject: patient,
encounter,
author: user,
});
}}
>
<Plus />
Create response
</DropdownMenuItem>
)}
</DropdownMenuContent>
</DropdownMenu>
);
Expand Down

0 comments on commit e2a628d

Please sign in to comment.