Skip to content

Commit f54e59a

Browse files
authored
Merge pull request #252 from bcgsc/release/v6.14.0
Release/v6.14.0
2 parents de4b951 + e4e542f commit f54e59a

File tree

29 files changed

+2742
-1583
lines changed

29 files changed

+2742
-1583
lines changed

.github/workflows/autoprmasterdev.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This will trigger when master branch gets updated, it will make a PR to develop
2+
name: Auto-pr-master-develop
3+
4+
# Controls when the workflow will run
5+
on:
6+
# Triggers the workflow on push or pull request events but only for the develop branch
7+
pull_request:
8+
branches: [master]
9+
types: [closed]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "build"
17+
merge-master-to-dev:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# If master pull request is merged
22+
if: github.event.pull_request.merged == true
23+
24+
# Steps represent a sequence of tasks that will be executed as part of the job
25+
steps:
26+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
27+
- uses: actions/checkout@v2
28+
with:
29+
ref: develop
30+
31+
- name: Set Git config
32+
run: |
33+
git config --local user.email "actions@github.com"
34+
git config --local user.name "Github Actions"
35+
36+
- name: Reset master branch
37+
run: |
38+
git fetch origin master:master
39+
git reset --hard master
40+
41+
- name: Read and set version
42+
id: versioning
43+
run: |
44+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
45+
echo ::set-output name=tag::${PACKAGE_VERSION}
46+
47+
- name: Create Pull Request
48+
uses: peter-evans/create-pull-request@v3.11.0
49+
with:
50+
branch: merge-master-to-dev-${{ steps.versioning.outputs.tag }}
51+
title: update develop from master-${{ steps.versioning.outputs.tag }}
52+
commit-message: auto PR master to develop

.storybook/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module.exports = {
99
],
1010
addons: [
1111
"@storybook/addon-links",
12-
"@storybook/addon-essentials"
12+
"@storybook/addon-essentials",
13+
"@react-theming/storybook-addon",
1314
],
1415
webpackFinal: (config) => {
1516
return {

.storybook/preview.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import React from 'react';
2+
import { ThemeProvider } from '@mui/material/styles';
3+
import theme from '../app/appTheme';
4+
15
export const parameters = {
26
actions: { argTypesRegex: "^on[A-Z].*" },
37
controls: {
@@ -7,3 +11,9 @@ export const parameters = {
711
},
812
},
913
}
14+
15+
const withThemeProvider = (Story, context) => {
16+
return <ThemeProvider theme={theme}><Story {...context}/></ThemeProvider>;
17+
};
18+
19+
export const decorators = [withThemeProvider];
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
import React from 'react';
2+
import { ModuleRegistry } from '@ag-grid-community/core';
3+
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
4+
import { Story } from '@storybook/react/types-6-0';
5+
import DataTable, { DataTableProps } from '.';
6+
7+
ModuleRegistry.registerModules([
8+
ClientSideRowModelModule,
9+
]);
10+
11+
const DEFAULT_PROPS = {
12+
rowData: [
13+
{
14+
column_a: 'data_a',
15+
column_b: 'data_b',
16+
column_c: 'data_c_01',
17+
column_d: 'data_d_01',
18+
},
19+
{
20+
column_a: 'data_a02',
21+
column_b: 'data_b03',
22+
column_c: 'data_c_04',
23+
column_d: 'data_d_05',
24+
},
25+
{
26+
column_a: 'data_a',
27+
column_b: 'data_b',
28+
column_c: 'data_c_02',
29+
column_d: 'data_d_02',
30+
},
31+
{
32+
column_a: 'data_a',
33+
column_b: 'data_b',
34+
column_c: 'data_c_03',
35+
column_d: 'data_d_03',
36+
},
37+
{
38+
column_a: 'data_a01',
39+
column_b: 'data_b01',
40+
column_c: 'data_c_05',
41+
column_d: 'data_d_06',
42+
},
43+
{
44+
column_a: 'data_a01',
45+
column_b: 'data_b01',
46+
column_c: 'data_c_06',
47+
column_d: 'data_d_07',
48+
},
49+
{
50+
column_a: 'data_a02',
51+
column_b: 'data_b01',
52+
column_c: 'data_c_07',
53+
column_d: 'data_d_08',
54+
},
55+
{
56+
column_a: 'data_a03',
57+
column_b: 'data_b01',
58+
column_c: 'data_c_09',
59+
column_d: 'data_d_11',
60+
},
61+
{
62+
column_a: 'data_a03',
63+
column_b: 'data_b02',
64+
column_c: 'data_c_09',
65+
column_d: 'data_d_12',
66+
},
67+
{
68+
column_a: 'data_a03',
69+
column_b: 'data_b02',
70+
column_c: 'data_c_09',
71+
column_d: 'data_d_13',
72+
},
73+
{
74+
column_a: 'data_a02',
75+
column_b: 'data_b01',
76+
column_c: 'data_c_07',
77+
column_d: 'data_d_09',
78+
},
79+
{
80+
column_a: 'data_a03',
81+
column_b: 'data_b01',
82+
column_c: 'data_c_08',
83+
column_d: 'data_d_09',
84+
},
85+
{
86+
column_a: 'data_a03',
87+
column_b: 'data_b01',
88+
column_c: 'data_c_09',
89+
column_d: 'data_d_10',
90+
},
91+
{
92+
column_a: 'data_a03',
93+
column_b: 'data_b01',
94+
column_c: 'data_c_09',
95+
column_d: 'data_d_14',
96+
},
97+
{
98+
column_a: 'data_a03',
99+
column_b: 'data_b01',
100+
column_c: 'data_c_09',
101+
column_d: 'data_d_15',
102+
},
103+
],
104+
columnDefs: [
105+
{
106+
field: 'column_a',
107+
headerName: 'Col_A',
108+
},
109+
{
110+
field: 'column_b',
111+
headerName: 'Col_B',
112+
},
113+
{
114+
field: 'column_c',
115+
headerName: 'Col_C',
116+
},
117+
{
118+
field: 'column_d',
119+
headerName: 'Col_D',
120+
},
121+
],
122+
};
123+
124+
export default {
125+
title: 'components/DataTable',
126+
component: DataTable,
127+
};
128+
129+
const Template = (args) => <DataTable {...args} />;
130+
131+
export const Normal: Story<DataTableProps> = Template.bind({});
132+
133+
Normal.args = {
134+
...DEFAULT_PROPS,
135+
};
136+
137+
export const WithTitleText: Story<DataTableProps> = Template.bind({});
138+
139+
WithTitleText.args = {
140+
...DEFAULT_PROPS,
141+
titleText: 'Test title',
142+
};
143+
144+
export const CannotToggleColumns: Story<DataTableProps> = Template.bind({});
145+
146+
CannotToggleColumns.args = {
147+
...DEFAULT_PROPS,
148+
canToggleColumns: false,
149+
};
150+
151+
export const CollapsedRows: Story<DataTableProps> = Template.bind({});
152+
CollapsedRows.args = {
153+
...DEFAULT_PROPS,
154+
collapseColumnFields: ['column_a', 'column_b'],
155+
};

app/components/DataTable/__tests__/__snapshots__/DataTable.test.tsx.snap

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,36 @@ exports[`DataTable It matches the snapshot 1`] = `
55
<div
66
class="data-table--padded"
77
>
8+
<div
9+
class="data-table__header-container"
10+
>
11+
<div>
12+
<span
13+
class="data-table__action"
14+
>
15+
<button
16+
class="MuiButtonBase-root MuiIconButton-root MuiIconButton-sizeLarge data-table__icon-button css-mf1cb5-MuiButtonBase-root-MuiIconButton-root"
17+
tabindex="0"
18+
type="button"
19+
>
20+
<svg
21+
aria-hidden="true"
22+
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-i4bv87-MuiSvgIcon-root"
23+
data-testid="MoreHorizIcon"
24+
focusable="false"
25+
viewBox="0 0 24 24"
26+
>
27+
<path
28+
d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"
29+
/>
30+
</svg>
31+
<span
32+
class="MuiTouchRipple-root css-8je8zh-MuiTouchRipple-root"
33+
/>
34+
</button>
35+
</span>
36+
</div>
37+
</div>
838
<div
939
class="ag-theme-material data-table__container"
1040
>

app/components/DataTable/components/ColumnPicker/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@ const ColumnPicker = ({
6666
<div className="options-menu__label">
6767
{label}
6868
</div>
69-
{columns.map((row) => (
70-
<div key={row.name}>
69+
{columns.map((col) => (
70+
<div key={col.name}>
7171
<div className="options-menu__content">
7272
<FormControlLabel
7373
control={(
7474
<Checkbox
7575
color="primary"
76-
checked={visibleCols.includes(row?.getColId())}
77-
onChange={(event) => handleChange(event, row?.getColId())}
76+
checked={visibleCols.includes(col?.getColId())}
77+
onChange={(event) => handleChange(event, col?.getColId())}
7878
/>
7979
)}
80-
label={row.name}
80+
label={col.name ? col.name : col.getColId()}
8181
/>
8282
</div>
8383
</div>

app/components/DataTable/index.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@
1717
.ag-row:last-child {
1818
border-bottom: none;
1919
}
20+
21+
.cell-span, .cell-span--last {
22+
display: flex;
23+
align-items: center;
24+
background-color: white;
25+
// Importants are to override default behavior of the grid
26+
border-bottom: 1px solid
27+
var(--ag-row-border-color, var(--ag-secondary-border-color, var(--ag-border-color, #e2e2e2))) !important;
28+
}
29+
30+
.cell-span--last {
31+
// Importants are to override default behavior of the grid
32+
border-bottom: none !important;
33+
}
2034
}
2135

2236
&__header-container {

0 commit comments

Comments
 (0)