[ARVADOS-WORKBENCH2] updated: 1.1.4-693-g1598742
Git user
git at public.curoverse.com
Mon Aug 20 11:41:48 EDT 2018
Summary of changes:
src/views-components/move-to-dialog/move-to-dialog.tsx | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
via 15987424ea63c887e3ec5f8a1c42cc985301b884 (commit)
from 8c0a8c26b37118e6e516da2cfaa19b26b8f1e5eb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 15987424ea63c887e3ec5f8a1c42cc985301b884
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Aug 20 17:41:33 2018 +0200
Add sameUuid validation
Feature #13831
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/views-components/move-to-dialog/move-to-dialog.tsx b/src/views-components/move-to-dialog/move-to-dialog.tsx
index d7c66bc..e45bc22 100644
--- a/src/views-components/move-to-dialog/move-to-dialog.tsx
+++ b/src/views-components/move-to-dialog/move-to-dialog.tsx
@@ -10,13 +10,13 @@ import { reduxForm, startSubmit, stopSubmit, InjectedFormProps, initialize, Fiel
import { WithDialogProps } from '~/store/dialog/with-dialog';
import { FormDialog } from '~/components/form-dialog/form-dialog';
import { ProjectTreePicker } from '~/views-components/project-tree-picker/project-tree-picker';
-import { MOVE_TO_VALIDATION } from '~/validators/validators';
import { Typography } from "@material-ui/core";
import { ResourceKind } from '~/models/resource';
import { ServiceRepository, getResourceService } from '~/services/services';
import { RootState } from '~/store/store';
import { getCommonResourceServiceError, CommonResourceServiceError } from "~/common/api/common-resource-service";
import { snackbarActions } from '../../store/snackbar/snackbar-actions';
+import { require } from '~/validators/require';
export const MOVE_TO_DIALOG = 'moveToDialog';
@@ -71,12 +71,16 @@ export const MoveToProjectDialog = compose(
{...props}
/>);
-const MoveToDialogFields = () =>
+const MoveToDialogFields = (props: InjectedFormProps<MoveToDialogResource>) =>
<Field
name="ownerUuid"
component={Picker}
- validate={MOVE_TO_VALIDATION} />;
+ validate={validation} />;
+const sameUuid = (value: string, allValues: MoveToDialogResource) =>
+ value === allValues.uuid && 'Cannot move the project to itself';
+
+const validation = [require, sameUuid];
const Picker = (props: WrappedFieldProps) =>
<div style={{ height: '144px', display: 'flex', flexDirection: 'column' }}>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list