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

Saving planning items #2179

Open
wants to merge 14 commits into
base: feature/embedded-events-editor
Choose a base branch
from

Conversation

thecalcc
Copy link
Contributor

STT-31

Front-end checklist

  • This pull request is adding missing TypeScript types to modified code segments where it's easy to do so with confidence
  • This pull request is using TypeScript interfaces instead of prop-types and updates usages where it's quick to do so
  • This pull request is using memo or PureComponent to define new React components (and updates existing usages in modified code segments)
  • This pull request is replacing lodash.get with optional chaining and nullish coalescing for modified code segments
  • This pull request is not importing anything from client-core directly (use superdeskApi)
  • This pull request is importing UI components from superdesk-ui-framework and superdeskApi when possible instead of using ones defined in this repository.
  • This pull request is not using planningApi where it is possible to use superdeskApi
  • This pull request is not adding redux based modals
  • In this pull request, properties of redux state are not being passed as props to components; instead, we connect it to the component that needs them. Except components where using a react key is required - do not connect those due to performance reasons.
  • This pull request is not adding redux actions that do not modify state (e.g. only calling angular services; those should be moved to planningApi)

@thecalcc thecalcc requested a review from tomaskikutis January 15, 2025 10:14
Comment on lines 662 to 663
handleUnsavedChanges(this.props.editorType) :
handleUnsavedChanges(this.props.editorType).then((x) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to do this because of types, otherwise TS doesn't infer the right types

@thecalcc
Copy link
Contributor Author

@tomaskikutis let me know if you think it's better to create a wrapper around itemManager and do handleUnsavedChanges there instead of tying that to the itemManager's implementation of post,save, etc.

@thecalcc
Copy link
Contributor Author

thecalcc commented Jan 15, 2025

  • expose validation errors from exposed
  • save event -> save gets called on all embedded items also
    • validation errors -> first field of 1st embedded item with issues has to be scrolled to (and focused)
    • open toggle box if closed
    • user fixes this error -> repeats the flow
  • closing event -> handleUnsavedChanges for embedded items
    • user can discard everything (from main and embedded items both)

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.

1 participant