Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor CSS classes of wizard step indicators #181

Merged
merged 12 commits into from
Mar 17, 2019

Conversation

earshinov
Copy link
Contributor

Please see #124 for the relevant discussion.

// Removing this definition now will allow to navigate to every step the user is able to navigate with the [awGoToStep] directive.
// For example, right after opening the wizard with basic configuration, the user would be able to go to the second step
// by clicking its indicator in the navigation bar instead of using the [Next] button. This behavior is undesireable.
pointer-events: auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mind the comment. I wanted to get rid of the pointer-events styling on my way, but could not.

Copy link
Owner

Choose a reason for hiding this comment

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

Hmmm, I'm not sure I understand the problem.

I mean the current navigation mode interface contains two methods to check whether a navigation from a current step to a destination step can be performed:

  • canGoToStep: this method is called for "normal" transitions, which are normally performed when the navigation directives are used
  • isNavigable: this method performs an additional check for the navigation using the navigation bar

To disable the navigation using the navigation bar we should just need to improve the isNavigable method, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To disable the navigation using the navigation bar we should just need to improve the isNavigable method, right?

The method itself is fine, the problem is that it is only called to set CSS classes. It is not used when a user clicks a step indicator, and I believe it should be.

When checking whether the user can navigate to a step, we should not rely on CSS classes that are supposed to set pointer-events: none to silence the [awGoToStep] directive (the one used by the navigation bar internally). Instead, we should probably make the [awGoToStep] conditional so that it only takes effect when needed, no matter what is happening on the presentation level (CSS).

Perhaps, users will also find use cases for conditional goTo*Step directives.

Having said that, I think the best action now is to remove this comment and leave pointer-events: none intact because this change:

  1. has little to do with the purpose of this PR and is better to be done separately / later
  2. has no purpose from the perspective of the end users.
  3. will affect the NavigationMode's part of the code source code, which is already being refactored in Refactor the hierarchy of NavigationMode classes. #166 and Add step change and disabled step option #178, and will complicate matters even further.

Shall I remove the comment?

Copy link
Owner

Choose a reason for hiding this comment

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

I agree.
Let's remove the comment and solve the problem in another PR/issue.

Copy link
Contributor Author

@earshinov earshinov Dec 25, 2018

Choose a reason for hiding this comment

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

Done in b9b48b5 and 7a992dc (vertical layout)

@earshinov
Copy link
Contributor Author

earshinov commented Dec 24, 2018

Note that the bug from #182 is carefully preserved.

@madoar
Copy link
Owner

madoar commented Dec 24, 2018

I'll take a detailed look at the changes of the PR tomorrow

Conflicts:
	src/lib/components/wizard-navigation-bar.component.spec.ts
	src/lib/components/wizard-navigation-bar.component.ts
@earshinov earshinov changed the title Refactor CSS classes of wizard step indicators WIP: Refactor CSS classes of wizard step indicators Mar 17, 2019
@earshinov
Copy link
Contributor Author

earshinov commented Mar 17, 2019

Marked as WIP because the styling is currently done for the horizontal layout only.

Sorry, I forgot that I have actually updated the vertical layout as well :-/

@earshinov
Copy link
Contributor Author

Hello @madoar ,

Sorry I have missed your earlier comments on my changes.

Anyway, 4.0.0 is great news for us, because thanks to clickable step indicators and [awWizardStepSymbol] we could finally get rid of our own fork.

May I ask what plans you have for angular-archwizard for the nearest future? It would be nice if we could merge either #181 (this issue) or #166 .

@earshinov earshinov changed the title WIP: Refactor CSS classes of wizard step indicators Refactor CSS classes of wizard step indicators Mar 17, 2019
@madoar madoar merged commit db439a9 into madoar:develop Mar 17, 2019
@earshinov earshinov deleted the refactor-step-css-classes branch March 17, 2019 16:10
@madoar
Copy link
Owner

madoar commented Mar 17, 2019

@earshinov thank you for your updates!

For the next release of angular-archwizard I would like to include the following issues:

In addition I'm thinking about including some of the following features:

If you have any other changes you would like to see feel free to open an issue or a PR!

@madoar
Copy link
Owner

madoar commented Mar 17, 2019

@earshinov do you know if the demo repository is compatible with the changes introduced by this PR?

@earshinov
Copy link
Contributor Author

@madoar , Custom step CSS example in the demo needs to be updated.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants