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

Adding options to customize layout #3

Merged
merged 3 commits into from May 24, 2017
Merged

Adding options to customize layout #3

merged 3 commits into from May 24, 2017

Conversation

pifleo
Copy link
Contributor

@pifleo pifleo commented Apr 7, 2017

Hi,

This first PR add 3 options in the layout namespace to allow a light customization of the main layout.
It should be safe as it keep the same behaviour as before for the layout.

wicked.portal
- Link correction in the layout menu (Hard coded link to main Wicked website)
- Add option to hide API and Applications to guest (not connected users)
- Add option to hide software details in the footer

wicked.portal-env
- Add options in the default globals.json config file

Issue: Haufe-Lexware/wicked.haufe.io/issues/66

@DonMartin76
Copy link
Member

DonMartin76 commented Apr 7, 2017

Hi!

Thank you for your PR! I see why you would want to be able to customize these things, even if they were quite intentionally done like this to promote wicked ;-)

I have a couple of things that would need to be changed though:

  • The PR has to be based on the next branch, so please rebase your changes
  • The link to to / is already present as "Home", so this is not what was intended. I'm okay with making this a customizable URL though (could be part of your new layout property; should default to http://wicked.haufe.io/ please).
  • The other two things should be okay, as long as they default to true

Now to how you updated the globals.json. This is unfortunately not well documented (yet) how this file is extended, but you shouldn't change the initial config for it. If you do that, the changes and cumstoization possibility would only be visible to new configurations, and that's not what we want.

Instead, check out this file: https://github.com/Haufe-Lexware/wicked.portal-env/blob/master/config-updater.js

This file is used to update existing configuration files and has means of editing the globals.json on the fly. This is where the defaults for new properties go. To add properties, do this:

  • Add an update step, e.g. updateStepApr2017
  • Create a function with this name, function updateStep5_Apr2017(targetConfig, sourceConfig, configKey)
  • Load the target globals (you don't need the source globals)
  • Set the targetGlobals.version to 5 (which right now is the right version)
  • Write the new property layouts with the desired default values (as you did in the initial config; but take them out from there again)
  • Save the target globals again

This has the following effect: Whenever either the portal-api or the portal-kickstarter is started, these update steps will automatically populate the layout property. This means it will always be present at runtime, even if your static configuration does not contain them.

If you have questions, please ask, I am happy to help.

@pifleo
Copy link
Contributor Author

pifleo commented Apr 17, 2017

Hi,

I rebased the PR and added many options to the layout to fit all the changes I was doing on my own branch.
The default settings are reflecting your choices, not my personalization.

Can you have a look at the code?
Don’t merge yet, I might add some options in the coming week

Thanks !

@DonMartin76
Copy link
Member

Will do as soon as I get back to work next week, thanks!

@DonMartin76
Copy link
Member

Were you done with this? I am sorry I have not been very active the last couple of weeks, had other projects to tend to ;)

@DonMartin76 DonMartin76 merged commit cf5d2be into apim-haufe-io:next May 24, 2017
@pifleo
Copy link
Contributor Author

pifleo commented May 27, 2017

Yes I was done for now. Thanks for merging !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants