@openmrs/esm-fast-data-entry-app 1.5.1-pre.984 → 1.5.1-pre.989

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,7 @@ import { Add, Close } from '@carbon/react/icons';
5
5
  import { showModal, showSnackbar, useConfig, useSession } from '@openmrs/esm-framework';
6
6
  import GroupFormWorkflowContext from '../../context/GroupFormWorkflowContext';
7
7
  import CompactGroupSearch from '../group-search/CompactGroupSearch';
8
+ import FormName from '../../form-name/FormName';
8
9
  import styles from './styles.scss';
9
10
 
10
11
  const GroupSearchHeader = () => {
@@ -67,6 +68,7 @@ const GroupSearchHeader = () => {
67
68
 
68
69
  return (
69
70
  <div className={styles.searchHeaderContainer}>
71
+ <FormName formUuid={activeFormUuid} variant="inline" />
70
72
  <span className={styles.padded}>{t('findGroup', 'Find group')}:</span>
71
73
  <span className={styles.searchBarWrapper}>
72
74
  <CompactGroupSearch selectGroupAction={handleSelectGroup} />
@@ -17,4 +17,5 @@
17
17
 
18
18
  .padded {
19
19
  padding: layout.$spacing-05;
20
+ white-space: nowrap;
20
21
  }
@@ -0,0 +1,10 @@
1
+ import useSWR from 'swr';
2
+ import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
3
+
4
+ export function useFormName(formUuid?: string): string | undefined {
5
+ const { data } = useSWR<{ data: { name?: string; display?: string } }>(
6
+ formUuid ? `${restBaseUrl}/form/${formUuid}?v=custom:(uuid,name,display)` : null,
7
+ openmrsFetch,
8
+ );
9
+ return data?.data?.display ?? data?.data?.name;
10
+ }
@@ -23,6 +23,7 @@
23
23
  "fastDataEntry": "Fast Data Entry",
24
24
  "fillForm": "Fill Form",
25
25
  "findGroup": "Find group",
26
+ "form": "Form",
26
27
  "formName": "Form Name",
27
28
  "formsAppMenuLink": "Fast Data Entry",
28
29
  "formsFilled": "Forms filled",