Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement save form feature #4

Merged
merged 6 commits into from Aug 30, 2022
Merged

Conversation

kumuditha-udayanga
Copy link
Member

@kumuditha-udayanga kumuditha-udayanga commented Aug 16, 2022

Purpose

  • Implement form saving feature to esm-formbuilder
  • Update User Interface
  • This enables users to
    • Create, update or save a form as a new version.
    • Create, edit schemas and upload to a form.
    • Publish/ Unpublish forms.

Screenshots

Screenshot 2022-08-25 at 11 12 52 PM
Screenshot 2022-08-25 at 1 18 21 PM
Screenshot 2022-08-25 at 1 18 27 PM

Demo on creating new forms

https://vimeo.com/738267453

@jonathandick
Copy link
Member

@kumuditha-udayanga could you possibly update CI to deploy this to dev3?

@kumuditha-udayanga
Copy link
Member Author

@jonathandick, I updated the deployment process

@samuelmale
Copy link
Member

@kumuditha-udayanga thanks for raising the PR, but can you annotate this PR with relevant attachments to visualise your changes?

@kumuditha-udayanga
Copy link
Member Author

Hi @samuelmale thank you for reviewing, I updated the PR, attached few screenshots of the changes and a screen record link.

@samuelmale
Copy link
Member

@kumuditha-udayanga don't you think the form name can be inferred from the form json?

Screenshot 2022-08-26 at 09 07 15

Copy link
Member

@samuelmale samuelmale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, just a few minor comments

Comment on lines 54 to 67
const openModal = (option) => {
if (option === "newVersion") {
setSaveState("newVersion");
setOpenConfirmSaveModal(false);
setOpenSaveFormModal(true);
} else if (option === "new") {
setSaveState("newVersion");
setOpenSaveFormModal(true);
} else if (option === "update") {
setSaveState("update");
setOpenConfirmSaveModal(false);
setOpenSaveFormModal(true);
}
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would wrap this in a useCallback

@@ -0,0 +1,3 @@
import { createContext } from "react";

export const SchemaContext = createContext(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you define typings for the SchemaContext?

@samuelmale samuelmale merged commit e7ee787 into openmrs:main Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants