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

Add guards to node details networking functions. #986

Merged
merged 1 commit into from
Apr 17, 2020

Conversation

Caleb-Ellis
Copy link
Contributor

@Caleb-Ellis Caleb-Ellis commented Apr 16, 2020

Done

  • Added guards to a few node details networking functions.
  • Removed a bit of broken markup (which actually might have been the cause of all the errors - angular templating tracebacks have never been very helpful)

QA

  • This one is hard to QA because I couldn't reliably reproduce the errors. I did get the type is not defined one a couple of times, each after marking an interface as connected or disconnected. So I'm not sure... click around on all the different buttons, add/delete interfaces, bridges, bonds... and check that you don't get any errors in the console?

Fixes

Fixes #892
Fixes #893

Copy link
Contributor

@squidsoup squidsoup left a comment

Choose a reason for hiding this comment

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

Thanks @Caleb-Ellis. Looks good, although we should probably fix the GA handler 👀

@@ -2277,7 +2277,7 @@ <h2 class="p-heading--four">Create bond</h2>

<button class="p-button--neutral" data-ng-click="toggleInterfaces()" data-ng-if="showCreateEditButton()">
<span data-ng-if="isShowingInterfaces">Hide interfaces</span>
<span data-ng-if="!isShowingInterfaces" data-ng-click="Network table', Edit bond')">Edit bond members</span>
Copy link
Contributor

@squidsoup squidsoup Apr 17, 2020

Choose a reason for hiding this comment

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

We should probably preserve this GA handler, so I guess it should be (most of the examples of calling this function in our code are wrong unfortunately...):

data-ng-click="sendAnalyticsEvent('bond', 'edit', 'network table')"

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, let's keep this consistently wrong, until we do our total GA fixup, so this should be

sendAnalyticsEvent('Machine details', 'Edit bond', 'Network tab')

@Caleb-Ellis Caleb-Ellis merged commit 93e0947 into canonical:master Apr 17, 2020
@Caleb-Ellis Caleb-Ellis deleted the type-error branch April 17, 2020 03:24
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.

TypeError: e is undefined TypeError: Cannot read property 'type' of undefined
2 participants