Skip to content

Update Local Units#2206

Merged
frozenhelium merged 1 commit intodevelopfrom
project/local-units
Jan 22, 2026
Merged

Update Local Units#2206
frozenhelium merged 1 commit intodevelopfrom
project/local-units

Conversation

@frozenhelium
Copy link
Copy Markdown
Member

@frozenhelium frozenhelium commented Jan 20, 2026

Addresses

Depends on

Changes

  • Refactor Local Units form
  • Add option to export Local Units
  • Add warning message in the Import Modal
  • Refactor Local Units Configuration Modal

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 20, 2026

🦋 Changeset detected

Latest commit: 92b4a38

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@ifrc-go/ui Patch
go-web-app Minor
go-ui-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@frozenhelium frozenhelium self-assigned this Jan 21, 2026
Copy link
Copy Markdown
Member

@AdityaKhatri AdityaKhatri left a comment

Choose a reason for hiding this comment

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

Only checked logical issues. Haven't run it locally.


const strings = useTranslation(i18n);
const [confirmationText, setConfirmationText] = useState<string>();
const [newValue, setNewValue] = useState(value);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this required? I don't see a reason not to make this completely controlled.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The temporary state is to trigger the confirmation, actual value is synchronized with the server!

Comment on lines +69 to +79
const localUnitTypeToIdMap = listToMap(
externallyManagedResponse?.results,
({ local_unit_type_details }) => local_unit_type_details.id,
({ id }) => id,
);

const externallyManagedMapping = listToMap(
externallyManagedResponse?.results,
({ local_unit_type_details }) => local_unit_type_details.id,
({ enabled }) => enabled,
);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Preferably should be memoized

},
});

const localUnitTypeLabelMap = listToMap(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

preferably memoize

Copy link
Copy Markdown
Collaborator

@shreeyash07 shreeyash07 left a comment

Choose a reason for hiding this comment

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

Left few comments and please check again if any translation strings are missing. @frozenhelium

value={selectedLocalUnitType}
onChange={setSelectedLocalUnitType}
name="local_unit_type"
// disabled={pending}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if not needed remove this please check

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@frozenhelium you missed this lets do it in next round

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This will be taken care of during rebase

Comment thread packages/ui/src/components/InputContainer/styles.module.css Outdated
@frozenhelium frozenhelium merged commit 7e15227 into develop Jan 22, 2026
22 checks passed
@frozenhelium frozenhelium deleted the project/local-units branch January 22, 2026 09:03
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.

Local Units - Properly handle switching between internally and externally managed states

3 participants