Skip to content

Commit

Permalink
[2144] Fix default properties values for widgets with no style
Browse files Browse the repository at this point in the history
Bug: #2144
Signed-off-by: Axel RICHARD <[email protected]>
  • Loading branch information
AxelRICHARD committed Jul 5, 2023
1 parent 94e195c commit 75e11fb
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 101 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ An absent/empty candidates expression now simply means the widget is empty.
- https://github.com/eclipse-sirius/sirius-components/issues/2133[#2133] [workbench] Fix NPE in Related Elements view
- https://github.com/eclipse-sirius/sirius-components/issues/2112[#2112] [form] Fix the pages filtering in form editor.
- https://github.com/eclipse-sirius/sirius-components/issues/2152[#2152] [tree] Fix an issue where some characters typed in the filter bar raised exception
- https://github.com/eclipse-sirius/sirius-components/issues/2144[#2144] [form] Fix the default properties values for widgets with no style.

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ const useStyles = makeStyles<Theme, ButtonStyleProps>((theme) => ({
style: {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : theme.palette.primary.light),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'white'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
'&:hover': {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : theme.palette.primary.main),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'white'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import { LabelWidgetProps } from './WidgetEntry.types';

const useStyles = makeStyles<Theme, LabelStyleProps>((theme) => ({
style: {
color: ({ color }) => (color ? color : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
color: ({ color }) => (color ? color : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
selected: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import { LinkWidgetProps } from './WidgetEntry.types';

const useStyles = makeStyles<Theme, LinkStyleProps>((theme) => ({
style: {
color: ({ color }) => (color ? color : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
color: ({ color }) => (color ? color : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
selected: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import { ListWidgetProps } from './WidgetEntry.types';

const useStyles = makeStyles<Theme, ListStyleProps>((theme) => ({
style: {
color: ({ color }) => (color ? color : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
color: ({ color }) => (color ? color : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
icon: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import { MultiSelectWidgetProps } from './WidgetEntry.types';

const useStyles = makeStyles<Theme, MultiSelectStyleProps>((theme) => ({
style: {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : 'inherit'),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : null),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
selected: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import { RadioWidgetProps } from './WidgetEntry.types';

const useStyles = makeStyles<Theme, RadioStyleProps>((theme) => ({
style: {
color: ({ color }) => (color ? color : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
color: ({ color }) => (color ? color : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
selected: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import { SelectWidgetProps } from './WidgetEntry.types';

const useStyles = makeStyles<Theme, SelectStyleProps>((theme) => ({
style: {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : 'inherit'),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : null),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
selected: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import { TextareaWidgetProps } from './WidgetEntry.types';

const useStyles = makeStyles<Theme, TextfieldStyleProps>((theme) => ({
style: {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : 'inherit'),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : null),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
selected: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import { TextfieldWidgetProps } from './WidgetEntry.types';

const useStyles = makeStyles<Theme, TextfieldStyleProps>((theme) => ({
style: {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : 'inherit'),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : null),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
selected: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import { useMutation } from '@apollo/client';
import { Selection, ServerContext, ServerContextValue, Toast } from '@eclipse-sirius/sirius-components-core';
import {
ButtonStyleProps,
getTextDecorationLineValue,
GQLButton,
GQLToolbarAction,
PropertySectionContext,
getTextDecorationLineValue,
} from '@eclipse-sirius/sirius-components-forms';
import Button from '@material-ui/core/Button';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { Theme, makeStyles } from '@material-ui/core/styles';
import React, { useContext, useEffect, useRef, useState } from 'react';
import { deleteToolbarActionMutation, moveToolbarActionMutation } from './FormDescriptionEditorEventFragment';
import {
Expand All @@ -41,16 +41,16 @@ const useStyles = makeStyles<Theme, ButtonStyleProps>((theme) => ({
lineHeight: 1.25,
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : theme.palette.primary.light),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'white'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
'&:hover': {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : theme.palette.primary.main),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'white'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
},
Expand All @@ -59,16 +59,16 @@ const useStyles = makeStyles<Theme, ButtonStyleProps>((theme) => ({
lineHeight: 1.25,
backgroundColor: theme.palette.secondary.light,
color: 'white',
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
'&:hover': {
backgroundColor: theme.palette.secondary.main,
color: 'white',
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ const useStyle = makeStyles<Theme, ButtonStyleProps>((theme) => ({
style: {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : theme.palette.primary.light),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'white'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
'&:hover': {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : theme.palette.primary.main),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'white'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import { PropertySectionLabel } from './PropertySectionLabel';

const useStyle = makeStyles<Theme, LabelStyleProps>(() => ({
style: {
color: ({ color }) => (color ? color : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
color: ({ color }) => (color ? color : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import { LinkPropertySectionProps, LinkStyleProps } from './LinkPropertySection.

const useStyle = makeStyles<Theme, LinkStyleProps>(() => ({
style: {
color: ({ color }) => (color ? color : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
color: ({ color }) => (color ? color : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
propertySectionLabel: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ const useListPropertySectionStyles = makeStyles<Theme, ListStyleProps>((theme) =
},
},
style: {
color: ({ color }) => (color ? color : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
color: ({ color }) => (color ? color : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
overflow: 'hidden',
textOverflow: 'ellipsis',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import { getTextDecorationLineValue } from './getTextDecorationLineValue';

const useStyle = makeStyles<Theme, MultiSelectStyleProps>((theme) => ({
style: {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : 'inherit'),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : null),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
icon: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ const useRadioPropertySectionStyles = makeStyles<Theme, RadioStyleProps>(() => (
flexDirection: 'row',
},
style: {
color: ({ color }) => (color ? color : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
color: ({ color }) => (color ? color : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ import { getTextDecorationLineValue } from './getTextDecorationLineValue';

const useStyle = makeStyles<Theme, SelectStyleProps>((theme) => ({
style: {
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : 'inherit'),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : 'inherit'),
fontSize: ({ fontSize }) => (fontSize ? fontSize : 'inherit'),
fontStyle: ({ italic }) => (italic ? 'italic' : 'inherit'),
fontWeight: ({ bold }) => (bold ? 'bold' : 'inherit'),
backgroundColor: ({ backgroundColor }) => (backgroundColor ? backgroundColor : null),
color: ({ foregroundColor }) => (foregroundColor ? foregroundColor : null),
fontSize: ({ fontSize }) => (fontSize ? fontSize : null),
fontStyle: ({ italic }) => (italic ? 'italic' : null),
fontWeight: ({ bold }) => (bold ? 'bold' : null),
textDecorationLine: ({ underline, strikeThrough }) => getTextDecorationLineValue(underline, strikeThrough),
},
icon: {
Expand Down
Loading

0 comments on commit 75e11fb

Please sign in to comment.