Skip to content

Conversation

@LenaelleL
Copy link
Contributor

@LenaelleL LenaelleL commented Oct 31, 2023

Description

Adds a new feature that allows the user to save draft records and select them to fill a form again.
User story 74319
Ticket 77590
Not a 100% sure I added JSCode everywhere...Sorry

Useful links

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (refactor or addition to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Tested in back-office with different forms

Screenshots

image

image
image
image

Checklist:

( * == Mandatory )

  • * I have set myself as assignee of the pull request
  • * My code follows the style guidelines of this project
  • * Linting does not generate new warnings
  • * I have performed a self-review of my own code
  • * I have put the ticket for review, adding the oort-frontend team to the list of reviewers
  • * I have commented my code, particularly in hard-to-understand areas
  • * I have put JSDoc comment in all required places
  • * My changes generate no new warnings
  • * I have included screenshots describing my changes if relevant
  • * I have selected labels in the Pull Request, according to the changes with code brings
  • I have made corresponding changes to the documentation ( if required )
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@LenaelleL LenaelleL added the enhancement New feature or request label Oct 31, 2023
@LenaelleL LenaelleL requested a review from a team October 31, 2023 16:40
@LenaelleL LenaelleL self-assigned this Oct 31, 2023
@estelafs estelafs requested review from estelafs and removed request for a team October 31, 2023 17:09
… enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Copy link
Contributor

@estelafs estelafs left a comment

Choose a reason for hiding this comment

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

Everything working as expected, i just did some small improvements:
Added missing JSDocs and translations, removed console logs and unused imports, added data checks and added the empty template when table don't have drafts to display

Also, @AntoineRelief , the draft feature should be available in the here in the shared-form-modal when adding or updating a record from a grid?

Screenshot from 2023-10-31 17-05-19

… enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
Copy link
Collaborator

@AntoineRelief AntoineRelief left a comment

Choose a reason for hiding this comment

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

a few things that don't work as expected:

  • in the draft record modal ( when previewing ) we don't see the pages
  • I didn't check all in details, but I think some methods that were used to remove temporary records after saving ( for resource / resources questions ) were disabled -> to double check
  • the possibility to see draft should also be visible in the modal when adding new records ( from a grid, for example ). It may need to refactor the code, so the button to open the draft is a component ( instead of being a button in the form.component as it is now ).
  • when the draft is saved ( not as a draft, but as a record ), the draft is not removed. It should be

@AntoineRelief AntoineRelief marked this pull request as draft November 6, 2023 12:32
@estelafs
Copy link
Contributor

estelafs commented Nov 6, 2023

Done:

  • Added the page tabs and navigations to the draft record modal (when previewing)
  • Created the shared DraftRecordComponent to add the draft button also in the form and record modal (using the form-builder and the form-helper services for the common methods)
  • Now when a draft is loaded and saved as a new record, the draft used is deleted
  • I started updating the ResourceModalComponent and the survey utils.ts file to always create draft files instead of temporary (not finished)

@estelafs
Copy link
Contributor

estelafs commented Nov 7, 2023

Done: updated ResourceModalComponent and the survey utils.ts file to always create draft files instead of temporary records with the local storage

@estelafs estelafs requested a review from a team November 7, 2023 21:09
@estelafs estelafs marked this pull request as ready for review November 7, 2023 21:09
… enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
@AntoineRelief AntoineRelief merged commit 2aeeca1 into beta Nov 9, 2023
@AntoineRelief AntoineRelief deleted the feat/AB#74319-save-records-as-draft branch November 9, 2023 10:32
@AntoineRelief
Copy link
Collaborator

@LenaelleRelief @estelafs
really good combined work 👏👏👏
that's a great new feature

AntoineRelief pushed a commit that referenced this pull request Nov 9, 2023
…tions/oort-frontend@v2.2.0-beta.7...v2.2.0-beta.8) (2023-11-09) ### Bug Fixes CHANGELOG CHANGELOG.md CI LICENSE README.md TODO.md apps assets error_pages jest-shim.ts jest.config.ts jest.preset.js libs makefile migration-storybook.log node_modules nx.json package-lock.json package.json release.config.js tailwind.config.js tools tsconfig.base.json widgets auto sizing grid columns would create tiny columns when too many columns ([#2057](https://github.com/ReliefApplications/oort-frontend/issues/2057)) ([6afea60](ReliefApplications/oort-frontend@6afea60)) CHANGELOG CHANGELOG.md CI LICENSE README.md TODO.md apps assets error_pages jest-shim.ts jest.config.ts jest.preset.js libs makefile migration-storybook.log node_modules nx.json package-lock.json package.json release.config.js tailwind.config.js tools tsconfig.base.json widgets navigate to page action in grid / summary card would limit to only id field ([#2029](https://github.com/ReliefApplications/oort-frontend/issues/2029)) ([12eb046](ReliefApplications/oort-frontend@12eb046)) CHANGELOG CHANGELOG.md CI LICENSE README.md TODO.md apps assets error_pages jest-shim.ts jest.config.ts jest.preset.js libs makefile migration-storybook.log node_modules nx.json package-lock.json package.json release.config.js tailwind.config.js tools tsconfig.base.json widgets readonly would not be correctly considered in resources question ([#2054](https://github.com/ReliefApplications/oort-frontend/issues/2054)) ([498bb96](ReliefApplications/oort-frontend@498bb96)) CHANGELOG CHANGELOG.md CI LICENSE README.md TODO.md apps assets error_pages jest-shim.ts jest.config.ts jest.preset.js libs makefile migration-storybook.log node_modules nx.json package-lock.json package.json release.config.js tailwind.config.js tools tsconfig.base.json widgets some widgets in tab widget could not be resized ([1413948](ReliefApplications/oort-frontend@1413948)) ### Features CHANGELOG CHANGELOG.md CI LICENSE README.md TODO.md apps assets error_pages jest-shim.ts jest.config.ts jest.preset.js libs makefile migration-storybook.log node_modules nx.json package-lock.json package.json release.config.js tailwind.config.js tools tsconfig.base.json widgets Ability to save draft record ([#2030](https://github.com/ReliefApplications/oort-frontend/issues/2030)) ([2aeeca1](ReliefApplications/oort-frontend@2aeeca1)) CHANGELOG CHANGELOG.md CI LICENSE README.md TODO.md apps assets error_pages jest-shim.ts jest.config.ts jest.preset.js libs makefile migration-storybook.log node_modules nx.json package-lock.json package.json release.config.js tailwind.config.js tools tsconfig.base.json widgets implement filter icon ([356c39a](ReliefApplications/oort-frontend@356c39a)) CHANGELOG CHANGELOG.md CI LICENSE README.md TODO.md apps assets error_pages jest-shim.ts jest.config.ts jest.preset.js libs makefile migration-storybook.log node_modules nx.json package-lock.json package.json release.config.js tailwind.config.js tools tsconfig.base.json widgets implement filter icon & dashboard filter modern variant ([ed63923](ReliefApplications/oort-frontend@ed63923))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants