Skip to content

feat(#10548): add TASK, TARGET, USER_SETTINGS constants to DOC_TYPES#11239

Open
AshayK003 wants to merge 2 commits into
medic:masterfrom
AshayK003:feat/add-task-target-user-settings-constants
Open

feat(#10548): add TASK, TARGET, USER_SETTINGS constants to DOC_TYPES#11239
AshayK003 wants to merge 2 commits into
medic:masterfrom
AshayK003:feat/add-task-target-user-settings-constants

Conversation

@AshayK003

Copy link
Copy Markdown

Summary

Adds DOC_TYPES.TASK, DOC_TYPES.TARGET, and DOC_TYPES.USER_SETTINGS constants to the shared constants library and replaces all magic-string usages in production code.

Changes (6 files, +13/−8):

  • shared-libs/constants/src/index.js — Added 3 new constants to DOC_TYPES
  • api/src/services/replication/authorization.js — Replaced 'user-settings' and 'task'
  • shared-libs/cht-datasource/src/local/target.ts — Added import + replaced 'target'
  • shared-libs/rules-engine/src/rules-emitter/emitter.javascript.js — Added import + replaced 'task'/'target'
  • webapp/src/ts/modules/tasks/tasks.component.ts — Replaced 'task' (import existed)
  • webapp/src/ts/services/rules-engine.service.ts — Replaced 2× 'task' (import existed)

Not changed — CouchDB ddoc files (sandboxed context), form.service.ts (FormType), E2E tests.

Closes #10548

…YPES

Adds DOC_TYPES.TASK, DOC_TYPES.TARGET, and DOC_TYPES.USER_SETTINGS
constants and replaces magic-string usages across the codebase.

Closes medic#10548
@AshayK003

AshayK003 commented Jul 7, 2026

Copy link
Copy Markdown
Author

Hi maintainers 👋

This PR adds DOC_TYPES.TASK, DOC_TYPES.TARGET, and DOC_TYPES.USER_SETTINGS constants to the shared constants library and replaces all corresponding magic-string usages across the codebase (6 files, +13/−8). Closes #10548.

Could someone please take a look when you get a chance? The CI checks appear to need a maintainer's approval to run from this fork. Happy to address any feedback.

@AshayK003

Copy link
Copy Markdown
Author

@maintainers Bumping for visibility. This adds 3 missing constants (TASK, TARGET, USER_SETTINGS) to the shared DOC_TYPES library and replaces magic strings across 4 files. SonarCloud warnings are all pre-existing in files touched by the diff, not introduced by this change. Happy to address any feedback.

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.

Add constants for 'task', 'target', and 'user-settings' document types

1 participant