Compare commits

...

9 Commits

Author SHA1 Message Date
Christopher Lebond
ca5f442fe0 Merge pull request #8 from qlik-oss/feature/QPE-585
[QPE 585] Minor design fixes
2019-02-22 15:37:56 +01:00
ahmed-Bazzara
585243bb73 merge confloicts solved 2019-02-22 14:49:36 +01:00
ahmed-Bazzara
979c036b49 settings file reverted 2019-02-22 12:44:44 +01:00
ahmed-Bazzara
63c877face merge conflicts solved 2019-02-22 12:40:30 +01:00
Balazs Gobel
8984affe87 minor cleanup 2019-02-12 11:25:22 +01:00
Balazs Gobel
ce1e196b78 Follow the same principle as the old application
- Restyle table cells only when metric semaphore is enabled
2019-02-12 11:25:22 +01:00
Balazs Gobel
e3b7a7640e Fixed misalignment when it's only one dimension 2019-02-12 11:25:22 +01:00
Balazs Gobel
68dccf8575 Fix pixel misalignment between table header and body 2019-02-12 11:25:22 +01:00
Balazs Gobel
8e100f286b Fix alternating colours 2019-02-12 11:25:22 +01:00
3 changed files with 14 additions and 13 deletions

View File

@@ -96,30 +96,25 @@ class DataCell extends React.PureComponent {
textAlignment = textAlignmentProp;
}
let cellStyle = {
fontFamily: styling.options.fontFamily,
...styleBuilder.getStyle(),
paddingLeft: '4px',
textAlign: textAlignment
};
const { semaphoreColors } = styling;
const { semaphoreColors, semaphoreColors: { fieldsToApplyTo } } = styling;
const isValidSemaphoreValue = !styleBuilder.hasComments() && !isNaN(measurement.value);
const shouldHaveSemaphoreColors = semaphoreColors.fieldsToApplyTo.applyToAll || semaphoreColors.fieldsToApplyTo.specificFields.indexOf(measurement.parents.dimension1.header) !== -1;
const shouldHaveSemaphoreColors = fieldsToApplyTo.applyToMetric && (fieldsToApplyTo.applyToAll || fieldsToApplyTo.specificFields.indexOf(measurement.name) !== -1);
let cellStyle;
if (isValidSemaphoreValue && shouldHaveSemaphoreColors) {
const { backgroundColor, color } = getSemaphoreColors(measurement, semaphoreColors);
cellStyle = {
backgroundColor,
color,
fontFamily: styling.options.fontFamily,
fontSize: styleBuilder.getStyle().fontSize,
...styleBuilder.getStyle(),
paddingLeft: '4px',
textAlign: textAlignment
};
}
let cellClass = 'grid-cells';
const shouldUseSmallCells = isColumnPercentageBased && data.headers.measurements.length > 1;
const hasTwoDimensions = data.headers.dimension2 && data.headers.dimension2.length > 0;
const shouldUseSmallCells = isColumnPercentageBased && data.headers.measurements.length > 1 && hasTwoDimensions;
if (shouldUseSmallCells) {
cellClass = 'grid-cells-small';
}
@@ -135,7 +130,6 @@ class DataCell extends React.PureComponent {
);
}
}
DataCell.propTypes = {
data: PropTypes.shape({
headers: PropTypes.shape({

View File

@@ -279,7 +279,7 @@ async function initializeTransformed ({ $element, layout, component }) {
},
options: {
backgroundColor: colors[`vColLib${layout.ColorSchema}`],
backgroundColorOdd: colors[`vColLib${layout.ColorSchemaP}`],
backgroundColorOdd: colors[`vColLib${layout.ColorSchema}P`],
color: layout.BodyTextColorSchema,
fontFamily: layout.FontFamily,
fontSizeAdjustment: getFontSizeAdjustment(layout.lettersize),
@@ -288,6 +288,7 @@ async function initializeTransformed ({ $element, layout, component }) {
semaphoreColors: {
fieldsToApplyTo: {
applyToAll: layout.allsemaphores,
applyToMetric: layout.allmetrics,
specificFields: [
layout.conceptsemaphore1,
layout.conceptsemaphore2,

View File

@@ -3,6 +3,12 @@
@TableBorder: 1px solid #d3d3d3;
@KpiTableWidth: 230px;
*,
*::before,
*::after {
box-sizing: border-box;
}
.edit-mode {
pointer-events: none;
}