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

Validation for pf-wizard is a bit kludgy #1707

Closed
benjaminapetersen opened this issue Jun 14, 2017 · 3 comments
Closed

Validation for pf-wizard is a bit kludgy #1707

benjaminapetersen opened this issue Jun 14, 2017 · 3 comments
Labels
area/techdebt kind/bug Categorizes issue or PR as related to a bug. priority/P3

Comments

@benjaminapetersen
Copy link
Contributor

benjaminapetersen commented Jun 14, 2017

Most angular validation can be done fairly cleanly in markup. This feels a bit hacky to me:

var validityWatcher;
// ...
// in a setup fn:
validityWatcher = $scope.$watch("ctrl.selectionForm.$valid", function(isValid) {
     ctrl.steps[0].valid = isValid;
});
// ... 
// in another fn:
      if (validityWatcher) {
        validityWatcher();
        validityWatcher = undefined;
      }
// 
// in a cleanup fn:
    ctrl.$onDestroy = function() {
      if (validityWatcher) {
        validityWatcher();
        validityWatcher = undefined;
      }
// ...

We have more than one form following this pattern now, ideally we can figure out a way to push it back up into markup.

@jeff-phillips-18 shall I open a patternfly issue as well to track?

@benjaminapetersen
Copy link
Contributor Author

Re PR #1705, comments here and a few preceding.

@benjaminapetersen benjaminapetersen added area/techdebt kind/bug Categorizes issue or PR as related to a bug. priority/P3 labels Jun 14, 2017
@benjaminapetersen
Copy link
Contributor Author

Another item I'd like to address is:

step. nextTitle = 'Foo';

Could we rename it to:

ctrl.nextButtonText = 'Foo';

or something less verbose but a bit more clear. "Next Title" seems to imply it will be the title for the next panel, when in fact, it is the text on the button in this panel, but clicking it will progress the user through the steps of the wizard.

Open for discussion.

@spadgett
Copy link
Member

Closing this issue since we've opened issues upstream in angular-patternfly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/techdebt kind/bug Categorizes issue or PR as related to a bug. priority/P3
Projects
None yet
Development

No branches or pull requests

2 participants