Giter Site home page Giter Site logo

Comments (6)

wdelfuego avatar wdelfuego commented on July 21, 2024 1

Sorry for the confusion, I've been working too much on nova-calendar 🙈.

I meant "2. At what URL are you trying to open your wizard?"
I guess the same URL as you mentioned under 3?

from nova-wizard.

wdelfuego avatar wdelfuego commented on July 21, 2024

I've updated my local installation to use that same uri but everything keeps working, so the problem is not with the custom uri.

403 indicates an authorization / authentication problem; the issue might be related to your Nova path.

If you can answer the following questions we'll probably find the issue:

  1. What is the path option set to in config/nova.php?
  2. At what complete URL are you trying to open your calendar?
  3. Do you see the link to your "Create Community" wizard added to your Nova menu? If so, what path is it pointing to?
  4. Did you add the wizard link to the menu manually, or are you using Nova's automatic menu generation?

from nova-wizard.

adrian-schnell avatar adrian-schnell commented on July 21, 2024

Thanks for your quick reply.

  1. path ist set to 'path' => '/admin_backend',
  2. open calendar? don't understand what you mean 🫣
  3. it's pointing to https://domain.test/admin_backend/setup/create-community
  4. right now I added it manually:
    MenuItem::link(__('backend/sidebar_menu.community_wizard'), NovaWizard::pathToWizard('create-community')),

when adding it as tool with new NovaWizard('create-community') it links to https://domain.test/admin_backend/nova-wizard

and inside the wizard config:

return [
    'create-community' => [
        'class'       => CreateCommunityWizard::class,
        'uri'         => 'setup/create-community',
        'windowTitle' => 'Create your Community now',
    ],
];

from nova-wizard.

wdelfuego avatar wdelfuego commented on July 21, 2024

I've recreated your setup but everything works for me.

However, I do get a 403 if I remove the Tool from the array returned by tools() in the NovaServiceProvider.

Can you check again if you performed step 4 of the installation instructions completely?
I.e., are you including new NovaWizard('create-community') in the array returned by the tools() method?

from nova-wizard.

adrian-schnell avatar adrian-schnell commented on July 21, 2024

indeed the tool was missing as I understood it to either add it as tool or as link.

Now I added the tool as well.
The link is still added manually. Sorry was a misunderstood of my side 🫣

But now I've a followup problem:
The window remains empty except the navigations. In the console there's this error:
Bildschirmfoto 2023-11-10 um 09 20 09

In the class I copied the demo content:

<?php

namespace App\Nova\Wizard;

use Laravel\Nova\Fields;
use Wdelfuego\NovaWizard\AbstractWizard;

class CreateCommunityWizard extends AbstractWizard
{
    public function wizardViewData(): array
    {
        return [
            'steps' =>
                [
                    'title'  => 'Step 1/2',
                    'fields' => [
                        Fields\Text::make(__('Username'), 'username'),
                        Fields\Text::make(__('Text field'), 'myText'),
                        Fields\Textarea::make(__('Longer text'), 'myLongerText')
                            ->help("You can use Help texts on Nova fields like you're used to"),
                        Fields\Number::make(__('Some number'), 'myNumber')
                            ->rules('required')
                            ->withMeta(['value' => 60])
                            ->min(1)
                            ->step(1),
                    ],
                ],
            [
                'title'  => 'Step 2/2',
                'fields' => [
                    Fields\Text::make(__('Text field 2'), 'myText2'),
                    Fields\Textarea::make(__('Longer text 2'), 'myLongerText2')
                        ->help("You can use Help texts on Nova fields like you're used to"),
                    Fields\Number::make(__('Some number 2'), 'myNumber2')
                        ->rules('required')
                        ->withMeta(['value' => 60])
                        ->min(1)
                        ->step(1),
                ],
            ],
        ];
    }

    public function onSubmit($formData, &$context): bool
    {
        return true;
    }

    public function successViewData($context): array
    {
        return [
            'message' => 'Success! Your Community has been created.',
        ];
    }
}

from nova-wizard.

wdelfuego avatar wdelfuego commented on July 21, 2024

Thanks for letting me know. If you think the documentation can be improved, feel free to create a PR!

I've created a new issue for your Javascript error.

from nova-wizard.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.