fix: use same text color for excluded and selectedExcluded (#1147)

* fix: use same text color for excluded and selectedExcluded

* test: add rendering tests

* fix: lock icon on locked excluded
This commit is contained in:
Tobias Linsefors
2023-03-15 14:01:49 +01:00
committed by GitHub
parent 94049ec2d7
commit 48c85d47bb
6 changed files with 160 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ function RowColumn({ index, rowIndex, columnIndex, style, data }) {
const handleKeyDownCallback = useCallback(getFieldKeyboardNavigation({ ...actions, focusListItems }), [actions]);
const cell = useMemo(() => getCellFromPages({ pages, cellIndex }), [pages, cellIndex]);
const isSelected = cell?.qState === 'S' || cell?.qState === 'XS' || cell?.qState === 'L';
const isSelected = cell?.qState === 'S' || cell?.qState === 'XS' || cell?.qState === 'L' || cell?.qState === 'XL';
const classArr = useMemo(
() => getValueStateClasses({ column, histogram, checkboxes, cell, showGray }),

View File

@@ -126,7 +126,7 @@ const RowColRoot = styled('div', {
[`& .${classes.XS}`]: {
...getSelectedStyle({ theme }),
background: theme.palette.selected.excluded,
color: theme.palette.selected.mainContrastText,
color: theme.palette.selected.excludedContrastText,
border: isGridMode ? 'none' : undefined,
},

View File

@@ -0,0 +1,79 @@
const fixture = {
getLayout: () => ({
title: 'Field title',
qInfo: {
qId: 'qId',
},
visualization: 'listbox',
qListObject: {
qDimensionInfo: {
qLocked: true,
},
qSize: {
qcy: 5,
},
qInitialDataFetch: [{ qLeft: 0, qWidth: 0, qTop: 0, qHeight: 0 }],
},
qSelectionInfo: {
qInSelections: false,
},
layoutOptions: {
layoutOrder: 'row',
},
}),
getListObjectData: () => [
{
qMatrix: [
[
{
qText: 'Locked',
qNum: 'NaN',
qElemNumber: 0,
qState: 'L',
},
],
[
{
qText: 'Alternative',
qNum: 'NaN',
qElemNumber: 1,
qState: 'A',
},
],
[
{
qText: 'Optional',
qNum: 'NaN',
qElemNumber: 2,
qState: 'O',
},
],
[
{
qText: 'Locked Excluded',
qNum: 'NaN',
qElemNumber: 3,
qState: 'XL',
},
],
[
{
qText: 'Excluded',
qNum: 'NaN',
qElemNumber: 4,
qState: 'X',
},
],
],
qTails: [],
qArea: {
qLeft: 0,
qTop: 0,
qWidth: 1,
qHeight: 5,
},
},
],
};
export default fixture;

View File

@@ -0,0 +1,79 @@
const fixture = {
getLayout: () => ({
title: 'Field title',
qInfo: {
qId: 'qId',
},
visualization: 'listbox',
qListObject: {
qDimensionInfo: {
qLocked: false,
},
qSize: {
qcy: 5,
},
qInitialDataFetch: [{ qLeft: 0, qWidth: 0, qTop: 0, qHeight: 0 }],
},
qSelectionInfo: {
qInSelections: false,
},
layoutOptions: {
layoutOrder: 'row',
},
}),
getListObjectData: () => [
{
qMatrix: [
[
{
qText: 'Selected',
qNum: 'NaN',
qElemNumber: 0,
qState: 'S',
},
],
[
{
qText: 'Alternative',
qNum: 'NaN',
qElemNumber: 1,
qState: 'A',
},
],
[
{
qText: 'Optional',
qNum: 'NaN',
qElemNumber: 2,
qState: 'O',
},
],
[
{
qText: 'Selected Excluded',
qNum: 'NaN',
qElemNumber: 3,
qState: 'XS',
},
],
[
{
qText: 'Excluded',
qNum: 'NaN',
qElemNumber: 4,
qState: 'X',
},
],
],
qTails: [],
qArea: {
qLeft: 0,
qTop: 0,
qWidth: 1,
qHeight: 5,
},
},
],
};
export default fixture;

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB