Skip to content

Commit

Permalink
optional contact label for replace titles (#143)
Browse files Browse the repository at this point in the history
* optional contact label for replace title

* Update src/liquid/app/form_switch.html

Co-authored-by: Kenn Sippell <[email protected]>

* update readme

* 1.3.10

---------

Co-authored-by: Kenn Sippell <[email protected]>
  • Loading branch information
freddieptf and kennsippell authored Apr 17, 2024
1 parent b65141e commit fbce22d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Property | Type | Description
`contact_types.name` | string | The name of the contact_type as it [appears in the app's base_settings.json](https://docs.communityhealthtoolkit.org/apps/reference/app-settings/hierarchy/)
`contact_types.friendly` | string | Friendly name of the contact type
`contact_types.contact_type` | string | The contact_type of the primary contact. [As defined in base_settings.json](https://docs.communityhealthtoolkit.org/apps/reference/app-settings/hierarchy/)
`contact_types.contact_friendly` | string | Friendly name of the primary contact type
`contact_types.user_role` | string[] | A list of allowed [user roles](https://docs.communityhealthtoolkit.org/apps/reference/app-settings/user-roles/). If only one is provided, it will be used by default.
`contact_types.username_from_place` | boolean | When true, the username is generated from the place's name. When false, the username is generated from the primary contact's name. Default is false.
`contact_types.hierarchy` | Array<ConfigProperty> | Defines how this `contact_type` is connected into the hierarchy. An element with `level:1` (parent) is required and additional elements can be provided to support disambiguation. See [ConfigProperty](#ConfigProperty).
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cht-user-management",
"version": "1.3.9",
"version": "1.3.10",
"main": "dist/index.js",
"dependencies": {
"@fastify/autoload": "^5.8.0",
Expand Down
1 change: 1 addition & 0 deletions src/config/chis-ke/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"name": "c_community_health_unit",
"friendly": "Community Health Unit",
"contact_type": "person",
"contact_friendly": "Community Health Assistant",
"user_role": ["community_health_assistant"],
"username_from_place": true,
"deactivate_users_on_replace": false,
Expand Down
1 change: 1 addition & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type ContactType = {
name: string;
friendly: string;
contact_type: string;
contact_friendly?: string;
user_role: string[];
username_from_place: boolean;
hierarchy: HierarchyConstraint[];
Expand Down
2 changes: 1 addition & 1 deletion src/liquid/app/form_switch.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<section class="hero is-small">
<div class="hero-body">
<p class="title">
{{header_caption}} {{contactType.friendly}}
{{header_caption}} {{contactType.contact_friendly | default: contactType.friendly }}
</p>
</div>
</section>
Expand Down

0 comments on commit fbce22d

Please sign in to comment.