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

Add Location unit #74

Merged
merged 300 commits into from
Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
300 commits
Select commit Hold shift + click to select a range
b2ecd3b
:hammer: Fix formfields linking
ashfahan Nov 7, 2020
28b1e62
:up: update typecheck in form
ashfahan Nov 7, 2020
29b83c9
:up: constants name
ashfahan Nov 7, 2020
2eff313
:heavy_plus_sign: Add ripple component
ashfahan Nov 7, 2020
97d69e9
:up: update code structure and fixes bugs
ashfahan Nov 9, 2020
636ef9d
:heavy_plus_sign: Add test and coverage
ashfahan Nov 9, 2020
a9b96fb
:hammer: Fix location Unit url
ashfahan Nov 9, 2020
a786abb
:hammer: Fix Link for Location Unit
ashfahan Nov 9, 2020
8759784
:hammer: Fix locationtags not updateing
ashfahan Nov 9, 2020
79d724e
:hammer: Fix location tag selector
ashfahan Nov 9, 2020
5a73d18
:fire: update payload
ashfahan Nov 9, 2020
b1227d9
:hammer: Fix request type
ashfahan Nov 9, 2020
3431bed
:fire: console.log from code
ashfahan Nov 9, 2020
611e9ba
:heavy_plus_sign: integrate uuid in project
ashfahan Nov 9, 2020
4da3380
:up: remove duplicate table test and update column test
ashfahan Nov 9, 2020
ee5b402
:hammer: fix `TypeError: Cannot read property 'objectsById' of undef…
ashfahan Nov 9, 2020
5eb7965
fix `TypeError: Cannot read property 'objectsById' of undefined`
ashfahan Nov 9, 2020
db929ea
:heavy_plus_sign: Add id in params
ashfahan Nov 9, 2020
c274c86
:up: move moduel base url into constants
ashfahan Nov 9, 2020
15635f2
:heavy_plus_sign: combine URL route into one constant
ashfahan Nov 9, 2020
a317b38
:link: link edit on table button to locationAdd component
ashfahan Nov 9, 2020
4d11b71
:up: move LocationUnitAdd.css into LocationUnitAdd index.tsx
ashfahan Nov 10, 2020
867ab41
:fire: remove unnecessary reducer registery code
ashfahan Nov 10, 2020
7e2f9b2
:fire: remove textentry field
ashfahan Nov 10, 2020
fcbad96
:heavy_plus_sign: impliment old way routing
ashfahan Nov 10, 2020
7962295
:heavy_plus_sign: Add and link location Tag selector
ashfahan Nov 10, 2020
45952aa
:pencil2: rename LocationDetail to LocationUnitDetail
ashfahan Nov 10, 2020
c8c30dd
:heavy_plus_sign: Add locationTagDetail
ashfahan Nov 10, 2020
d3cb605
:heavy_plus_sign: Merge 75 into 74
ashfahan Nov 10, 2020
3f2ed3c
:heavy_plus_sign: Location Tag add form
ashfahan Nov 11, 2020
457da49
:pencil2: rename Use differnt url from add to edit tag and location unit
ashfahan Nov 11, 2020
6a55dbf
:hammer: Fix typo for location tag get endpoint name
ashfahan Nov 11, 2020
b42ce22
:heavy_plus_sign: use constants for LOCATION_TAG_DELETE endpoint
ashfahan Nov 11, 2020
f2e2aa8
:hammer: Fix Url Routing
ashfahan Nov 11, 2020
fb9eadb
update naming convention for routing
ashfahan Nov 11, 2020
02450d3
:heavy_plus_sign: Add Tree Structure
ashfahan Nov 11, 2020
7c13613
:up: update package name
ashfahan Nov 12, 2020
0cf597b
refractor location tree to remove data flow dependency
ashfahan Nov 12, 2020
124f4d8
update loading logic
ashfahan Nov 12, 2020
56bfbe5
add location Parent tree selector
ashfahan Nov 12, 2020
a1430fe
:up: remove intialvalue and id value outside to parent component
ashfahan Nov 12, 2020
e534fdf
unwrap code from isloading
ashfahan Nov 12, 2020
62f1073
update loader logic
ashfahan Nov 12, 2020
657144d
combine same logic in single piece of code
ashfahan Nov 12, 2020
f02a33e
remove uuid lint warning
ashfahan Nov 12, 2020
9e2a39d
use stingify method to generate unique treeselect vlue
ashfahan Nov 13, 2020
d9df3af
:hammer: Fix location parent treeselect
ashfahan Nov 13, 2020
e7c63c5
fix loaction Unit view routing
ashfahan Nov 13, 2020
e539837
:fire: console.log
ashfahan Nov 13, 2020
f43526f
:heavy_plus_sign: Add missing location tag module export
ashfahan Nov 13, 2020
bc932b7
fix location tags select
ashfahan Nov 13, 2020
e9778c6
:fire: remove exporting userSchema
ashfahan Nov 16, 2020
24c2cf4
:up: :arrow_right: move location tag and tree data into parent component
ashfahan Nov 16, 2020
2ca5a41
:arrow_right: move function into component
ashfahan Nov 16, 2020
b3d8a4e
:fire: fix build issues
ashfahan Nov 16, 2020
87ad3c4
:tshirt: use const instead of let
ashfahan Nov 16, 2020
4f4e394
:hammer: Fix import path within the package itself
ashfahan Nov 16, 2020
d40520f
fix type mistake
ashfahan Nov 16, 2020
9f846c3
:up: use correct data type for location tree
ashfahan Nov 16, 2020
4ede033
:fire: remove unused variables
ashfahan Nov 16, 2020
50e303a
:tshirt: fix lint issues
ashfahan Nov 16, 2020
a195e97
:tshirt: fix lint issues
ashfahan Nov 16, 2020
019e5b7
improve lint, improve code
ashfahan Nov 16, 2020
19a9c5d
resolve post and put api not working for location module
ashfahan Nov 16, 2020
8108ac6
fix data loading and flow issues
ashfahan Nov 16, 2020
903aeda
remove extra tree component
ashfahan Nov 17, 2020
bbeed42
solve some lint issues
ashfahan Nov 17, 2020
051ae68
Merge branch 'master' into #48-Page-locationUnit
KipSigei Nov 17, 2020
aa4c962
Remove unimplemented page links
KipSigei Nov 17, 2020
1a303ee
Merge branch '#48-Page-locationUnit' of github.com:OpenSRP/web into #…
KipSigei Nov 17, 2020
90a6f74
Merge branch '#48-Page-locationUnit' of github.com:OpenSRP/web into #…
KipSigei Nov 17, 2020
0c838cc
:fire: remove unused variable
ashfahan Nov 17, 2020
e9049a8
Merge branch '#48-Page-locationUnit' of https://github.com/OpenSRP/we…
ashfahan Nov 17, 2020
4eb237a
:up: :package: update opsrp packges
ashfahan Nov 17, 2020
39543c7
fix tree select missing unique key warning
ashfahan Nov 17, 2020
ed051e4
:tshirt: code format
ashfahan Nov 17, 2020
5384fa1
resolve few lint issues
ashfahan Nov 18, 2020
b4ed525
resolve few lint issues
ashfahan Nov 18, 2020
2a5983f
resolve several lint issues
ashfahan Nov 18, 2020
2324244
resolve several lint issues
ashfahan Nov 18, 2020
2b7a543
Improve location tag detail coverage
KipSigei Nov 18, 2020
5e0d1ca
resolve lint issues
ashfahan Nov 18, 2020
45bc731
show heirachy node even without any child
ashfahan Nov 18, 2020
7fcb8aa
handle default value for parentid and other form
ashfahan Nov 18, 2020
500a423
make id required in post payload
ashfahan Nov 18, 2020
7e43ec8
finally resolve all husky lint issues
ashfahan Nov 18, 2020
bd11748
Merge branch 'master' into 48-Page-locationUnit
ashfahan Nov 18, 2020
d6bb940
:up: increase coverage for LocationUnitAdd
ashfahan Nov 18, 2020
13676a3
:hammer: Fix geographicLevel alaways 0 bug (#157)
ashfahan Nov 19, 2020
f22a48a
Improve LocationTagView tests
KipSigei Nov 19, 2020
14cc31a
Update tests
KipSigei Nov 19, 2020
8fa418a
:fire: remove unnessary snapshot
ashfahan Nov 19, 2020
67eda48
:hammer: Fix Datatype issue
ashfahan Nov 19, 2020
2075e81
:up: Improve removal of empty keys
ashfahan Nov 19, 2020
7484d61
:up: Improve removal of empty keys
ashfahan Nov 19, 2020
ecfe33d
Merge branch '#48-Page-locationUnit' of https://github.com/OpenSRP/we…
ashfahan Nov 20, 2020
4edf302
Quick Fix build for @HaseemUlHaq
ashfahan Nov 20, 2020
4644124
remove 'single' in interface name convention
ashfahan Nov 22, 2020
383743e
Add Tree component to module exports
KipSigei Nov 23, 2020
9dd0c74
Merge branch '#48-Page-locationUnit' of github.com:OpenSRP/web into #…
KipSigei Nov 23, 2020
a2e19e2
:up: categorize constants in location-management
ashfahan Nov 23, 2020
21f3448
:hammer: Fix typo mistake
ashfahan Nov 23, 2020
f2196da
:heavy_plus_sign: plus add use config for pacakge foldername
ashfahan Nov 23, 2020
004c8fb
:up: increase coverage for location module src
ashfahan Nov 23, 2020
ec0f90c
update from master
ashfahan Nov 24, 2020
3353d2a
:hammer: rebuild lock file
ashfahan Nov 24, 2020
9cd7fa3
address lint issues
ashfahan Nov 24, 2020
8a33389
fix eslint ignore code
ashfahan Nov 24, 2020
48edb94
:up: :package:
ashfahan Nov 24, 2020
45d2356
:fire: remove config from location-management
ashfahan Nov 24, 2020
ed4c62b
Use Better name to denote both edit and add in a component
ashfahan Nov 24, 2020
974a5ed
Fix types
KipSigei Nov 24, 2020
5799591
Fix tests
KipSigei Nov 24, 2020
63f0f91
:up: rebuild lock files
ashfahan Nov 24, 2020
09ef6ff
Merge branch '#48-Page-locationUnit' of https://github.com/OpenSRP/we…
ashfahan Nov 24, 2020
cb5f3f4
Merge branch 'master' into #48-Page-locationUnit
KipSigei Nov 24, 2020
038a64c
Fix linting triggred by new typescript version
KipSigei Nov 24, 2020
bf8899c
Merge branch 'master' into #48-Page-locationUnit
KipSigei Nov 26, 2020
5abc00b
Merge branch 'master' into #48-Page-locationUnit
KipSigei Nov 26, 2020
d79de7b
Fix tree expand bug
KipSigei Nov 27, 2020
3bcfd86
Fix tree search
KipSigei Nov 27, 2020
1885cbb
Fix styling
KipSigei Nov 27, 2020
9a69822
update location module notification messages
KipSigei Nov 27, 2020
11b7664
Add env var to show/hide teams module on menu
KipSigei Nov 27, 2020
5f2742d
Fix payload mutations
KipSigei Nov 27, 2020
d7d8f84
Improve test coverage
KipSigei Nov 30, 2020
a571d69
Update user management page titles
KipSigei Nov 30, 2020
230f7d8
Code cleanup
KipSigei Dec 1, 2020
e57428a
Remove unused action
KipSigei Dec 1, 2020
284e8ab
Improve Location add/edit form tests
KipSigei Dec 1, 2020
4803a25
Remove unused selector
KipSigei Dec 1, 2020
ce1e358
:fire: remove add-package script
ashfahan Dec 1, 2020
26bd4ac
:twisted_rightwards_arrows: move dependencies to peer
ashfahan Dec 1, 2020
6e2ff83
:fire: remove comment
ashfahan Dec 1, 2020
395f677
:fire: remove teams module toggle in .env
ashfahan Dec 3, 2020
cc800e3
move url into the contants
ashfahan Dec 3, 2020
e258347
:up: revert the sidebar teams changes to master
ashfahan Dec 3, 2020
1d5ba64
fire remove nested routing
ashfahan Dec 3, 2020
ec976af
only run test inside the package
ashfahan Dec 3, 2020
910b451
revert back to linus scripts
ashfahan Dec 3, 2020
361ed26
fix missing url for teams
ashfahan Dec 3, 2020
19319d1
refractor the code to use @opensrp/notifications
ashfahan Dec 3, 2020
ac8ef2b
revert the code back to verb instead of noun
ashfahan Dec 3, 2020
39d9d28
fix missing sendErrorNotification import
ashfahan Dec 3, 2020
334f7f1
remove unnessaray code
ashfahan Dec 3, 2020
91f95cb
add variable datatype
ashfahan Dec 3, 2020
4aceed8
:up: update test
ashfahan Dec 3, 2020
daec08e
update tests
ashfahan Dec 3, 2020
5b7cf33
fix and update tests for opensrp notifications
ashfahan Dec 3, 2020
4b05b1f
fix and update tests
ashfahan Dec 3, 2020
67ffa9d
fix and update tests
ashfahan Dec 3, 2020
345e80b
use generic message to be displayed for user
ashfahan Dec 3, 2020
821b621
update test description
ashfahan Dec 3, 2020
7cbaa58
update test description
ashfahan Dec 3, 2020
3010716
refractor code to seperate mock call expect
ashfahan Dec 3, 2020
d4625a7
update tests description
ashfahan Dec 3, 2020
d4b6803
update tests description
ashfahan Dec 3, 2020
818c90e
move dependencies to peerdependencies
ashfahan Dec 3, 2020
97775fb
fix mistakenly remove variable
ashfahan Dec 3, 2020
c52d038
removed unnessary code
ashfahan Dec 3, 2020
cd04d5b
removed unnessary code
ashfahan Dec 3, 2020
8945dc5
use more accurate type for event
ashfahan Dec 3, 2020
1fce478
add types for uuid
ashfahan Dec 3, 2020
97ed6b0
update git to master
ashfahan Dec 7, 2020
0f7f49a
:up: switch to use uuid instead of uuidv4
ashfahan Dec 7, 2020
6ef7c5c
:up: update test description
ashfahan Dec 7, 2020
7a1dd90
:heavy_check_mark: resolve and update all test
ashfahan Dec 7, 2020
b8fbbd9
move packages to dependencies
haseemVD Dec 8, 2020
60cc4c2
update snapshot test
haseemVD Dec 8, 2020
6fb9555
update to master
ashfahan Dec 9, 2020
077298b
update snapshot
ashfahan Dec 9, 2020
e760724
update snapshot
ashfahan Dec 9, 2020
c85926d
:up: update snapshot
ashfahan Dec 9, 2020
b8a03d3
Revert ":up: update snapshot"
ashfahan Dec 9, 2020
1e60f33
cover up branches in LocationTagAddEdit
ashfahan Dec 10, 2020
64f6770
remove unused variable
ashfahan Dec 10, 2020
ef7c040
replace location tag with location unit group (#207)
haseemVD Dec 10, 2020
ac0c45c
:up: refractor the code to seperate functions for improve coverage
ashfahan Dec 11, 2020
d7027ca
:up: update interface for location unit
ashfahan Dec 11, 2020
8c443a9
Revert ":up: update interface for location unit"
ashfahan Dec 11, 2020
b01f8b2
:hammer: Fix HierarchyNode interface
ashfahan Dec 11, 2020
6e9b8f3
:hammer: Fix OpenSrp location Tree utils
ashfahan Dec 11, 2020
4b57af1
update interface for location unit
ashfahan Dec 11, 2020
969cbec
:hammer: Fix fixtures for tests
ashfahan Dec 11, 2020
c4b6620
fix searched value modification
ashfahan Dec 11, 2020
6f1726b
fix tests assertion
ashfahan Dec 11, 2020
fc088ad
use base url from env
haseemVD Dec 11, 2020
0e46c6d
Merge branch '#48-Page-locationUnit' of https://github.com/OpenSRP/we…
haseemVD Dec 11, 2020
b46d708
refactor code to use baseUrl from env
haseemVD Dec 12, 2020
aab5be1
:hammer: fix tree node click
ashfahan Dec 12, 2020
f6d808c
:fire: remove unused loc
ashfahan Dec 12, 2020
13feeba
:up: move tree test into the component
ashfahan Dec 12, 2020
72c7bc2
:heavy_plus_sign: :heavy_check_mark: test to test util functionality
ashfahan Dec 12, 2020
f821061
:fire: remove unnecessary flush
ashfahan Dec 12, 2020
492e2ae
:up: update fixture names
ashfahan Dec 12, 2020
143fd7d
:up: update and remove extra fixtures
ashfahan Dec 12, 2020
a1e747d
:up: update test for location unit view table
ashfahan Dec 12, 2020
9b95277
:up: update and cover up functions test in locationunitview index
ashfahan Dec 12, 2020
34df470
:heavy_plus_sign: increase locationunitview test coverage
ashfahan Dec 12, 2020
a386d66
:fire: remove need of data store in passing current selected node in …
ashfahan Dec 12, 2020
048f777
only show location if ENABLE_LOCATIONS in env
ashfahan Dec 12, 2020
6d164ca
:heavy_check_mark: fix test in Tree and add test for click event
ashfahan Dec 12, 2020
2068626
:hammer: fix tests typo
ashfahan Dec 12, 2020
7bd30f5
:heavy_plus_sign: Add test to check table change on tree node click
ashfahan Dec 12, 2020
160c9aa
:heavy_plus_sign: Add tests for location unit details open and close
ashfahan Dec 13, 2020
39ffa85
:up: cover LocationUnitAddEdit coverage
ashfahan Dec 13, 2020
7731ece
:hammer: fix tests for LocationUnitAddEdit form
ashfahan Dec 13, 2020
d0ab7ad
Merge branch 'master' into #48-Page-locationUnit
ashfahan Dec 13, 2020
27f7d36
integrate ParsedHierarchyNode into data key of tree node
ashfahan Dec 13, 2020
59041a8
:hammer: fix lint errors
ashfahan Dec 13, 2020
4cef89e
:hammer: fix lint error
ashfahan Dec 13, 2020
6d875c0
:hammer: fix lint error
ashfahan Dec 13, 2020
6a86c36
:up: update snapshot
ashfahan Dec 13, 2020
363cdd4
:hammer: fix stage serve url
ashfahan Dec 13, 2020
8534f1f
:heavy_plus_sign: Update snapshot
ashfahan Dec 13, 2020
39b6ca5
add fallback condition for baseurl
haseemVD Dec 14, 2020
9b736fb
:heavy_plus_sign: Add doc for generateFilterData function
ashfahan Dec 14, 2020
3621df3
:up: tests description
ashfahan Dec 14, 2020
5dfd75f
update tests description
ashfahan Dec 14, 2020
785b327
:heavy_plus_sign: Add test for enable location module
ashfahan Dec 14, 2020
f529dd0
replace ripple with ant spin component
ashfahan Dec 14, 2020
fa9565b
:up: update tests
ashfahan Dec 15, 2020
379376a
optimize table snapshot
ashfahan Dec 15, 2020
9a4d0f1
Merge branch 'master' into #48-Page-locationUnit
ashfahan Dec 15, 2020
96aacea
:hammer: fix eslint
ashfahan Dec 15, 2020
f0f65d2
:heavy_plus_sign: Add jest mock to mock api calls on ci
ashfahan Dec 15, 2020
e5fb75b
:hammer: fix lint issue
ashfahan Dec 15, 2020
04a8de0
revert to constant base api url
ashfahan Dec 15, 2020
9a1bfaf
:hammer: fix lint issue
ashfahan Dec 15, 2020
eef71bd
reset to opensrp stage
ashfahan Dec 15, 2020
d79c202
format loc
ashfahan Dec 15, 2020
8c14af2
change api base url in packages env too
ashfahan Dec 15, 2020
ad0fc9d
use the env variable being used instead of the value false
ashfahan Dec 15, 2020
4e8c62f
add docs for REACT_APP_ENABLE_LOCATIONS env
ashfahan Dec 15, 2020
e5d5037
decrease snapshot of LocationUnitDetail
ashfahan Dec 15, 2020
03bace6
remove unused snapshot
ashfahan Dec 15, 2020
e2860b4
:up: update test and remove unnecessary test
ashfahan Dec 15, 2020
2897843
:fire: remove unused import
ashfahan Dec 15, 2020
31590a3
improve remove removeEmptykeys function logic
ashfahan Dec 16, 2020
2154887
move Ui string to constant
ashfahan Dec 16, 2020
d005630
use more understable function naming convention
ashfahan Dec 16, 2020
13ee643
fire remove commented code
ashfahan Dec 16, 2020
8ff1bcc
add constant for strings
ashfahan Dec 16, 2020
786a828
add constant for strings
ashfahan Dec 16, 2020
983da79
fix constant import
ashfahan Dec 16, 2020
f95502d
:hammer: Fix lint issue
ashfahan Dec 16, 2020
f2919e4
:hammer: update snapshot
ashfahan Dec 16, 2020
17e8c5b
resolve conflicts with master
ashfahan Dec 16, 2020
2fab9bd
:heavy_plus_sign: fix merge conflict
ashfahan Dec 16, 2020
36a8d8e
remove unused variables
ashfahan Dec 16, 2020
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build
.env.test.local
.env.production.local

debug.log*
npm-debug.log*
yarn-debug.log*
yarn-error.log*
8 changes: 5 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
"@onaio/utils": "^0.0.1",
"@opensrp/error-boundary-fallback": "file:../packages/error-boundary-fallback",
"@opensrp/keycloak-service": "^0.0.8",
"@opensrp/notifications": "^0.0.1",
"@opensrp/location-management": "^0.0.7",
"@opensrp/notifications": "^0.0.2",
"@opensrp/product-catalogue": "^0.0.2",
"@opensrp/plans": "0.0.2",
"@opensrp/react-utils": "^0.0.1",
"@opensrp/reducer-factory": "^0.0.11",
"@opensrp/server-logout": "^0.0.1",
"@opensrp/server-service": "^0.0.11",
"@opensrp/server-service": "^0.0.12",
"@opensrp/store": "^0.0.7",
"@opensrp/user-management": "^0.1.9",
"@opensrp/form-config": "^0.0.6",
Expand All @@ -44,6 +45,7 @@
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"seamless-immutable": "^7.1.4",
"tree-model": "^1.0.7",
"yup": "^0.29.3"
},
"scripts": {
Expand Down Expand Up @@ -121,4 +123,4 @@
"resolutions": {
"react-scripts/jest": "25.3.0"
}
}
}
54 changes: 54 additions & 0 deletions client/src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ import {
BACKEND_CALLBACK_PATH,
URL_REACT_LOGIN,
URL_LOGOUT,
URL_LOCATION_UNIT,
URL_HOME,
URL_LOCATION_UNIT_ADD,
URL_LOCATION_UNIT_GROUP,
URL_LOCATION_UNIT_GROUP_ADD,
URL_LOCATION_UNIT_GROUP_EDIT,
URL_LOCATION_UNIT_EDIT,
URL_UPLOAD_JSON_VALIDATOR,
URL_JSON_VALIDATOR_LIST,
URL_UPLOAD_DRAFT_FILE,
Expand Down Expand Up @@ -79,6 +85,12 @@ import {
import ConnectedHomeComponent from '../containers/pages/Home/Home';
import './App.css';
import ConnectedSidebar from '../containers/ConnectedSidebar';
import {
LocationUnitAddEdit,
LocationUnitView,
LocationUnitGroupAddEdit,
LocationUnitGroupView,
} from '@opensrp/location-management';
import '@opensrp/product-catalogue/dist/index.css';
import {
productCatalogueProps,
Expand Down Expand Up @@ -363,6 +375,48 @@ const App: React.FC = () => {
component={AntdFilesList.FileList}
{...releaseViewProps}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_LOCATION_UNIT}
component={LocationUnitView}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_LOCATION_UNIT_ADD}
component={LocationUnitAddEdit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_LOCATION_UNIT_EDIT}
component={LocationUnitAddEdit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_LOCATION_UNIT_GROUP}
component={LocationUnitGroupView}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_LOCATION_UNIT_GROUP_ADD}
component={LocationUnitGroupAddEdit}
/>
<PrivateComponent
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={URL_LOCATION_UNIT_GROUP_EDIT}
component={LocationUnitGroupAddEdit}
/>
<Route
exact
path={APP_LOGIN_URL}
Expand Down
24 changes: 17 additions & 7 deletions client/src/components/page/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import { Link } from 'react-router-dom';
import {
LOCATIONS_UNIT,
LOCATIONS_UNIT_GROUP,
LOCATIONS_UNIT_GROUP_SET,
PRODUCT_CATALOGUE,
TEAMS,
URL_ADMIN,
URL_HOME,
URL_LOCATION_UNIT_GROUP,
URL_TEAMS,
URL_LOCATION_UNIT,
USER_MANAGEMENT,
URL_JSON_VALIDATOR_LIST,
URL_DRAFT_FILE_LIST,
Expand All @@ -24,7 +25,6 @@ import {
MANIFEST_RELEASES,
DRAFT_FILES,
JSON_VALIDATORS,
LOCATIONS,
USERS,
ADMIN,
ACTIVE,
Expand All @@ -37,6 +37,7 @@ import { CATALOGUE_LIST_VIEW_URL } from '@opensrp/product-catalogue';
import {
ENABLE_FORM_CONFIGURATION,
ENABLE_PLANS,
ENABLE_LOCATIONS,
ENABLE_PRODUCT_CATALOGUE,
} from '../../../configs/env';
import {
Expand Down Expand Up @@ -117,11 +118,20 @@ export const SidebarComponent: React.FC<SidebarProps> = (props: SidebarProps) =>
</Link>
</Menu.Item>
)}
<Menu.SubMenu key="admin-locations" title={LOCATIONS}>
<Menu.Item key="locations-unit">{LOCATIONS_UNIT}</Menu.Item>
<Menu.Item key="locations-unit-group">{LOCATIONS_UNIT_GROUP}</Menu.Item>
<Menu.Item key="locations-unit-group-set">{LOCATIONS_UNIT_GROUP_SET}</Menu.Item>
</Menu.SubMenu>
{ENABLE_LOCATIONS && (
ashfahan marked this conversation as resolved.
Show resolved Hide resolved
<Menu.SubMenu key="admin-locations" title="Locations">
<Menu.Item key="locations-unit">
<Link to={URL_LOCATION_UNIT} className="admin-link">
{LOCATIONS_UNIT}
</Link>
</Menu.Item>
<Menu.Item key="locations-unit-group">
<Link to={URL_LOCATION_UNIT_GROUP} className="admin-link">
{LOCATIONS_UNIT_GROUP}
</Link>
</Menu.Item>
</Menu.SubMenu>
)}
{ENABLE_FORM_CONFIGURATION && (
<Menu.SubMenu key="admin-form-config" title={FORM_CONFIGURATIONS}>
<Menu.Item key="admin-form-config-releases">
Expand Down
3 changes: 3 additions & 0 deletions client/src/configs/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export const ENABLE_PRODUCT_CATALOGUE = process.env.REACT_APP_ENABLE_PRODUCT_CAT
/** Activate the plans menu */
export const ENABLE_PLANS = process.env.REACT_APP_ENABLE_PLANS === 'true';

/** Activate the plans menu */
export const ENABLE_LOCATIONS = process.env.REACT_APP_ENABLE_LOCATIONS === 'true';
ashfahan marked this conversation as resolved.
Show resolved Hide resolved

export const DATE_FORMAT = process.env.REACT_APP_DATE_FORMAT || 'yyyy-MM-DD';

export const DEFAULT_TIME = process.env.REACT_APP_DEFAULT_TIME || 'T00:00:00+00:00';
Expand Down
10 changes: 7 additions & 3 deletions client/src/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const USER_MANAGEMENT = 'User Management';
export const TEAMS = 'Teams';
export const LOCATIONS_UNIT = 'Locations unit';
export const LOCATIONS_UNIT_GROUP = 'Locations unit group';
export const LOCATIONS_UNIT_GROUP_SET = 'Locations unit group set';
export const PRODUCT_CATALOGUE = 'Product Catalogue';
export const ERROR_OCCURRED = 'An error occurred';
export const MANIFEST_RELEASES = 'Manifest Releases';
export const DRAFT_FILES = 'Draft Files';
export const JSON_VALIDATORS = 'JSON Validators';
Expand All @@ -32,10 +32,14 @@ export const URL_USER_EDIT = '/user/edit';
export const URL_TEAMS = '/teams';
export const URL_BACKEND_LOGIN = '/fe/login';
export const URL_BACKEND_CALLBACK = '/fe/oauth/callback/opensrp';
export const URL_LOCATION_UNIT = '/location/unit';
export const URL_LOCATION_UNIT_ADD = '/location/unit/add';
export const URL_LOCATION_UNIT_EDIT = '/location/unit/edit/:id';
export const URL_LOCATION_UNIT_GROUP = '/location/group';
export const URL_LOCATION_UNIT_GROUP_ADD = '/location/group/add';
export const URL_LOCATION_UNIT_GROUP_EDIT = '/location/group/edit/:id';
export const URL_UPLOAD_JSON_VALIDATOR = '/json-validators/upload';
export const URL_JSON_VALIDATOR_LIST = '/json-validators';
export const URL_DRAFT_FILE_LIST = '/drafts';
export const URL_UPLOAD_DRAFT_FILE = '/drafts/upload';
export const URL_MANIFEST_RELEASE_LIST = '/releases';

export const ERROR_OCCURRED = 'An error occurred';
Loading