-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dataTrak): RN-1274: Keep 'outdated' historical survey responses …
…when resubmitting (#5758) * RN-1274: change route to `surveyResponses/:id/resubmit` * RN-1274: Reworked ResubmitSurveyResponse route to create a new response and outdate the previous one * RN-1274: Added resubmitSurveyResponse to the CentralApi * RN-1274: Added ResubmitSurveyResponseRoute to datatrak-web-server * RN-1274: Reworked survey response resubmission in datatrak to use the new backend routes * Fix tests * Edit survey response metadata * Fix tests * Edit survey response metadata * Resubmit survey response with original data time and user ID * PR fixes * take 1 * feat(adminPanel): RN-1228: Link surveys to Datatrak Web (#5671) * Make links * Use projectId * Update user preferences if project id is in url * Add comment * Allow country codes to be fetched for surveys * Link directly to survey * Default to DL and alphabetise the country codes * Change tooltip text * Update copy * Hide button for surveys with no countries --------- Co-authored-by: Andrew <vanbeekandrew@gmail.com> * Fix dataTime timezone change * Allow file questions to be viewed and changed * feat(tupaiaWeb): RN-1367: Multiphotograph viz captions + restyle (#5769) * Add `label` property to view data * Preview display * Display max 3 * WIP carousel * WIP * Working thumbnails * Working carousel * WiP * Styling * Add comments * Update schemas.ts * Adjust height and alignment * Make images contained * Fix responsive issue --------- Co-authored-by: Andrew <vanbeekandrew@gmail.com> * Fix issue * Fix date of data * Add outdated column to survey responses in admin panel * Reset entity question values when filter questions change * fix(datatrakWeb): Fix country code selector in reports export * fix(adminPanel): RN-1375: update 'Add' project editor for consistency (#5816) update editor column for consistency * Handle existing file answers * Use existing entity id if present * Add pill styling for response status field * Handle file names * Change pill colours around * Handle survey response file names * Don't save file url in answer * Fix tests * Don't default dates on resubmit * Handle when photo answer is a url * Allow `null` default date for resubmission * Save previous metadata on tracked entity * Fix undefined models error * Update project.pbxproj * Hide survey resubmit button for outdated responses * tweak(tupaiaWeb): RN-1394: Update tool tip for visualisation export (#5824) Tool tip update * tweak(adminPanel): RN-1399: Update icon and color as per Figma layouts (#5825) Download Icon update * tweak(adminPanel): RN-1274: Remove outdated survey responses and associated answers from DHIS via sync queue (#5827) * Remove outdated survey responses and associated answers from dhis via sync queue * Add tests * Add answers back into queue when survey response is changed back to current * Handle answers for outdated->current tests * Fix tests * Revert change to filter * Ignore outdated surveys from exports * Code question should be code generator type * Fix tests * Fix timezone issues * Update processSurveyResponse.test.ts * Get all answers for survey response * Handle when photo includes a url * Fix tests * Fix crashing error * Concert jpeg to jpg * Keep existing survey response timezone * fix(tupaiaWeb): RN-1414: Fix dashboard item permission error (#5836) Update ReportPermissionsChecker.js * Timezones * fix(adminPanel): RN-1289: update the entity associated with a survey resubmission (#5817) * Initial update * test updates * Update importSurveyResponses.js * Update importSurveyResponses.js * Update importSurveyResponses.js * Update SurveyResponseUpdatePersistor.js * Delete ~$nonPeriodicUpdates.xlsx * test updates * review comments * review updates * addition of tests --------- Co-authored-by: Andrew <vanbeekandrew@gmail.com> * Convert data_time to timezone date on server * Fix tests * Make dates/times zoneless so that they appear the same to everyone * Fix tests * Fix timezone offsets * Handle timezones with DST * Fixes --------- Co-authored-by: alexd-bes <129009580+alexd-bes@users.noreply.github.com> Co-authored-by: Salman <114740396+hrazasalman@users.noreply.github.com> Co-authored-by: Andrew <vanbeekandrew@gmail.com> Co-authored-by: Tom Caiger <caigertom@gmail.com>
- Loading branch information
1 parent
79212bf
commit a193aec
Showing
89 changed files
with
1,722 additions
and
804 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/admin-panel/src/table/columnTypes/ExternalLinkButton.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Tupaia | ||
* Copyright (c) 2017 - 2024 Beyond Essential Systems Pty Ltd | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Link } from '@material-ui/core'; | ||
import { OpenInNewRounded } from '@material-ui/icons'; | ||
import { ColumnActionButton } from './ColumnActionButton'; | ||
import { makeSubstitutionsInString } from '../../utilities'; | ||
|
||
export const ExternalLinkButton = ({ actionConfig, row }) => { | ||
const getUrl = () => { | ||
if (actionConfig.generateUrl) { | ||
return actionConfig.generateUrl(row.original); | ||
} | ||
return makeSubstitutionsInString(actionConfig.url, row.original); | ||
}; | ||
const fullUrl = getUrl(); | ||
if (!fullUrl) return null; | ||
|
||
return ( | ||
<ColumnActionButton | ||
className="link-button" | ||
title={actionConfig.title} | ||
component={Link} | ||
href={fullUrl} | ||
target="_blank" | ||
> | ||
<OpenInNewRounded /> | ||
</ColumnActionButton> | ||
); | ||
}; | ||
|
||
ExternalLinkButton.propTypes = { | ||
actionConfig: PropTypes.object.isRequired, | ||
row: PropTypes.object.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.