-
Notifications
You must be signed in to change notification settings - Fork 7
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
tweak(adminPanel): RN-1419: Don't delete survey screens and components on import unless they have changed #5885
Conversation
@@ -23,10 +23,16 @@ import { | |||
SURVEY_METADATA, | |||
} from './processSurveyMetadata'; | |||
import { caseAndSpaceInsensitiveEquals, convertCellToJson } from './utilities'; | |||
import { RECORDS } from '@tupaia/database'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { RECORDS } from '@tupaia/database'; |
const objectsAreEqual = (a, b) => { | ||
if (!!a === !!b) return true; | ||
return JSON.stringify(a) === JSON.stringify(b); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this function is always going to be correct. I would probably just outsource this to lodash isEqual here since we need to do a deep equality check?! Or if you update the function it would probably be good to add a unit test for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything it looking good apart from the object equality check
merge: update branch with latest dev
* mobile survey header * custom icons * Update SurveyMobilePaginator.tsx * wip * fix(tupaiaWeb): RN-1512: Fix broken arithmetic visuals (#5980) Update utils.ts * survey select page * country selector * side menu * db(entityTypes): MAUI-4763: Add new entity types (pacmossi_insecticide_test) for PacMOSSI project (#5986) * pacmossi_insecticide_test entity type * schema and model update * copy and share * header style * Update dataTables.js * sticky header * tweak styles * style tweaks * Update ResultsList.tsx * refactor list * select list * mobile menu * toast styles * fix(datatrak): RN-1450: Fix mobile tooltips (#5971) * Update Tooltip.tsx * set delay on BaseTooltip --------- Co-authored-by: Andrew <[email protected]> * Update index.ts * tweaks * pr suggestions * Update CancelConfirmModal.tsx * tweak(datatrak): RN-1451: DataTrak request country access form (#6000) Update RequestCountryAccessForm.tsx * tweak(adminPanel): RN-1419: Don't delete survey screens and components on import unless they have changed (#5885) * Working check * Handle object equality with stringify * Fix object equality check * Remove console log --------- Co-authored-by: Andrew <[email protected]> * Update SurveyDisplayName.tsx --------- Co-authored-by: Salman <[email protected]> Co-authored-by: Andrew <[email protected]> Co-authored-by: alexd-bes <[email protected]>
Issue RN-1419: Don't delete survey screens and components on import unless they have changed
Changes:
importSurveyQuestions
to only update relevant fields in the survey screen component