Merge branch 'feat/fix-user-editing' into 'main'

fix issue with editing users without 'name'

Closes #63

See merge request stackspin/dashboard!38
This commit is contained in:
Varac 2022-06-21 11:03:24 +00:00
commit 11e0963169
4 changed files with 19 additions and 6 deletions

View file

@ -1,3 +1,9 @@
# [1.0.1]
## Bug fixes
* Resolve "App access role is not persistent" #63
# [1.0.0] # [1.0.0]
## Bug fixes ## Bug fixes

View file

@ -1,7 +1,7 @@
annotations: annotations:
category: Dashboard category: Dashboard
apiVersion: v2 apiVersion: v2
appVersion: 0.2.4 appVersion: 0.2.5
dependencies: dependencies:
- name: common - name: common
# https://artifacthub.io/packages/helm/bitnami/common # https://artifacthub.io/packages/helm/bitnami/common
@ -23,4 +23,4 @@ name: stackspin-dashboard
sources: sources:
- https://open.greenhost.net/stackspin/dashboard/ - https://open.greenhost.net/stackspin/dashboard/
- https://open.greenhost.net/stackspin/dashboard-backend/ - https://open.greenhost.net/stackspin/dashboard-backend/
version: 1.0.0 version: 1.0.1

View file

@ -2,7 +2,7 @@ import React from 'react';
import { useController } from 'react-hook-form'; import { useController } from 'react-hook-form';
/* eslint-disable react/react-in-jsx-scope */ /* eslint-disable react/react-in-jsx-scope */
export const Input = ({ control, name, type = 'text', label, ...props }: InputProps) => { export const Input = ({ control, name, type = 'text', label, required, ...props }: InputProps) => {
const { const {
field, field,
// fieldState: { invalid, isTouched, isDirty }, // fieldState: { invalid, isTouched, isDirty },
@ -10,7 +10,7 @@ export const Input = ({ control, name, type = 'text', label, ...props }: InputPr
} = useController({ } = useController({
name, name,
control, control,
rules: { required: true }, rules: { required },
defaultValue: '', defaultValue: '',
}); });

View file

@ -116,11 +116,18 @@ export const UserModal = ({ open, onClose, userId, setUserId }: UserModalProps)
<div className="mt-6 grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6"> <div className="mt-6 grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6">
<div className="sm:col-span-3"> <div className="sm:col-span-3">
<Input control={control} name="name" label="Name" onKeyPress={handleKeyPress} /> <Input control={control} name="name" label="Name" onKeyPress={handleKeyPress} required={false} />
</div> </div>
<div className="sm:col-span-3"> <div className="sm:col-span-3">
<Input control={control} name="email" label="Email" type="email" onKeyPress={handleKeyPress} /> <Input
control={control}
name="email"
label="Email"
type="email"
onKeyPress={handleKeyPress}
required
/>
</div> </div>
{isAdmin && ( {isAdmin && (
<> <>