Skip to content

Commit 325580a

Browse files
vladislav-999ryasmi
authored andcommitted
fix(Dashboard Page): Removes table view option for counter visualisations to avoid issues. (#1490 - [LL-270](https://learningpool.atlassian.net/browse/LL-270))
1 parent 4277b3a commit 325580a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ui/src/containers/Widget/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { compose } from 'recompose';
88
import {
99
COUNTER,
1010
PIE,
11+
TEMPLATE_LAST_7_DAYS_STATEMENTS,
12+
TEMPLATE_CURATR_COMMENT_COUNT
1113
} from 'lib/constants/visualise';
1214
import { fetchModels } from 'ui/redux/modules/pagination';
1315
import { updateModel, modelsSchemaIdSelector } from 'ui/redux/modules/models';
@@ -125,13 +127,17 @@ class Widget extends Component {
125127
</span>
126128
);
127129

130+
isCounter = (type) => {
131+
return type === COUNTER || type === TEMPLATE_LAST_7_DAYS_STATEMENTS || type === TEMPLATE_CURATR_COMMENT_COUNT;
132+
}
133+
128134
renderMenu = () => {
129135
const { model, organisationId, visualisation } = this.props;
130136

131137
const shouldShowTableModeToggle = (
132138
visualisation.size > 0 &&
133139
visualisation.get('type') &&
134-
visualisation.get('type') !== COUNTER &&
140+
!this.isCounter(visualisation.get('type')) &&
135141
model.has('visualisation')
136142
);
137143

@@ -216,7 +222,7 @@ class Widget extends Component {
216222
[styles.draggableTitle]: this.props.editable,
217223
});
218224
return (
219-
<div className={`panel panel-default animated fadeIn ${styles.widget}`} >
225+
<div className={`panel panel-default animated fadeIn ${styles.widget}`}>
220226
<div className={styles.widgetContent}>
221227
<div
222228
className={`panel-heading ${styles.heading}`}>

0 commit comments

Comments
 (0)