Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) O3-2262 & O3-2263: Previously logged in locations should show at the top of the locations' list #954

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0038de5
Better naming for the variables
vasharma05 Dec 12, 2023
e548826
(fix) Fixed the default login location coming in the every term search
vasharma05 Dec 14, 2023
17fb6b8
Added test to check for default location not coming when searching
vasharma05 Dec 14, 2023
edcf383
Fixed the search term and loading flows
vasharma05 Dec 14, 2023
27718d8
Merge branch 'main' of https://www.github.com/openmrs/openmrs-esm-cor…
vasharma05 Dec 15, 2023
e4af220
Allow saving logged in locations in user properties
vasharma05 Mar 11, 2024
a194b12
Fetching previously logged in locations separately
vasharma05 Mar 11, 2024
1b717e6
Merge branch 'main' of https://www.github.com/openmrs/openmrs-esm-cor…
vasharma05 Mar 11, 2024
a32d47b
Resolved conflicts
vasharma05 Mar 11, 2024
ce56fb9
Moved useLoginLocations inside location picker
vasharma05 Mar 11, 2024
63d8340
Merge branch 'fix/location-picker-preferred-location' into feat/O3-2263
vasharma05 Mar 11, 2024
86015cf
Updating user properties with selected location in a single request
vasharma05 Mar 12, 2024
7b68cc8
Fixed the location display texts
vasharma05 Mar 12, 2024
33bec2a
Updated tests
vasharma05 Mar 20, 2024
9812b9d
Merge branch 'main' of https://www.github.com/openmrs/openmrs-esm-cor…
vasharma05 Mar 21, 2024
a35f34f
Moved useLoginLocations inside react-utils
vasharma05 Mar 21, 2024
3e74338
Clean locations mock
vasharma05 Mar 22, 2024
1784829
Updated documentation
vasharma05 Mar 22, 2024
85b538a
Merge branch 'main' of https://www.github.com/openmrs/openmrs-esm-cor…
vasharma05 Apr 4, 2024
a5c01f6
Review changes
vasharma05 Apr 11, 2024
fb8ac71
Merge branch 'main' of https://www.github.com/openmrs/openmrs-esm-cor…
vasharma05 May 7, 2024
8b0e16a
Review changes
vasharma05 May 7, 2024
6814b71
Updated docs
vasharma05 May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 0 additions & 198 deletions packages/apps/esm-login-app/__mocks__/locations.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,201 +340,3 @@ export const mockLoginLocations = {
],
},
};

export const mockLocationResponseWithOneEntry = {
data: {
resourceType: 'Bundle',
id: '301b3ad6-868a-48a6-bc3f-aaa8aa3f89a6',
meta: {
lastUpdated: '2022-03-17T07:47:02.272+00:00',
tag: [
{
system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationValue',
code: 'SUBSETTED',
display: 'Resource encoded in summary mode',
},
],
},
type: 'searchset',
total: 1,
link: [
{
relation: 'self',
url: 'http://openmrs:8080/openmrs/ws/fhir2/R4/Location?_count=50&_summary=data&_tag=login%20location',
},
],
entry: [
{
fullUrl: 'http://openmrs:8080/openmrs/ws/fhir2/R4/Location/44c3efb0-2583-4c80-a79e-1f756a03c0a1',
resource: {
resourceType: 'Location',
id: '44c3efb0-2583-4c80-a79e-1f756a03c0a1',
meta: {
tag: [
{
system: 'http://fhir.openmrs.org/ext/location-tag',
code: 'Login Location',
display: 'When a user logs in and chooses a session location, they may only choose one with this tag',
},
{
system: 'http://fhir.openmrs.org/ext/location-tag',
code: 'Facility Location',
},
{
system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationValue',
code: 'SUBSETTED',
display: 'Resource encoded in summary mode',
},
],
},
contained: [
{
resourceType: 'Provenance',
id: 'e6f5d190-5a5a-4e1f-b34b-20a3480a6e1b',
meta: {
tag: [
{
system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationValue',
code: 'SUBSETTED',
display: 'Resource encoded in summary mode',
},
],
},
recorded: '2022-02-23T22:44:33.000+00:00',
activity: {
coding: [
{
system: 'http://terminology.hl7.org/CodeSystemv3-DataOperation',
code: 'CREATE',
display: 'create',
},
],
},
agent: [
{
type: {
coding: [
{
system: 'http://terminology.hl7.org/CodeSystemprovenance-participant-type',
code: 'author',
display: 'Author',
},
],
},
role: [
{
coding: [
{
system: 'http://terminology.hl7.org/CodeSystemv3-ParticipationType',
code: 'AUT',
display: 'author',
},
],
},
],
who: {
reference: 'Practitioner/A4F30A1B-5EB9-11DF-A648-37A07F9C90FB',
type: 'Practitioner',
display: 'Super User',
},
},
],
},
],
status: 'active',
name: 'Outpatient Clinic',
description: 'Outpatient Clinic',
},
},
],
},
};

export const validatingLocationSuccessResponse = {
ok: true,
data: {
resourceType: 'Bundle',
id: 'e3c2aa40-21b0-4671-a492-bb7e7f16cc46',
meta: {
lastUpdated: '2023-11-08T08:45:48.967+00:00',
},
type: 'searchset',
total: 1,
link: [
{
relation: 'self',
url: 'https://dev3.openmrs.org/openmrs/ws/fhir2/R4/Location?_id=1ce1b7d4-c865-4178-82b0-5932e51503d6',
},
],
entry: [
{
fullUrl: 'https://dev3.openmrs.org/openmrs/ws/fhir2/R4/Location/1ce1b7d4-c865-4178-82b0-5932e51503d6',
resource: {
resourceType: 'Location',
id: '1ce1b7d4-c865-4178-82b0-5932e51503d6',
meta: {
lastUpdated: '2023-09-05T15:20:51.000+00:00',
tag: [
{
system: 'http://fhir.openmrs.org/ext/location-tag',
code: 'Login Location',
display: 'When a user logs in and chooses a session location, they may only choose one with this tag',
},
],
},
text: {
status: 'generated',
div: '<div xmlns="http://www.w3.org/1999/xhtml"><h2>Community Outreach</h2></div>',
},
status: 'active',
name: 'Community Outreach',
description: 'Community Outreach',
},
},
],
},
};

export const validatingLocationFailureResponse = {
ok: false,
data: {
resourceType: 'Bundle',
id: 'deaa418b-c900-4fd3-bb35-16fe5c2be744',
meta: {
lastUpdated: '2023-11-08T08:45:20.012+00:00',
},
type: 'searchset',
total: 0,
link: [
{
relation: 'self',
url: 'https://dev3.openmrs.org/openmrs/ws/fhir2/R4/Location?_id=8d6c993e-c2cc-11de-8d13-0010c6dffd0',
},
],
},
};

export const mockSoleLoginLocation = {
data: {
id: '301b3ad6-868a-48a6-bc3f-aaa8aa3f891z',
total: 1,
link: [
{
relation: 'self',
url: 'http://openmrs:8080/openmrs/ws/fhir2/R4/Location?_count=50&_summary=data&_tag=login%20location',
},
],
entry: [
{
resource: {
id: '44c3efb0-2583-4c80-a79e-1f756a03c0a1',
status: 'active',
name: 'Outpatient Clinic',
description: 'Outpatient Clinic',
},
},
],
},
};

export const mockSetSessionLocation = Promise.resolve();
Loading
Loading