mui-datatables icon indicating copy to clipboard operation
mui-datatables copied to clipboard

fix: hide column in print mode when `print: false`

Open aaneitchik opened this issue 3 years ago • 3 comments

This is my attempt at fixing https://github.com/gregnb/mui-datatables/issues/1913. I'm not sure @global is actually supported by tss-react, so I rewrote this part without using it. Not sure if that's the best way to do it, any suggestions are welcome 🙂

I also unfortunately wasn't able to run tests locally, when running tests locally with npm test I get this error:

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at Object.help (/Users/anya/mui-datatables/node_modules/yargs/lib/usage.js:240:22)
    at Object.self.showHelp (/Users/anya/mui-datatables/node_modules/yargs/lib/usage.js:432:15)
    at Array.<anonymous> (/Users/anya/mui-datatables/node_modules/mocha/lib/cli/cli.js:53:13)
    at Object.fail (/Users/anya/mui-datatables/node_modules/yargs/lib/usage.js:41:17)
    at /Users/anya/mui-datatables/node_modules/yargs/lib/command.js:246:36
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

So I just tested this manually on the "Hide Columns Print" example, here's how it looks like in print mode.

Before: Screenshot 2022-04-20 at 22 53 14

After: Screenshot 2022-04-20 at 22 52 43

aaneitchik avatar Apr 20 '22 20:04 aaneitchik

This looks like a good change to me. We recently had the jsdom could not parse CSS stylesheet error come up, and it ended up having the @global string in the generated css during a test. We eventually traced it back to mui-datatables and to the previously filed issue.

ryanmr avatar Jun 13 '22 17:06 ryanmr

Nice! It would be amazing to get that pesky "jsdom could not parse CSS stylesheet" out of my console haha. Any ETA to merge?

liamlows avatar Jun 14 '22 23:06 liamlows

@wdh2100 Anyway we could get this merged in soon?

liamlows avatar Jul 01 '22 18:07 liamlows

@aaneitchik Can you try and add @wdh2100 as a reviewer that might get his attention?

Npervic avatar Nov 10 '22 13:11 Npervic

@Npervic Unfortunately I can't: the button to request a review doesn't show up where it should be, so looks like I don't have the permissions to do it.

aaneitchik avatar Nov 10 '22 13:11 aaneitchik

@Npervic Unfortunately I can't: the button to request a review doesn't show up where it should be, so looks like I don't have the permissions to do it.

That's to bad but thanks for trying, I'l keep reaching out.

Npervic avatar Nov 10 '22 13:11 Npervic