Skip to content
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

define variables needed in the header template #247

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

briskt
Copy link
Contributor

@briskt briskt commented Jul 8, 2024

Fixed

  • Define template variables needed in the header template (theme_color_scheme and analytics_tracking_id)

Note: It may be possible to reduce this code duplication by defining our own Template class, inherited from SimpleSAML\XHTML\Template, but I think that even that would have to be duplicated once for each module. Perhaps it could be extracted to our ssp-utilities repo.

Any template instantiated by SSP code will not have defined our variables.
Copy link

sonarqubecloud bot commented Jul 8, 2024

@mtompset
Copy link

mtompset commented Jul 8, 2024

_Note: It may be possible to reduce this code duplication by defining our own Template class, inherited from SimpleSAML\XHTML\Template,

Exactly what I thought after seeing all these tweaks.

but I think that even that would have to be duplicated once for each module.

Duplicated how? As far as I can tell, the use line would change, that's it.

Perhaps it could be extracted to our ssp-utilities repo.

So, instead of changing the use line, add a functionality to do the tweaks on the template object? I think the extended object idea is better.

Copy link

@mtompset mtompset left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The advantage of the extended object idea is that you don't accidentally forget to add these two lines everywhere. I'll approved, but it isn't the cleanest way. Maintenance headaches await.

@briskt
Copy link
Contributor Author

briskt commented Jul 8, 2024

_Note: It may be possible to reduce this code duplication by defining our own Template class, inherited from SimpleSAML\XHTML\Template,

Exactly what I thought after seeing all these tweaks.

but I think that even that would have to be duplicated once for each module.

Duplicated how? As far as I can tell, the use line would change, that's it.

Perhaps it could be extracted to our ssp-utilities repo.

So, instead of changing the use line, add a functionality to do the tweaks on the template object? I think the extended object idea is better.

There's a hard boundary between modules, such that you can't call code from one module to the other. It may be possible to do it in this repo, but outside of a module, but my PHP isn't strong enough to think of all the required details. I'd welcome anyone to step in and clean this up for me.

@briskt
Copy link
Contributor Author

briskt commented Jul 8, 2024

The advantage of the extended object idea is that you don't accidentally forget to add these two lines everywhere. I'll approved, but it isn't the cleanest way. Maintenance headaches await.

I note you said "I'll approve" but yet you didn't. Change of heart?

@briskt
Copy link
Contributor Author

briskt commented Jul 8, 2024

The advantage of the extended object idea is that you don't accidentally forget to add these two lines everywhere. I'll approved, but it isn't the cleanest way. Maintenance headaches await.

I note you said "I'll approve" but yet you didn't. Change of heart?

Doh, my mistake. You did.

@briskt briskt merged commit 6db9caf into develop Jul 8, 2024
3 checks passed
@briskt briskt deleted the feature/ssp2-header-variables branch July 8, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants