Skip to content

Commit f34912e

Browse files
jake-lowjschwarz2030CollinBeczak
authored
Upgrade to React Table v7 (#2594)
* Port Sent page to use React Table v7 * Port Inbox page to React Table v7 * Port TaskAnalysisTable to React Table v7 * Port TaskReviewTable to React Table v7 * Port super-admin MetricsTable to React Table v7 * Delete unused components and CSS after upgrading to React Table v7 * Fix bug causing Review widget to fail after page refresh * Fix unit tests * Add row dividers and left-align col headers in TaskReviewTable * Fix positioning of bundle icon in review and analysis tables * Fix pagination for Inbox view * fix sent page table format for v7 * add full width to taskreviewtable * format * Re-add configurable columns to TaskReviewTable * Fix feature id column not displaying in TaskAnalysisTable * Port Sent page to use React Table v7 * Port Inbox page to React Table v7 * Port TaskAnalysisTable to React Table v7 * Port TaskReviewTable to React Table v7 * Port super-admin MetricsTable to React Table v7 * Delete unused components and CSS after upgrading to React Table v7 * Fix bug causing Review widget to fail after page refresh * Fix unit tests * Add row dividers and left-align col headers in TaskReviewTable * Fix positioning of bundle icon in review and analysis tables * Fix pagination for Inbox view * fix sent page table format for v7 * add full width to taskreviewtable * format * Re-add configurable columns to TaskReviewTable * Fix feature id column not displaying in TaskAnalysisTable * fix sorting and clearing filters * disable some column sorts and add filter search * Fix filters for TaskAnalysisTable on initial load * yarn run format * disable sort remove (3rd click); just alternate between asc and desc * fix tests * Fix row expand in task analysis table * Fix filter initial state not being respected in tasks review table * fix width of table and filters * fix column resizing * finish enhancements to taskanalysis table * refactor dependencies in TaskAnalysisTable to improve memoization and performance * enhance TaskAnalysisTable styling and improve cell height for better layout consistency * formatting * fix filtering again * fix sent comments table * fix inbox styles * save * consolidate code * upgrade react-datepicker to version 8.3.0 and refactor table components to use EnhancedTable for improved styling and functionality * refactor table components to utilize TableWrapper and shared styles for improved consistency and maintainability across various tables * reorder import statements in EnhancedTable for improved readability and consistency * fix checks * refactor filter components to include clear button for resetting filters and improve styling consistency across various tables * fix tests by reverting date picker dependency upgrade * fix table updates when task bundle changes * fix some styles * add debounce functionality * fix task selection on create and manage page --------- Co-authored-by: Jimmy <jschwarz2030@gmail.com> Co-authored-by: CollinBeczak <ctbeczak08@gmail.com>
1 parent d31deea commit f34912e

37 files changed

Lines changed: 3139 additions & 2922 deletions

lang/en-US.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -906,16 +906,13 @@
906906
"Inbox.tableHeaders.fromUsername": "From",
907907
"Inbox.tableHeaders.notificationType": "Type",
908908
"Inbox.teamNotification.invited.lead": "You've been invited to join a team!",
909-
"IntlTable.jumpToPage.label": "jump to page",
910-
"IntlTable.loading.label": "Loading...",
909+
"IntlTable.first.label": "First",
910+
"IntlTable.last.label": "Last",
911911
"IntlTable.next.label": "Next",
912-
"IntlTable.noData": "No rows found",
913912
"IntlTable.of": "of",
914913
"IntlTable.page.label": "Page",
915914
"IntlTable.previous.label": "Previous",
916-
"IntlTable.rows": "rows",
917-
"IntlTable.rowsPerPage.label": "rows per page",
918-
"IntlTable.total.label": "Total: ",
915+
"IntlTable.showNumberPerPage": "Show {number} per page",
919916
"KeyMapping.layers.layerMapillary": "Toggle Mapillary Layer",
920917
"KeyMapping.layers.layerOSMData": "Toggle OSM Data Layer",
921918
"KeyMapping.layers.layerTaskFeatures": "Toggle Features Layer",
@@ -1240,7 +1237,11 @@
12401237
"Task.fields.unbundle.label": "Unbundle",
12411238
"Task.loadByMethod.proximity": "Nearby",
12421239
"Task.loadByMethod.random": "Random",
1240+
"Task.map.osmData.error": "Error Loading OSM Data",
1241+
"Task.map.osmData.tooLarge": "OSM Data Area Too Large",
1242+
"Task.map.osmData.zoomInRequired": "Please zoom in closer to view OSM data for this area",
12431243
"Task.markedAs.label": "Task marked as",
1244+
"Task.osmData.areaTooLarge": "The selected area is too large to load OSM data. Please zoom in further to view OSM features.",
12441245
"Task.pane.controls.browseChallenge.label": "Browse Challenge",
12451246
"Task.pane.controls.copyShareLink.label": "Copy Challenge Share Link",
12461247
"Task.pane.controls.copyVirtualShareLink.label": "Copy Virtual Challenge Share Link",
@@ -1471,6 +1472,7 @@
14711472
"Widgets.TaskHistoryWidget.title": "History",
14721473
"Widgets.TaskLocationWidget.controls.showLatLon.label": "Lat/Lon",
14731474
"Widgets.TaskLocationWidget.controls.showLonLat.label": "Lon/Lat",
1475+
"Widgets.TaskLocationWidget.label": "Location",
14741476
"Widgets.TaskMapWidget.editMode": "Current Mode:",
14751477
"Widgets.TaskMapWidget.rapidDiscardUnsavedChanges": "You have unsaved changes in Rapid which will be discarded. Are you sure you want to proceed?",
14761478
"Widgets.TaskMapWidget.rapidFailed": "Widget Failed! Geometries Null!",
@@ -1489,4 +1491,4 @@
14891491
"Widgets.TeamsWidget.createTeamTitle": "Create New Team",
14901492
"Widgets.TeamsWidget.viewTeamTitle": "Team Details",
14911493
"Widgets.review.simultaneousTasks": "Reviewing {taskCount, number} tasks together"
1492-
}
1494+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"react-router-dom": "^5.2.0",
104104
"react-share": "^4.2.0",
105105
"react-syntax-highlighter": "^15.4.3",
106-
"react-table-6": "^6.11.0",
106+
"react-table": "^7.8.0",
107107
"react-tagsinput": "^3.19.0",
108108
"redux": "^4.1.2",
109109
"redux-thunk": "^2.4.0",

src/components/HOCs/WithFilterCriteria/WithFilterCriteria.jsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const DEFAULT_CRITERIA = {
3131
*
3232
* @author [Kelli Rotstan](https://github.com/krotstan)
3333
*/
34-
export const WithFilterCriteria = function (
34+
export default function WithFilterCriteria(
3535
WrappedComponent,
3636
ignoreURL = true,
3737
ignoreLocked = true,
@@ -365,19 +365,4 @@ export const WithFilterCriteria = function (
365365
);
366366
}
367367
};
368-
};
369-
370-
export default (
371-
WrappedComponent,
372-
ignoreURL,
373-
ignoreLocked,
374-
usePersistedFilters,
375-
savedFilterSettingName,
376-
) =>
377-
WithFilterCriteria(
378-
WrappedComponent,
379-
ignoreURL,
380-
ignoreLocked,
381-
usePersistedFilters,
382-
savedFilterSettingName,
383-
);
368+
}

src/components/HOCs/WithReviewTasks/WithReviewTasks.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,13 @@ export const WithReviewTasks = function (WrappedComponent) {
113113
// update as we receive a second update when we change the URL.
114114
if (_isEqual(props.history.location.search, searchURL) && this.state.loading) {
115115
return;
116-
} else if (!skipURLUpdate) {
116+
}
117+
118+
if (!skipURLUpdate) {
117119
props.history.push({
118120
pathname: props.history.location.pathname,
119121
search: searchURL,
120122
});
121-
return;
122123
}
123124

124125
this.setState({ loading: true, criteria: typedCriteria });
@@ -185,10 +186,10 @@ export const WithReviewTasks = function (WrappedComponent) {
185186
}
186187

187188
componentDidMount() {
188-
const searchParams = this.props.history.location.state;
189+
const searchParams = this.props.history.location.search;
189190
const criteria = buildSearchCriteria(searchParams, this.buildDefaultCriteria(this.props));
190191

191-
let pageSize = searchParams?.pageSize || criteria.pageSize || DEFAULT_PAGE_SIZE;
192+
let pageSize = criteria.pageSize || DEFAULT_PAGE_SIZE;
192193
criteria.pageSize = pageSize;
193194

194195
const stateCriteria = this.state.criteria;

src/components/IntlDatePicker/IntlDatePicker.jsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ export default class IntlDatePicker extends Component {
3535
selected={this.props.selected}
3636
onChange={this.props.onChange}
3737
popperPlacement="bottom"
38-
popperModifiers={{
39-
flip: {
40-
behavior: ["bottom"], // don't allow it to flip to be above
41-
},
42-
preventOverflow: {
43-
enabled: false, // tell it not to try to stay within the view (this prevents the popper from covering the element you clicked)
44-
},
45-
hide: {
46-
enabled: false, // turn off since needs preventOverflow to be enabled
47-
},
48-
}}
4938
{...extraProps}
5039
/>
5140
);

src/components/IntlTable/IntlTable.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/components/IntlTable/IntlTablePagination.jsx

Lines changed: 0 additions & 172 deletions
This file was deleted.

src/components/IntlTable/Messages.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)