Skip to content

feat: move activity types new and edit to mui - #977

Merged
smarcet merged 2 commits into
feature/move-activity-types-grid-muifrom
feature/move-edit-new-activity-types-mui
Jun 30, 2026
Merged

feat: move activity types new and edit to mui#977
smarcet merged 2 commits into
feature/move-activity-types-grid-muifrom
feature/move-edit-new-activity-types-mui

Conversation

@priscila-moneo

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 942af5da-4204-4100-a37e-f791b82720c8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/move-edit-new-activity-types-mui

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@santipalenque santipalenque left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@priscila-moneo looks good ! just one thing

linkToPresentationType,
unlinkFromPresentationType
}) => {
const [isSaving, setIsSaving] = useState(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

please use baseState loading prop . it is set at the beginning of each action call: example

@santipalenque santipalenque left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

linkToPresentationType,
unlinkFromPresentationType
}) => {
const isSaving = Boolean(loading);

@smarcet smarcet Jun 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

isSaving is derived from the global baseState.loading counter instead of local state. This means any concurrent request (autocomplete, list reload, etc.) incorrectly disables the form while the user is filling it in.

The canonical pattern for popups in this project (see summit-admin-popup-dialog-pattern.md and the media-file-type-dialog.js reference) requires:

  • const [isSaving, setIsSaving] = useState(false) in the popup
  • setIsSaving(true) before calling save
  • .finally(() => setIsSaving(false)) to reset

Related: saveEventType is connected directly via Redux-connect in this dialog (mapDispatchToProps line 132), which is also an anti-pattern per the project rules — the save action belongs in the parent's handleSave, passed down as a single onSave prop.
see https://app.clickup.com/t/9014802374/86bag2zk7

Comment thread src/actions/event-type-actions.js Outdated
dispatch(
showSuccessMessage(T.translate("edit_event_type.event_type_saved"))
);
return dispatch(getEventTypes());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The list reload (dispatch(getEventTypes())) belongs in the parent's handleSave, not inside the action. As-is, saveEventType is coupled to the list page: it can't be reused in any other context without triggering a full list refresh.

The canonical shape (from the media-file-type-list-page.js reference and ticket 86bag2zk7) is:

// parent
const handleSave = (entity) =>
  saveEventType(entity)
    .then(() => getEventTypes(term, DEFAULT_CURRENT_PAGE, perPage, order, orderDir));

Same issue applies to the POST path on line 155.

@smarcet smarcet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@priscila-moneo please review

@priscila-moneo
priscila-moneo force-pushed the feature/move-activity-types-grid-mui branch from 77cea30 to 6872754 Compare June 24, 2026 21:57
Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>
@priscila-moneo
priscila-moneo force-pushed the feature/move-edit-new-activity-types-mui branch from 82c99d3 to bb7892e Compare June 24, 2026 22:02
Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>
@priscila-moneo
priscila-moneo requested a review from smarcet June 24, 2026 22:07

@smarcet smarcet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@smarcet
smarcet merged commit 09d60d6 into feature/move-activity-types-grid-mui Jun 30, 2026
9 checks passed
smarcet pushed a commit that referenced this pull request Jul 2, 2026
* feat: move activity types new and edit to mui

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

* fix: feedback from PR

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

---------

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>
smarcet added a commit that referenced this pull request Jul 3, 2026
* feat: move activity type list to mui

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

* fix: feedback from PR

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

* feat: move activity types new and edit to mui (#977)

* feat: move activity types new and edit to mui

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

* fix: feedback from PR

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

---------

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

* feat: migrate EventTypeForm to Formik + MUI dialog

Replaces the legacy Bootstrap class-component EventTypeForm (embedded
in the MUI dialog shipped in PR #969 with no DialogActions footer)
with a single pure Formik + MUI EventTypeDialog, following
company-dialog.js (PR #910) as the primary pattern and the tabbed
layout from selection-plan-form.js (PR #917).

- Main / Schedule settings tabs; MuiFormikTextField/Select/Checkbox/
  AsyncAutocomplete; MuiColorInput with ref-based color tracking to
  avoid re-rendering the whole form on every drag
- Media upload types linked-list rebuilt with Autocomplete + MuiTable,
  matching the track-groups-tab.js / company-dialog.js sponsorship
  table pattern, with dedup against already-linked types
- EventTypeDialog is now a pure component; Redux wiring moved up into
  event-type-list-page.js, whose mapStateToProps now exposes
  currentEventType/currentEventTypeErrors matching every other
  list+dialog page's naming convention
- Yup validation (positiveNumberValidation from utils/yup.js) for the
  numeric fields, with a NaN-safe fallback in handleSubmit since
  Formik does not auto-cast values on submit
- Fixed a real renderValue bug in the shared MuiFormikSelect wrapper
  (echoed the raw value instead of resolving the MenuItem label,
  invisible elsewhere because other consumers' labels matched their
  values) - benefits 8 other call sites
- Fixed a stale-errors-across-entities bug in event-type-reducer.js
  (RECEIVE_EVENT_TYPE didn't reset errors, unlike UPDATE_EVENT_TYPE)

87 test suites / 733 tests passing, 0 lint errors on touched files.
Live-verified against a real summit without modifying its data.

ref: https://app.clickup.com/t/86bac70mf

* fix: unify color picker field between event-type and company dialogs

Both dialogs duplicated a ColorPickerField that tracked the picked
color in a useRef, splicing it into the payload only at submit time.
This was a workaround for mui-color-input firing onChange on every
pointermove while dragging, but it meant the color never participated
in Formik state: no yup validation, stale server-side errors that
never cleared on a corrective edit, and no name/id for the label or
useScrollToError to target.

Extract a shared MuiFormikColorField (src/components/mui/formik-inputs)
that keeps local state for instant drag/typing feedback but commits to
Formik (value + touched + validation) only on blur, avoiding a
full-dialog re-render storm while still getting real validation and
error-clearing. Add hexColorValidation() to src/utils/yup.js and wire
it into both dialogs' schemas.

Also fixes an unrelated pre-existing bug found while running the
suite: MuiFormikAsyncAutocomplete referenced an undeclared
defaultOptions variable, crashing every page that uses it.

* refactor: migrate company/event-type actions off base-actions snackbar wrapper

company-actions.js and event-type-actions.js now import snackbarErrorHandler
and snackbarSuccessHandler directly from openstack-uicore-foundation instead
of the local src/actions/base-actions.js wrapper, which is being phased out
in favor of uicore-foundation as the single source of truth. Other action
files still using the base-actions wrapper will be migrated incrementally
(tracked in docs/plans/clickup-migrate-snackbar-handlers-to-uicore.md).

event-type-actions.js also switches getEventTypes/getEventType/saveEventType/
deleteEventType/seedEventTypes from authErrorHandler (blocking alert) to
snackbarErrorHandler, adds a success snackbar for seedEventTypes, and adds
the event_types_seed i18n key.

Also removes a leftover dispatch(showMessage(success_message, ...)) call in
saveEventType's create branch left over from this migration - its backing
success_message const had been deleted, so it would have thrown
ReferenceError: success_message is not defined on every new event type
creation. The snackbarSuccessHandler dispatch right below it already covers
the success message.

* fix: commit color field pending value on Enter to avoid stale submit

* test: add event type list page coverage for search, pagination and crud flows

* fix: reset to first page when sorting event type list

* fix: refresh paginated event type list after seeding defaults

* fix: close event type dialog on save success regardless of list refresh outcome

* fix: sync color field display when formik value changes externally

* fix: show global spinner during event type delete and seed operations

---------

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>
Co-authored-by: smarcet <smarcet@gmail.com>
smarcet added a commit that referenced this pull request Jul 16, 2026
* feat: move activity type list to mui

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

* fix: feedback from PR

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

* feat: move activity types new and edit to mui (#977)

* feat: move activity types new and edit to mui

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

* fix: feedback from PR

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

---------

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>

* feat: migrate EventTypeForm to Formik + MUI dialog

Replaces the legacy Bootstrap class-component EventTypeForm (embedded
in the MUI dialog shipped in PR #969 with no DialogActions footer)
with a single pure Formik + MUI EventTypeDialog, following
company-dialog.js (PR #910) as the primary pattern and the tabbed
layout from selection-plan-form.js (PR #917).

- Main / Schedule settings tabs; MuiFormikTextField/Select/Checkbox/
  AsyncAutocomplete; MuiColorInput with ref-based color tracking to
  avoid re-rendering the whole form on every drag
- Media upload types linked-list rebuilt with Autocomplete + MuiTable,
  matching the track-groups-tab.js / company-dialog.js sponsorship
  table pattern, with dedup against already-linked types
- EventTypeDialog is now a pure component; Redux wiring moved up into
  event-type-list-page.js, whose mapStateToProps now exposes
  currentEventType/currentEventTypeErrors matching every other
  list+dialog page's naming convention
- Yup validation (positiveNumberValidation from utils/yup.js) for the
  numeric fields, with a NaN-safe fallback in handleSubmit since
  Formik does not auto-cast values on submit
- Fixed a real renderValue bug in the shared MuiFormikSelect wrapper
  (echoed the raw value instead of resolving the MenuItem label,
  invisible elsewhere because other consumers' labels matched their
  values) - benefits 8 other call sites
- Fixed a stale-errors-across-entities bug in event-type-reducer.js
  (RECEIVE_EVENT_TYPE didn't reset errors, unlike UPDATE_EVENT_TYPE)

87 test suites / 733 tests passing, 0 lint errors on touched files.
Live-verified against a real summit without modifying its data.

ref: https://app.clickup.com/t/86bac70mf

* fix: unify color picker field between event-type and company dialogs

Both dialogs duplicated a ColorPickerField that tracked the picked
color in a useRef, splicing it into the payload only at submit time.
This was a workaround for mui-color-input firing onChange on every
pointermove while dragging, but it meant the color never participated
in Formik state: no yup validation, stale server-side errors that
never cleared on a corrective edit, and no name/id for the label or
useScrollToError to target.

Extract a shared MuiFormikColorField (src/components/mui/formik-inputs)
that keeps local state for instant drag/typing feedback but commits to
Formik (value + touched + validation) only on blur, avoiding a
full-dialog re-render storm while still getting real validation and
error-clearing. Add hexColorValidation() to src/utils/yup.js and wire
it into both dialogs' schemas.

Also fixes an unrelated pre-existing bug found while running the
suite: MuiFormikAsyncAutocomplete referenced an undeclared
defaultOptions variable, crashing every page that uses it.

* refactor: migrate company/event-type actions off base-actions snackbar wrapper

company-actions.js and event-type-actions.js now import snackbarErrorHandler
and snackbarSuccessHandler directly from openstack-uicore-foundation instead
of the local src/actions/base-actions.js wrapper, which is being phased out
in favor of uicore-foundation as the single source of truth. Other action
files still using the base-actions wrapper will be migrated incrementally
(tracked in docs/plans/clickup-migrate-snackbar-handlers-to-uicore.md).

event-type-actions.js also switches getEventTypes/getEventType/saveEventType/
deleteEventType/seedEventTypes from authErrorHandler (blocking alert) to
snackbarErrorHandler, adds a success snackbar for seedEventTypes, and adds
the event_types_seed i18n key.

Also removes a leftover dispatch(showMessage(success_message, ...)) call in
saveEventType's create branch left over from this migration - its backing
success_message const had been deleted, so it would have thrown
ReferenceError: success_message is not defined on every new event type
creation. The snackbarSuccessHandler dispatch right below it already covers
the success message.

* fix: commit color field pending value on Enter to avoid stale submit

* test: add event type list page coverage for search, pagination and crud flows

* fix: reset to first page when sorting event type list

* fix: refresh paginated event type list after seeding defaults

* fix: close event type dialog on save success regardless of list refresh outcome

* fix: sync color field display when formik value changes externally

* fix: show global spinner during event type delete and seed operations

---------

Signed-off-by: Priscila Moneo <priscila_moneo@hotmail.com.ar>
Co-authored-by: smarcet <smarcet@gmail.com>
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.

3 participants