Skip to content

Commit

Permalink
avniproject/avni-server#849 | Introduce isAllowedToInvokeTokenGenerat…
Browse files Browse the repository at this point in the history
…ionAPI modification in user settings
  • Loading branch information
himeshr committed Jan 16, 2025
1 parent 4a70d07 commit 4b3220c
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
18 changes: 9 additions & 9 deletions public/bulkuploads/sample/usersAndCatchments.csv
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Location with full hierarchy,Catchment Name,Username,Full Name of User,Email,Phone,Language,Track Location,Date picker mode,Enable Beneficiary mode,Beneficiary ID Prefix
"PHC B, Sub B, Vil B",Org X Cat A,user29@orgx,user29,[email protected],+919876543210,English,yes,calendar,no,U29
"PHC B, Sub B, Vil C",Org X Cat A,user29@orgx,user29,[email protected],+919876543210,English,yes,calendar,no,U29
"PHC B, Sub C, Vil C",Org X Cat A,user29@orgx,user29,[email protected],+919876543210,English,yes,calendar,no,U29
"PHC B, Sub B, Vil C",Org X Cat B,user49@orgx,user49,[email protected],+919876543210,English,yes,,no,U49
"PHC B, Sub C, Vil C",Org X Cat B,user49@orgx,user49,[email protected],+919876543210,English,yes,,no,U49
"PHC C, Sub C, Vil C",Org X Cat B,user49@orgx,user49,[email protected],+919876543210,English,yes,,no,U49
"PHC B, Sub C, Vil C",Org X Cat C,user69@orgx,user69,[email protected],+919876543210,English,no,spinner,no,U69
"PHC C, Sub C, Vil C",Org X Cat C,user69@orgx,user69,[email protected],+919876543210,English,no,spinner,no,U69
Location with full hierarchy,Catchment Name,Username,Full Name of User,Email,Phone,Language,Track Location,Is Allowed To Invoke Token Generation API,Date picker mode,Enable Beneficiary mode,Beneficiary ID Prefix
"PHC B, Sub B, Vil B",Org X Cat A,user29@orgx,user29,[email protected],+919876543210,English,yes,no,calendar,no,U29
"PHC B, Sub B, Vil C",Org X Cat A,user29@orgx,user29,[email protected],+919876543210,English,yes,no,calendar,no,U29
"PHC B, Sub C, Vil C",Org X Cat A,user29@orgx,user29,[email protected],+919876543210,English,yes,no,calendar,no,U29
"PHC B, Sub B, Vil C",Org X Cat B,user49@orgx,user49,[email protected],+919876543210,English,yes,no,,no,U49
"PHC B, Sub C, Vil C",Org X Cat B,user49@orgx,user49,[email protected],+919876543210,English,yes,no,,no,U49
"PHC C, Sub C, Vil C",Org X Cat B,user49@orgx,user49,[email protected],+919876543210,English,yes,no,,no,U49
"PHC B, Sub C, Vil C",Org X Cat C,user69@orgx,user69,[email protected],+919876543210,English,no,yes,spinner,no,U69
"PHC C, Sub C, Vil C",Org X Cat C,user69@orgx,user69,[email protected],+919876543210,English,no,yes,spinner,no,U69
1 change: 1 addition & 0 deletions public/documentation/toolTip.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
"APP_DESIGNER_GROUP_TEXT_COLOUR": "Text colour for the name of the group",
"APP_DESIGNER_GROUP_BACKGROUND_COLOUR": "Background colour for the name of the group",
"ADMIN_USER_SETTINGS_TRACK_LOCATION": "Switches on visit location tracking on the Field App",
"ADMIN_USER_SETTINGS_IS_ALLOWED_TO_INVOKE_TOKEN_GENERATION_API": "Allows user to invoke token generation API",
"ADMIN_USER_SETTINGS_HIDE_EXIT": "Removes the Exit button on the Field App",
"ADMIN_USER_SETTINGS_HIDE_ENROL": "Hides the Enrol button on the Field App",
"ADMIN_USER_SETTINGS_HIDE_REGISTER": "Hides the Register button on the Field App",
Expand Down
9 changes: 9 additions & 0 deletions src/adminApp/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ export const UserDetail = ({ user, hasEditUserPrivilege, ...props }) => {
label="Track Location"
render={user => (!isNil(user.settings) ? (user.settings.trackLocation ? "True" : "False") : "")}
/>
<FunctionField
label="Is Allowed To Invoke Token Generation API"
render={user => (!isNil(user.settings) ? (user.settings.isAllowedToInvokeTokenGenerationAPI ? "True" : "False") : "")}
/>
<FunctionField
label="Beneficiary Mode"
render={user => (!isNil(user.settings) ? (user.settings.showBeneficiaryMode ? "True" : "False") : "")}
Expand Down Expand Up @@ -540,6 +544,11 @@ const UserForm = ({ edit, nameSuffix, organisation, ...props }) => {
</ToolTipContainer>
<SelectInput source="settings.locale" label="Preferred Language" choices={languages} />
<AvniBooleanInput source="settings.trackLocation" label="Track location" toolTipKey={"ADMIN_USER_SETTINGS_TRACK_LOCATION"} />
<AvniBooleanInput
source="settings.isAllowedToInvokeTokenGenerationAPI"
label="Is Allowed To Invoke Token Generation API"
toolTipKey={"ADMIN_USER_SETTINGS_IS_ALLOWED_TO_INVOKE_TOKEN_GENERATION_API"}
/>
<AvniBooleanInput
source="settings.showBeneficiaryMode"
label="Beneficiary mode"
Expand Down
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
"giveLocationPermissionFromSettings": "Please give location permission to OpenCHS from Settings > Apps > OpenCHS",
"location": "Location",
"trackLocation": "Track Location",
"isAllowedToInvokeTokenGenerationAPI": "Is Allowed To Invoke Token Generation API",
"visitsBeingScheduled": "Visits Being Scheduled",
"visitName": "Visit Name",
"schedulingFor": "Scheduling For",
Expand Down
1 change: 1 addition & 0 deletions translations/ka_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
"giveLocationPermissionFromSettings": "ಸೆಟ್ಟಿಂಗ್‌ಗಳು > ಅಪ್ಲಿಕೇಶನ್‌ಗಳು > ಓಪನ್‌ಎಚ್‌ಎಸ್‌ನಿಂದ ಓಪನ್‌ಎಚ್‌ಎಸ್‌ಗೆ ದಯವಿಟ್ಟು ಸ್ಥಳ ಅನುಮತಿ ನೀಡಿ",
"location": "ಸ್ಥಳ",
"trackLocation": "ಸ್ಥಳವನ್ನು ಪತ್ತೆ ಮಾಡಿ",
"isAllowedToInvokeTokenGenerationAPI": "ಟೋಕನ್ ಜನರೇಷನ್ ಅನ್ನು ಅನುಮತಿಸಲಾಗಿದೆ",
"visitsBeingScheduled": "ನಿಗದಿತ ಭೇಟಿಗಳು",
"visitName": "ಭೇಟಿ ಹೆಸರು",
"schedulingFor": "ಇದಕ್ಕಾಗಿ ವೇಳಾಪಟ್ಟಿ",
Expand Down
1 change: 1 addition & 0 deletions translations/mr_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
"Videos": "व्हिडिओ",
"location": "ठिकाण",
"trackLocation": "ठिकाणाचा शोध",
"isAllowedToInvokeTokenGenerationAPI": "टोकन निर्मितीला परवानगी आहे",
"summary": "गोषवारा / सारांश",
"visitsPlanned": "नियोजित भेटी",
"enrolmentDetails": "नावनोंदणी बाबत माहिती",
Expand Down
1 change: 1 addition & 0 deletions translations/ta_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
"giveLocationPermissionFromSettings": "செயலி > OpenCHS > OpenCHS அமைப்பிலிருந்து இருப்பிட அனுமதி வழங்கவும்",
"location": "இடம்",
"trackLocation": "இருப்பிட கண்காணிப்பு",
"isAllowedToInvokeTokenGenerationAPI": "டோக்கன் உருவாக்கம் அனுமதிக்கப்படுகிறது",
"visitsBeingScheduled": "சந்திப்பு திட்டமிடப்பட்டுள்ளது",
"visitName": "சந்திப்பின் நோக்கம் ",
"schedulingFor": "திட்டமிடல்",
Expand Down

0 comments on commit 4b3220c

Please sign in to comment.