Skip to content

Commit

Permalink
Merge branch '7.0' into 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
petmongrels committed Mar 4, 2024
2 parents 5d09e6a + da28730 commit 4f08871
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ endif
define _create_config
@echo "Creating config for $1"
@if [ $(1) = "prod" ]; then \
echo "module.exports = Object.assign(require('../../config/env/$(1).json'), {COMMIT_ID: '$(sha)', SERVER_URL: '$(flavor_server_url)', DISABLE_APP_RUN_ON_ROOTED_DEVICES: '$(flavor_disable_app_run_on_rooted_devices)'});" > packages/openchs-android/src/framework/Config.js; \
echo "module.exports = Object.assign(require('../../config/env/$(1).json'), {COMMIT_ID: '$(sha)', SERVER_URL: '$(flavor_server_url)', DISABLE_APP_RUN_ON_ROOTED_DEVICES: $(flavor_disable_app_run_on_rooted_devices)});" > packages/openchs-android/src/framework/Config.js; \
else \
echo "module.exports = Object.assign(require('../../config/env/$(1).json'), {COMMIT_ID: '$(sha)'});" > packages/openchs-android/src/framework/Config.js; \
fi
Expand Down Expand Up @@ -445,7 +445,7 @@ auth_live:
make get-token server=$(flavor_server_url) port=443 username=admin password=$$$(prod_admin_password_env_var_name)

upload = \
curl -X POST $(server):$(port)/$(1) -d $(2) \
curl -f -X POST $(server):$(port)/$(1) -d $(2) \
-H "Content-Type: application/json" \
-H "USER-NAME: admin" \
-H "AUTH-TOKEN: $(token)"
Expand Down
7 changes: 6 additions & 1 deletion packages/openchs-android/src/action/LandingViewActions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import _ from 'lodash'
import CustomDashboardService from '../service/customDashboard/CustomDashboardService';

class LandingViewActions {
static getInitialState() {
return {
renderCustomDashboard: false,
dummy: false,
home: false,
search: false,
Expand All @@ -25,14 +27,17 @@ class LandingViewActions {
}
}

static onLoad(state, action) {
static onLoad(state, action, context) {
const newState = LandingViewActions.reset(state);
const syncRequired = _.isNil(action.syncRequired) ? true : action.syncRequired;
const customDashboardService = context.get(CustomDashboardService);
const renderCustomDashboard = customDashboardService.isCustomDashboardMarkedPrimary();
return {
...newState,
dummy: !state.dummy,
home: true,
syncRequired,
renderCustomDashboard,
previouslySelectedSubjectTypeUUID: action.cachedSubjectTypeUUID || newState.previouslySelectedSubjectTypeUUID,
};
}
Expand Down
14 changes: 10 additions & 4 deletions packages/openchs-android/src/service/SyncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {LandingViewActionsNames as LandingViewActions} from '../action/LandingVi
import {MyDashboardActionNames} from '../action/mydashboard/MyDashboardActions';
import {CustomDashboardActionNames} from '../action/customDashboard/CustomDashboardActions';
import LocalCacheService from "./LocalCacheService";
import CustomDashboardService from './customDashboard/CustomDashboardService';

function transformResourceToEntity(entityMetaData, entityResources) {
return (acc, resource) => {
Expand Down Expand Up @@ -402,13 +403,18 @@ class SyncService extends BaseService {
this.context.getService(PrivilegeService).deleteRevokedEntities(); //Invoking this in MenuView.deleteData as well

this.dispatchAction(IndividualSearchActions.ON_LOAD);
this.dispatchAction(MyDashboardActionNames.ON_LOAD);
LocalCacheService.getPreviouslySelectedSubjectTypeUuid().then(cachedSubjectTypeUUID => {
this.dispatchAction(LandingViewActions.ON_LOAD, {syncRequired, cachedSubjectTypeUUID});
});
this.dispatchAction(CustomDashboardActionNames.ON_LOAD, {onlyPrimary: false});
this.dispatchAction(CustomDashboardActionNames.REMOVE_OLDER_COUNTS);
setTimeout(() => this.dispatchAction(CustomDashboardActionNames.REFRESH_COUNT), 500);
const customDashboardService = this.context.getService(CustomDashboardService);
const renderCustomDashboard = customDashboardService.isCustomDashboardMarkedPrimary();
if(!renderCustomDashboard) {
this.dispatchAction(MyDashboardActionNames.ON_LOAD);
} else {
this.dispatchAction(CustomDashboardActionNames.ON_LOAD, {onlyPrimary: false});
this.dispatchAction(CustomDashboardActionNames.REMOVE_OLDER_COUNTS);
setTimeout(() => this.dispatchAction(CustomDashboardActionNames.REFRESH_COUNT), 500);
}
}
}

Expand Down
6 changes: 2 additions & 4 deletions packages/openchs-android/src/views/LandingView.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import EntypoIcon from "react-native-vector-icons/Entypo";
import PrivilegeService from "../service/PrivilegeService";
import CustomFilterService from "../service/CustomFilterService";
import CustomDashboardView from "./customDashboard/CustomDashboardView";
import CustomDashboardService from "../service/customDashboard/CustomDashboardService";
import NewsService from "../service/news/NewsService";
import {CustomDashboardActionNames} from "../action/customDashboard/CustomDashboardActions";
import LocalCacheService from '../service/LocalCacheService';
Expand Down Expand Up @@ -58,7 +57,7 @@ class LandingView extends AbstractComponent {
}

didFocus() {
this.refreshCustomDashboardsCounts();
this.state.renderCustomDashboard && this.refreshCustomDashboardsCounts();
}

refreshCustomDashboardsCounts() {
Expand Down Expand Up @@ -121,8 +120,7 @@ class LandingView extends AbstractComponent {
}

renderDashboard(startSync) {
const renderCustomDashboard = this.getService(CustomDashboardService).isCustomDashboardMarkedPrimary();
return renderCustomDashboard ? this.renderCustomDashboard(startSync) : this.renderDefaultDashboard(startSync);
return this.state.renderCustomDashboard ? this.renderCustomDashboard(startSync) : this.renderDefaultDashboard(startSync);
}

render() {
Expand Down
2 changes: 1 addition & 1 deletion packages/openchs-android/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@
"enterNewPasswordFor": "Enter new password for {{userName}}",
"backgroundSyncInProgress": "Auto sync is in progress. Please try again after sometime.",
"queryExecutionError": "Query rule execution error",
"nestedReportCardsCountMismatch": "Configured number of cards don't match with the number of cards in the rule"
"nestedReportCardsCountMismatch": "Configured number of cards don't match with the number of cards in the rule",
"addressFilterBehaviorHint": "(Choose exact level at which subject is registered)",
"addressFilterImplicitBehaviorHint": "(Selection includes lower levels implicitly)",
"copyErrorTryAgain": "Copy Error & Try Again",
Expand Down
2 changes: 1 addition & 1 deletion packages/openchs-android/translations/gu_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
"autoSync": "સ્વતઃ સમન્વયન",
"addressFilterBehaviorHint": "(યોગ્ય સ્તર પસંદ કરો કે જેમાં વિષય નોંધાયેલ છે)",
"queryExecutionError" : "નિયમ અમલમાં ભૂલ",
"nestedReportCardsCountMismatch" : "કાર્ડની રૂપરેખાંકિત સંખ્યા નિયમમાંના કાર્ડની સંખ્યા સાથે મેળ ખાતી નથી"
"nestedReportCardsCountMismatch" : "કાર્ડની રૂપરેખાંકિત સંખ્યા નિયમમાંના કાર્ડની સંખ્યા સાથે મેળ ખાતી નથી",
"addressFilterImplicitBehaviorHint": "(પસંદગીમાં નિમ્ન સ્તરનો ગર્ભિત સમાવેશ થાય છે)",
"copyErrorTryAgain": "કોપી ભૂલ કરો અને ફરીથી પ્રયાસ કરો",
"copyErrorAndCancel": "કોપી ભૂલ અને રદ કરો"
Expand Down
2 changes: 1 addition & 1 deletion packages/openchs-android/translations/hi_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
"backgroundSyncInProgress": "ऑटो सिंक प्रगति पर है| कृपया कुछ देर बाद प्रयास करें।",
"addressFilterBehaviorHint": "(वही लोकेशन जहाँ सब्जेक्ट रजिस्टर्ड है)",
"queryExecutionError" : "नियम निष्पादन त्रुटि",
"nestedReportCardsCountMismatch" : "कार्डों की कॉन्फ़िगर की गई संख्या नियम में कार्डों की संख्या से मेल नहीं खाती"
"nestedReportCardsCountMismatch" : "कार्डों की कॉन्फ़िगर की गई संख्या नियम में कार्डों की संख्या से मेल नहीं खाती",
"addressFilterImplicitBehaviorHint": "(चयन में निचले स्तर परोक्ष रूप से शामिल हैं)",
"copyErrorTryAgain": "त्रुटि कॉपी करें और पुनः प्रयास करें",
"copyErrorAndCancel": "त्रुटि कॉपी करें और रद्द करें"
Expand Down
2 changes: 1 addition & 1 deletion packages/openchs-android/translations/ka_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
"autoSync": "ಸ್ವಯಂ ಸಿಂಕ್",
"addressFilterBehaviorHint": "(ಯಾವ ವಿಷಯವನ್ನು ನೋಂದಾಯಿಸಲಾಗಿದೆ ಎಂಬುದನ್ನು ನಿಖರವಾದ ಮಟ್ಟವನ್ನು ಆರಿಸಿ)",
"queryExecutionError" : "ನಿಯಮ ಕಾರ್ಯಗತಗೊಳಿಸುವಲ್ಲಿ ವಿಫಲವಾಗಿದೆ",
"nestedReportCardsCountMismatch" : "ಕಾರ್ಡ್ಗಳ ಸಂಖ್ಯೆ ಹೊಂದಿಕೆಯಾಗುವುದಿಲ್ಲ"
"nestedReportCardsCountMismatch" : "ಕಾರ್ಡ್ಗಳ ಸಂಖ್ಯೆ ಹೊಂದಿಕೆಯಾಗುವುದಿಲ್ಲ",
"addressFilterImplicitBehaviorHint": "(ಆಯ್ಕೆಯು ಕೆಳ ಹಂತಗಳನ್ನು ಸೂಚ್ಯವಾಗಿ ಒಳಗೊಂಡಿರುತ್ತದೆ)",
"copyErrorTryAgain": "ನಕಲು ದೋಷ ಮತ್ತು ಮತ್ತೆ ಪ್ರಯತ್ನಿಸಿ",
"copyErrorAndCancel": "ನಕಲು ದೋಷ ಮತ್ತು ರದ್ದುಗೊಳಿಸು"
Expand Down
4 changes: 2 additions & 2 deletions packages/openchs-android/translations/mr_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@
"disableAutoSync": "ऑटो सिंक अक्षम करा",
"autoSync": "ऑटो सिंक",
"addressFilterBehaviorHint": "(कोणत्या विषयावर नोंदणी केली आहे ते अचूक स्तर निवडा)",
"queryExecutionError" : "नियम अंमलबजावणी त्रुटी",
"nestedReportCardsCountMismatch" : "कॉन्फिगर केलेली कार्डची संख्या नियमातील कार्डांच्या संख्येशी जुळत नाही"
"queryExecutionError": "नियम अंमलबजावणी त्रुटी",
"nestedReportCardsCountMismatch": "कॉन्फिगर केलेली कार्डची संख्या नियमातील कार्डांच्या संख्येशी जुळत नाही",
"addressFilterImplicitBehaviorHint": "(निवडीत खालच्या स्तरांचा समावेश होतो)",
"copyErrorTryAgain": "एरर कॉपी करा आणि पुन्हा प्रयत्न करा",
"copyErrorAndCancel": "एरर कॉपी करा आणि रद्द करा"
Expand Down
4 changes: 2 additions & 2 deletions packages/openchs-android/translations/ta_IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@
"disableAutoSync": "தானியங்கு ஒத்திசைவை முடக்கு",
"autoSync": "தானியங்கு ஒத்திசைவு",
"addressFilterBehaviorHint": "(எந்த பாடத்தில் பதிவு செய்யப்பட்டுள்ளது என்பதை சரியான அளவில் தேர்வு செய்யவும்)",
"queryExecutionError" : "விதியை செயல்படுத்துவதில் பிழை",
"nestedReportCardsCountMismatch" : "கார்டுகளின் எண்ணிக்கை பொருந்தவில்லை"
"queryExecutionError": "விதியை செயல்படுத்துவதில் பிழை",
"nestedReportCardsCountMismatch": "கார்டுகளின் எண்ணிக்கை பொருந்தவில்லை",
"addressFilterImplicitBehaviorHint": "(தேர்வு என்பது கீழ்நிலைகளை மறைமுகமாக உள்ளடக்கியது)",
"copyErrorTryAgain": "பிழையை நகலெடுத்து மீண்டும் முயற்சிக்கவும்",
"copyErrorAndCancel": "நகல் பிழை & ரத்துசெய்"
Expand Down

0 comments on commit 4f08871

Please sign in to comment.