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

Create system banner API handler #2607

Merged
merged 6 commits into from
Nov 24, 2017
Merged

Create system banner API handler #2607

merged 6 commits into from
Nov 24, 2017

Conversation

maciaszczykm
Copy link
Member

Closes #2603.

@maciaszczykm maciaszczykm self-assigned this Nov 21, 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 21, 2017
@bryk
Copy link
Contributor

bryk commented Nov 21, 2017

I'll review tomorrow.

@maciaszczykm
Copy link
Member Author

@bryk It's a bit too early for a review. It would be better for you to wait for frontend part :)

@bryk
Copy link
Contributor

bryk commented Nov 22, 2017

:)

Backend code looks good. For the frontend, how about we put it in an action bar-like thing on the top. Or below the blue part.

I think I prefer below the blue part. Your opinions?

@maciaszczykm
Copy link
Member Author

@bryk I agree.

}

// GetSeverity returns one of allowed severity values based on given parameter.
func GetSeverity(severity string) string {
Copy link
Member

Choose a reason for hiding this comment

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

I'd add type that maps to a string (i.e. type BannerSeverity string) so we can return our type here. It's easier to find out correct values later on.

Maybe also use a switch on string here as it feels like a perfect place for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

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.

)

// SettingsManager is used for user settings management.
type SettingsManager interface {
Copy link
Member

Choose a reason for hiding this comment

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

SettingsManager?

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.

@codecov
Copy link

codecov bot commented Nov 22, 2017

Codecov Report

Merging #2607 into master will decrease coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2607      +/-   ##
==========================================
- Coverage   54.18%   54.18%   -0.01%     
==========================================
  Files         563      563              
  Lines       12108    12124      +16     
==========================================
+ Hits         6561     6569       +8     
- Misses       5289     5297       +8     
  Partials      258      258
Impacted Files Coverage Δ
src/app/backend/handler/apihandler.go 26.6% <100%> (+0.11%) ⬆️
src/app/frontend/chrome/component.js 51.51% <38.46%> (-8.49%) ⬇️

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 38e6827...270b2c5. Read the comment docs.

@bryk
Copy link
Contributor

bryk commented Nov 23, 2017

Ping me when this is ready for rereview.

@maciaszczykm
Copy link
Member Author

image

image

@maciaszczykm maciaszczykm changed the title [WIP] Create system banner API handler Create system banner API handler Nov 23, 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 23, 2017
@maciaszczykm
Copy link
Member Author

@bryk PTAL

@bryk
Copy link
Contributor

bryk commented Nov 24, 2017

I think we should make this banner 48px. It looks alike other toolbars. 24px seemed too small to me. WDYT?

selection_001


/**
* @export
* @return {*}
Copy link
Contributor

Choose a reason for hiding this comment

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

{sting}? If possible

Copy link
Member

@floreks floreks Nov 24, 2017

Choose a reason for hiding this comment

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

Unfortunately not as trustAsHtml does not have precise return type and it can be {Object|string|null}. https://docs.angularjs.org/api/ng/service/$sce#trustAsHtml

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately not possible.

@maciaszczykm
Copy link
Member Author

zrzut ekranu 2017-11-24 o 11 17 26

Copy link
Contributor

@bryk bryk 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 7c26f88 into kubernetes:master Nov 24, 2017
@maciaszczykm maciaszczykm deleted the system-banner branch November 24, 2017 10:42
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants