-
Notifications
You must be signed in to change notification settings - Fork 5
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
Parameterize hardcoded strings in pdf generation #663
Parameterize hardcoded strings in pdf generation #663
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
5 Ignored Deployments
|
// FIXME: place it into a setting | ||
.add(Paragraph("GÓLYAKÖRTE 2023\nJELENLÉTI - ${group.name}") | ||
readAsset(tokenComponent.reportLogo.getValue().replace("/cdn/", "/")).map { | ||
Image(ImageDataFactory.create(it,)).scaleToFit(70f, 70f) |
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.
The comma is not required here after the it
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.
removed
}.ifPresent(header::add) | ||
|
||
val eventName = tokenComponent.reportTitle.getValue() | ||
header.add(Paragraph("${eventName}\nJELENLÉTI - ${group.name}") |
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.
I might use a title variable here and not hardcode the 'JELENLÉTI' string.
.add(kirdevLogo) | ||
.setTextAlignment(TextAlignment.CENTER) | ||
|
||
readAsset("/static/images/kirdev-logo.png").map { |
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 make it optional using a boolean config variable? I'm not really sure.
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.
No no, we must show the kir-dev logo at every opportunity
final val reportLogo = SettingProxy(componentSettingService, component, | ||
"reportLogo", "/cdn/manifest/report-logo.png", | ||
fieldName = "Jelenléti ív logója", description = "Ez lesz a jelenléti íven megjelenített logó (csak PNG és JPG jó)", | ||
type = SettingType.IMAGE, |
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.
Do we have that setting type? I didn't remember that! :D
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.
Yes, it's for setting manifest images, and thats why I set it like /cdn/manifest/...
@@ -29,15 +32,17 @@ class DI( | |||
} | |||
} | |||
|
|||
private fun getFileStoragePath(): String = if (!DI.instance.startupPropertyConfig.external.startsWith("/")) { | |||
System.getProperty("user.dir") + "/" + DI.instance.startupPropertyConfig.external |
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.
I'd just use the working directory for root and not the user.home
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.
I moved this code from the file upload function, I don't exactly understand why it works like this, so I didn't want to change it
6cd434a
to
552d91e
Compare
closes #661