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

Introduce global settings #2532

Merged
merged 38 commits into from
Nov 9, 2017
Merged

Introduce global settings #2532

merged 38 commits into from
Nov 9, 2017

Conversation

maciaszczykm
Copy link
Member

@maciaszczykm maciaszczykm commented Oct 31, 2017

  • add settings manager
  • add global settings endpoint
  • add settings view
  • add settings menu entry
  • handle concurrent settings change error (dialog with save anyways and refresh options)
  • merge settings during save to avoid any data loss
  • fix tests
  • add tests
  • create service to retrieve specific settings values and use it across the app
  • generate translations
  • service refresh after settings save
  • handle cluster name setting
  • handle items per page setting
  • remove bower leftovers
  • fix caching problem

@maciaszczykm maciaszczykm self-assigned this Oct 31, 2017
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 31, 2017
@maciaszczykm
Copy link
Member Author

maciaszczykm commented Nov 3, 2017

Current progress:

image

image

@maciaszczykm
Copy link
Member Author

Current progress:

image

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 7, 2017
@maciaszczykm maciaszczykm changed the title [WIP] Introduce global settings Introduce global settings Nov 7, 2017
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 7, 2017
@maciaszczykm
Copy link
Member Author

It is ready for an initial review. I have to fix few things in tests/annotations etc.

func (sm *SettingsManager) SaveGlobalSettings(client kubernetes.Interface, s *api.Settings) error {
cm, isDiff := sm.load(client)
if isDiff {
return errors.New("settings changed since last reload")
Copy link
Member

@floreks floreks Nov 8, 2017

Choose a reason for hiding this comment

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

Use LocalizeError method here so we can localize it in frontend.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not displayed to the user but used to display "save anyways" dialog.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will comment it in the code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@floreks
Copy link
Member

floreks commented Nov 8, 2017

Overall LGTM.

@codecov
Copy link

codecov bot commented Nov 8, 2017

Codecov Report

Merging #2532 into master will decrease coverage by 0.13%.
The diff coverage is 52.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2532      +/-   ##
==========================================
- Coverage   59.07%   58.93%   -0.14%     
==========================================
  Files         598      607       +9     
  Lines       13092    13268     +176     
==========================================
+ Hits         7734     7820      +86     
- Misses       5148     5234      +86     
- Partials      210      214       +4
Impacted Files Coverage Δ
src/app/frontend/common/settings/module.js 100% <100%> (ø)
...c/app/frontend/settings/settingsentry/component.js 100% <100%> (ø)
src/app/frontend/settings/state.js 100% <100%> (ø)
src/app/frontend/common/dataselect/builder.js 93.1% <100%> (-0.23%) ⬇️
src/app/frontend/index_module.js 100% <100%> (ø) ⬆️
src/app/backend/handler/apihandler.go 26.48% <100%> (+0.11%) ⬆️
src/app/frontend/settings/module.js 100% <100%> (ø)
src/app/frontend/common/filters/itemsperpage.js 88.88% <100%> (ø) ⬆️
...sourcecard/resourcecardlistpagination_component.js 80% <100%> (ø) ⬆️
src/app/frontend/chrome/nav/nav_component.js 93.54% <100%> (+0.21%) ⬆️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 228f509...6952e5a. Read the comment docs.

@maciaszczykm
Copy link
Member Author

PTAL

Copy link
Member

@floreks floreks left a comment

Choose a reason for hiding this comment

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

LGTM

@maciaszczykm maciaszczykm merged commit 3254b2e into kubernetes:master Nov 9, 2017
@maciaszczykm maciaszczykm deleted the settings-v2 branch November 9, 2017 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants