-
Notifications
You must be signed in to change notification settings - Fork 60
Font size / page size setting for printing #8035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
d2c5ff5
to
ae26596
Compare
ae26596
to
c749615
Compare
The space problem for small blocks get worse on the picasso: And the 07:00 is over the line. If for whatever reason you use 2 zeros for the relative time from block start, it always wraps: Client A5 Here the user can use 2 digit hours in the block: A3: I don't know what you would want to print on A3, maybe the picasso? UI Design: |
@@ -106,6 +106,10 @@ describe('repairConfig', () => { | |||
}, | |||
}, | |||
] | |||
const defaultOptions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
}) | ||
|
||
const pageSizes = [('A5', 'A4', 'A3')] | ||
pageSizes.forEach((pageSize) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, nitpick:
With vitest you have to get used to it, but the syntax for parametrized tests is:
describe('idToColor', () => {
it.each([
[[undefined, false], '#4d4d4d'],
[[null, false], '#4d4d4d'],
[['', false], '#4d4d4d'],
[['0000000', false], '#900'],
[['0000000', true], '#4d4d4d'],
[['fffffff', false], '#992600'],
[['Wrong input', false], '#900'],
])('maps %p to %p', (input, expected) => {
See
it.each([ |
Or search "it.each"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I've been in the ruby testing world a lot... e4d3c1f
}) | ||
}) | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add: Repairs invalid page size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Done in e4d3c1f
@@ -50,8 +51,15 @@ export default { | |||
linkTarget() { | |||
return `#scheduleEntry_${this.scheduleEntry.id}` | |||
}, | |||
fontSizeScalingFactor() { | |||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a different way for a switch statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced in e4d3c1f
@@ -36,6 +36,7 @@ const props = defineProps({ | |||
}, | |||
index: { type: Number, required: true }, | |||
filter: { type: Object, default: () => ({}) }, | |||
pageSize: { type: String, default: 'a4' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick:
In clientprint its 'A4', here 'a4'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually intentional. In nuxt print, a4
is used as a CSS class name, and those are usually lowercase. In client print, A4
needs to be passed into the <Page>
element, and it expects it to be uppercase.
What we also have to discuss: How much value do we get vs additional maintenance effort? Do we need tests for the other font sizes? How much priority does it get when it breaks? |
True, but if you are using this advanced feature, you probably can also set the picasso to portrait mode and maybe even split it in two parts using the date filters, so it's less of a problem.
Fixed in 10724c5
I could also imagine dropping the A3 option, and just supporting the A6 one for now. I agree A4/A3 is only useful for the picasso, if at all. It does improve the "space problem for small blocks" which you mention on the A6 version, but nobody has explicitely asked for reducing the font size as far as I am aware (although when users claim they can create a better readable picasso in excel, this usually just boils down to a smaller font size). I implemented this because I see the A6 variant as a valid use case for which we can't provide any workarounds at the moment. And if it's just setting the page size plus 1-2 workarounds for the smaller paper size, I feel like the maintenance burden is not so high.
|
eedcbdb
to
0898a3a
Compare
0898a3a
to
9c6cda3
Compare
Fixes #4650

A5 / A6 (bigger relative font size): Nuxt A5 Client A5
A4 / A5 (normal, same as on prod): Nuxt A4 Client A4
A4 / A3 (smaller relative font size): Nuxt A3 Client A3
Please feedback on: