Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rodolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
cubes
Rodolf
Commits
0720805201a2
Commit
0720805201a2
authored
1 year ago
by
Arnaud Vergnet
Browse files
Options
Downloads
Patches
Plain Diff
feat(fontend): only enable save button when there are changes
parent
4f7c69693731
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!24
feat(fontend): only enable save button when there are changes
Pipeline
#228358
failed
1 year ago
Stage: install
Stage: lint
Stage: build
Stage: tests
Stage: release
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/components/DataServiceForm.tsx
+8
-1
8 additions, 1 deletion
frontend/src/components/DataServiceForm.tsx
frontend/src/components/ProjectForm.tsx
+8
-1
8 additions, 1 deletion
frontend/src/components/ProjectForm.tsx
with
16 additions
and
2 deletions
frontend/src/components/DataServiceForm.tsx
+
8
−
1
View file @
07208052
...
...
@@ -26,7 +26,12 @@
export
function
DataServiceForm
({
dataService
}:
DataServiceFormProps
)
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
{
handleSubmit
,
control
}
=
useForm
<
DataService
>
({
const
{
handleSubmit
,
control
,
formState
:
{
isDirty
},
reset
,
}
=
useForm
<
DataService
>
({
defaultValues
:
dataService
?
dataService
:
{
...
...
@@ -49,6 +54,7 @@
router
.
push
(
`/data-service/
${
eid
}
`
);
}
else
{
await
updateDataService
(
data
);
reset
(
data
);
setLoading
(
false
);
}
}
catch
(
e
)
{
...
...
@@ -148,6 +154,7 @@
startIcon
=
{
<
SaveIcon
/>
}
loading
=
{
loading
}
type
=
"submit"
disabled
=
{
!
isDirty
}
>
{
dataService
?
"
Sauvegarder
"
:
"
Ajouter
"
}
</
LoadingButton
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/components/ProjectForm.tsx
+
8
−
1
View file @
07208052
...
...
@@ -15,7 +15,12 @@
export
function
ProjectForm
({
project
}:
ProjectFormProps
)
{
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
{
handleSubmit
,
control
}
=
useForm
<
Project
>
({
const
{
handleSubmit
,
control
,
formState
:
{
isDirty
},
reset
,
}
=
useForm
<
Project
>
({
defaultValues
:
project
??
{
activated
:
false
},
});
const
handleAuthErrors
=
useHandleAuthErrors
();
...
...
@@ -33,6 +38,7 @@
router
.
push
(
`/project/
${
eid
}
`
);
}
else
{
await
updateProject
(
data
);
reset
(
data
);
setLoading
(
false
);
}
}
catch
(
e
)
{
...
...
@@ -120,6 +126,7 @@
startIcon
=
{
<
SaveIcon
/>
}
type
=
"submit"
loading
=
{
loading
}
disabled
=
{
!
isDirty
}
>
{
project
?
"
Sauvegarder
"
:
"
Ajouter
"
}
</
LoadingButton
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment