Merge branch '20493-optional-array' refs #20493 2.6.2
authorPeter Amstutz <peter.amstutz@curii.com>
Thu, 11 May 2023 18:50:11 +0000 (14:50 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Thu, 11 May 2023 18:50:11 +0000 (14:50 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

src/store/data-explorer/data-explorer-reducer.ts
src/store/store.ts
src/views-components/sharing-dialog/sharing-dialog-component.tsx
src/views-components/sharing-dialog/sharing-invitation-form.tsx
src/views-components/sharing-dialog/sharing-public-access-form-component.tsx
yarn.lock

index e93d291d5dcaed367ca8c07d5e2c596fd4e06b01..a0a7eb6400b1160f0702d2e4243b94912c85bfa1 100644 (file)
@@ -70,14 +70,24 @@ export const dataExplorerReducer = (
         SET_FILTERS: ({ id, columnName, filters }) =>
             update(state, id, mapColumns(setFilters(columnName, filters))),
 
-        SET_ITEMS: ({ id, items, itemsAvailable, page, rowsPerPage }) =>
-            update(state, id, (explorer) => ({
-                ...explorer,
-                items,
-                itemsAvailable,
-                page: page || 0,
-                rowsPerPage,
-            })),
+        SET_ITEMS: ({ id, items, itemsAvailable, page, rowsPerPage }) => (
+            update(state, id, (explorer) => {
+                // Reject updates to pages other than current,
+                //  DataExplorer middleware should retry
+                const updatedPage = page || 0;
+                if (explorer.page === updatedPage) {
+                    return {
+                        ...explorer,
+                        items,
+                        itemsAvailable,
+                        page: updatedPage,
+                        rowsPerPage,
+                    }
+                } else {
+                    return explorer;
+                }
+            })
+        ),
 
         APPEND_ITEMS: ({ id, items, itemsAvailable, page, rowsPerPage }) =>
             update(state, id, (explorer) => ({
index ec673d62239c49170ce2c0f8bbc06a270f15ca00..913207c35769ddb6cb39608be5f6b988d0bb7499 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { createStore, applyMiddleware, compose, Middleware, combineReducers, Store, Action, Dispatch } from 'redux';
+import { createStore, applyMiddleware, Middleware, combineReducers, Store, Action, Dispatch } from 'redux';
 import { routerMiddleware, routerReducer } from "react-router-redux";
 import thunkMiddleware from 'redux-thunk';
 import { History } from "history";
index df232724c55e8ac6573ef530cc4963ef2f1de3f7..f83cec60f24ec2662a73b10fdb3764e7f332c324 100644 (file)
@@ -16,7 +16,6 @@ import {
     Checkbox,
     FormControlLabel,
     Typography,
-    Tooltip,
 } from '@material-ui/core';
 import {
     StyleRulesCallback,
@@ -40,7 +39,6 @@ import {
 import DateFnsUtils from "@date-io/date-fns";
 import moment from 'moment';
 import { SharingPublicAccessForm } from './sharing-public-access-form';
-import { AddIcon } from 'components/icon/icon';
 
 export interface SharingDialogDataProps {
     open: boolean;
@@ -66,7 +64,7 @@ export type SharingDialogComponentProps = SharingDialogDataProps & SharingDialog
 
 export default (props: SharingDialogComponentProps) => {
     const { open, loading, saveEnabled, sharedResourceUuid,
-        sharingURLsNr, privateAccess, sharingURLsDisabled, permissions,
+        sharingURLsNr, privateAccess, sharingURLsDisabled,
         onClose, onSave, onCreateSharingToken, refreshPermissions } = props;
     const showTabs = !sharingURLsDisabled && extractUuidObjectType(sharedResourceUuid) === ResourceObjectType.COLLECTION;
     const [tabNr, setTabNr] = React.useState<number>(SharingDialogTab.PERMISSIONS);
index 702add91ad5641cf00241ce4f9401aaed3534027..33154732256233fa7d81838879567027894f0bab 100644 (file)
@@ -3,12 +3,9 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { reduxForm } from 'redux-form';
-import { connect } from 'react-redux';
-import { compose } from 'redux';
 import SharingInvitationFormComponent from './sharing-invitation-form-component';
 import { SHARING_INVITATION_FORM_NAME } from 'store/sharing-dialog/sharing-dialog-types';
 import { PermissionLevel } from 'models/permission';
-import { WithStyles } from '@material-ui/core/styles';
 
 interface InvitationFormData {
     permissions: PermissionLevel;
index 03885a439d13c05587faac8bf088607367254efe..5fc3f4e38ecce5a0ac7adb24568ea16b5e956e2e 100644 (file)
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import React from 'react';
-import { Grid, StyleRulesCallback, Divider, Typography } from '@material-ui/core';
+import { Grid, StyleRulesCallback, Typography } from '@material-ui/core';
 import { Field, WrappedFieldProps } from 'redux-form';
 import { WithStyles } from '@material-ui/core/styles';
 import withStyles from '@material-ui/core/styles/withStyles';
index e96e7751cd45de415b7a6bb7b7b5413d315c333f..20bbc46bfe1859e4b9321b024538c6ef84036c15 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -4988,9 +4988,9 @@ __metadata:
   linkType: hard
 
 "caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30000981, caniuse-lite@npm:^1.0.30001035, caniuse-lite@npm:^1.0.30001109, caniuse-lite@npm:^1.0.30001219":
-  version: 1.0.30001414
-  resolution: "caniuse-lite@npm:1.0.30001414"
-  checksum: 97210cfd15ded093b20c33d35bef9711a88402c3345411dad420c991a41a3e38ad17fd66721e8334c86e9b2e4aa2c1851d3631f1441afb73b92d93b2b8ca890d
+  version: 1.0.30001486
+  resolution: "caniuse-lite@npm:1.0.30001486"
+  checksum: 5e8c2ba2679e4ad17dea6d2761a6449b814441bfeac81af6cc9d58af187df6af4b79b27befcbfc4a557e720b21c0399a7d1911c8705922e38938dcc0f40b5d4b
   languageName: node
   linkType: hard