Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
8d9ff35c
Unverified
Commit
8d9ff35c
authored
2 years ago
by
Alexander Lesnenko
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix updating field name and description in data model (#22875)
parent
b085e421
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/admin/datamodel/containers/FieldApp.jsx
+9
-17
9 additions, 17 deletions
...tend/src/metabase/admin/datamodel/containers/FieldApp.jsx
with
9 additions
and
17 deletions
frontend/src/metabase/admin/datamodel/containers/FieldApp.jsx
+
9
−
17
View file @
8d9ff35c
...
...
@@ -402,15 +402,7 @@ export const BackButton = ({ databaseId, tableId }) => (
);
export
class
FieldHeader
extends
React
.
Component
{
onNameChange
=
e
=>
{
this
.
updateNameDebounced
(
e
.
target
.
value
);
};
onDescriptionChange
=
e
=>
{
this
.
updateDescriptionDebounced
(
e
.
target
.
value
);
};
// Separate update methods because of throttling the input
updateNameDebounced
=
_
.
debounce
(
async
name
=>
{
onNameChange
=
async
e
=>
{
const
{
field
,
updateFieldProperties
,
updateFieldDimension
}
=
this
.
props
;
// Update the dimension name if it exists
...
...
@@ -421,19 +413,19 @@ export class FieldHeader extends React.Component {
{
type
:
field
.
dimensions
.
type
,
human_readable_field_id
:
field
.
dimensions
.
human_readable_field_id
,
name
,
name
:
e
.
target
.
value
,
},
);
}
// todo: how to treat empty / too long strings? see how this is done in Column
updateFieldProperties
({
display_name
:
nam
e
});
}
,
300
)
;
updateFieldProperties
({
display_name
:
e
.
target
.
valu
e
});
};
update
Description
Debounced
=
_
.
debounce
(
description
=>
{
on
Description
Change
=
e
=>
{
const
{
updateFieldProperties
}
=
this
.
props
;
updateFieldProperties
({
description
});
}
,
300
)
;
updateFieldProperties
({
description
:
e
.
target
.
value
});
};
render
()
{
return
(
...
...
@@ -442,14 +434,14 @@ export class FieldHeader extends React.Component {
name
=
"display_name"
className
=
"h2 AdminInput bordered rounded border-dark block mb1"
value
=
{
this
.
props
.
field
.
display_name
}
onChange
=
{
this
.
onNameChange
}
on
Blur
Change
=
{
this
.
onNameChange
}
placeholder
=
{
this
.
props
.
field
.
name
}
/>
<
InputBlurChange
name
=
"description"
className
=
"text AdminInput bordered input text-measure block full"
value
=
{
this
.
props
.
field
.
description
}
onChange
=
{
this
.
onDescriptionChange
}
on
Blur
Change
=
{
this
.
onDescriptionChange
}
placeholder
=
{
t
`No description for this field yet`
}
/>
</
div
>
...
...
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