17782: Disabling typechecking for some common Field component usage.
[arvados-workbench2.git] / src / views-components / form-fields / project-form-fields.tsx
index dc1e1612aaa92112f9fa4a4f8d4cb7672358c7be..34d7cef711bf94555e3e74689dc1cc86c0849f3b 100644 (file)
@@ -2,15 +2,16 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
+import React from "react";
 import { Field, Validator } from "redux-form";
-import { TextField, RichEditorTextField } from "~/components/text-field/text-field";
-import { PROJECT_NAME_VALIDATION, PROJECT_NAME_VALIDATION_ALLOW_SLASH } from "~/validators/validators";
+import { TextField, RichEditorTextField } from "components/text-field/text-field";
+import { PROJECT_NAME_VALIDATION, PROJECT_NAME_VALIDATION_ALLOW_SLASH } from "validators/validators";
 import { connect } from "react-redux";
-import { RootState } from "~/store/store";
+import { RootState } from "store/store";
 
 interface ProjectNameFieldProps {
     validate: Validator[];
+    label?: string;
 }
 
 // Validation behavior depends on the value of ForwardSlashNameSubstitution.
@@ -30,14 +31,14 @@ export const ProjectNameField = connect(
     })((props: ProjectNameFieldProps) =>
         <span data-cy='name-field'><Field
             name='name'
-            component={TextField}
+            component={TextField as any}
             validate={props.validate}
-            label="Project Name"
+            label={props.label || "Project Name"}
             autoFocus={true} /></span>
     );
 
 export const ProjectDescriptionField = () =>
     <Field
         name='description'
-        component={RichEditorTextField}
+        component={RichEditorTextField as any}
         label="Description - optional" />;