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

Added hasPreviousStep and hasNextStep to StepComponent #76

Closed
wants to merge 2 commits into from

Conversation

Bird87ZA
Copy link

I've added functionality to be able to see if there are succeeding or preceding steps in the wizard.

This is useful because it allows you to have the following:

@if ($this->hasPreviousStep())
    <button wire:click="previousStep">
        {{ __('Back') }}
    </button>
@endif

@if ($this->hasNextStep())
    <button wire:click="nextStep">
        {{ __('Next') }}
    </button>
@else
    <button wire:click="submit">
        {{ __('Create') }}
    </button>
@endif

I do have some hardship though. I've tried testing it, but I can not get it working. I've added this to a 'parent' component that inherits from the StepComponent in my project, and have manually tested it. Assistance here will be appreciated - I've committed my approach to the test.

@freekmurze
Copy link
Member

Since this PR does not have tests, I'm going to pass on it for now.

Add the functions to your own projects.

@freekmurze freekmurze closed this Mar 27, 2023
@Bird87ZA
Copy link
Author

Hi Freek, appreciate the comment, but did you read my note? I tried adding tests, but it didn't work because I don't 100% understand how to make the tests work.

A pointer in what I could be doing wrong would be great.

@Bird87ZA Bird87ZA mentioned this pull request Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants