Skip to content

Commit

Permalink
Merge pull request #1144 from merico-dev/1142-cant-change-a-variables…
Browse files Browse the repository at this point in the history
…-color-type-from-continuous-to-static

1142 cant change a variables color type from continuous to static
  • Loading branch information
GerilLeto authored Aug 23, 2023
2 parents 7cb105f + 65a4781 commit 7b76466
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/api",
"version": "10.23.0",
"version": "10.23.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/dashboard",
"version": "10.23.0",
"version": "10.23.1",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
Expand Down
23 changes: 22 additions & 1 deletion dashboard/src/utils/template/editor/variable-style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ export const TemplateVariableStyleField = React.forwardRef(function _TemplateVar
onChange(v);
};

const changeColor = (c: 'static' | 'continuous') => {
if (c === 'static') {
onChange({
...value,
color: {
type: 'static',
staticColor: '#25262B',
},
});
return;
}
onChange({
...value,
color: {
type: 'continuous',
colorRange: [],
valueRange: [],
},
});
};

return (
<>
<Divider my="xs" label="Typography" labelPosition="center" />
Expand All @@ -51,7 +72,7 @@ export const TemplateVariableStyleField = React.forwardRef(function _TemplateVar
{ label: 'Continuous Color', value: 'continuous' },
]}
value={value.color.type}
onChange={(v) => handleChange('color.type', v)}
onChange={changeColor}
/>
{colorType === 'static' && (
<MantineColorSelector
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/root",
"version": "10.23.0",
"version": "10.23.1",
"private": true,
"workspaces": [
"api",
Expand Down
2 changes: 1 addition & 1 deletion settings-form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/settings-form",
"version": "10.23.0",
"version": "10.23.1",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@devtable/website",
"private": true,
"license": "Apache-2.0",
"version": "10.23.0",
"version": "10.23.1",
"scripts": {
"dev": "vite",
"preview": "vite preview"
Expand Down

0 comments on commit 7b76466

Please sign in to comment.