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

Only show + icon when we have at least one connected CF #3211

Merged
merged 5 commits into from
Nov 22, 2018

Conversation

nwmac
Copy link
Contributor

@nwmac nwmac commented Nov 19, 2018

Fixes #2714

@nwmac nwmac self-assigned this Nov 19, 2018
@cfdreddbot
Copy link

✅ Hey nwmac! The commit authors and yourself have already signed the CLA.

@codecov
Copy link

codecov bot commented Nov 19, 2018

Codecov Report

Merging #3211 into v2-master will increase coverage by <.01%.
The diff coverage is 73.33%.

@@             Coverage Diff              @@
##           v2-master   #3211      +/-   ##
============================================
+ Coverage      71.09%   71.1%   +<.01%     
============================================
  Files            632     632              
  Lines          27752   27753       +1     
  Branches        6314    6315       +1     
============================================
+ Hits           19731   19734       +3     
+ Misses          8021    8019       -2


this.haveConnectedCf$ = cloudFoundryService.cFEndpoints$.pipe(
map(endpoints => endpoints.map(endpoint => endpoint.connectionStatus === 'connected')),
map(connected => connected.reduce((a, v) => a || v, false))
Copy link
Contributor

Choose a reason for hiding this comment

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

Something like !!connected.find(isConnected => isConnected) would be more efficient.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or even just !!endpoints.find(endpoint => endpoint.connectionStatus === 'connected'))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - I just used what we had in the CF page - but can have a look at simplifying

@KlapTrap KlapTrap merged commit d37ac18 into v2-master Nov 22, 2018
@KlapTrap KlapTrap deleted the service-hide-add-no-cf branch November 22, 2018 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants