profile
viewpoint
Ryan Scovill ryanscovill @safesoftware Vancouver, BC ryanscovill.com Student with a passion to develop amazing apps | Measuring programming progress by lines of code is like measuring aircraft building progress by weight~Gates

AdamBignell/downtoanything 2

CMPT-276 Web App Project

ben4num/smartbee 2

Ethereum Dapp - NWHack 2018 Wolfram Winner

CMPT106Beta/study-finder 1

Android app that allows students to create and join study groups

NathanToporek/nwhacks2017 1

repo for our team to work on code for the nwhacks hackathon.

AdamBignell/RelNet 0

Final project for CMPT 419

aptmac/Hackentines2016 0

Lonely Lucy on Valentines - Simple Coin-change Style Android Game

ryanscovill/angular 0

One framework. Mobile & desktop.

ryanscovill/azure-storage-python 0

Microsoft Azure Storage Library for Python

ryanscovill/chlorine-dosage-calculator 0

Tool for calculating chlorine dosage

issue commentlaravel/nova-issues

Soft deleting an Actionable model causes its ActionEvent history to be deleted permanently

This is how I think it should work.

  • Soft deleting a resource: No changes to existing ActionEvents
  • Restoring a resource: No changes to existing ActionEvents
  • Force deleting a resource: Force delete existing ActionEvents

With the expected behavior in mind, I think it makes sense for ActionEvent to continue not using SoftDeletes trait.

murat906

comment created time in 3 hours

issue openedlaravel/nova-issues

Include redirectAfterCreate/redirectAfterUpdate into official documentation

Missing inside the docs: Include redirectAfterCreate/redirectAfterUpdate into official documentation

Example

created time in 4 hours

issue closedlaravel/nova-issues

Listing ActionEvents on Resource screen breaks when custom auth guard is defined

  • Laravel Version: 8.5.1
  • Nova Version: 3.15.0
  • PHP Version: 7.4.9
  • Database Driver & Version: MySQL 5.7.30
  • Operating System and Version:MacOS 10.14.6
  • Browser type and version: Safari 14.0.1
  • Reproduction Repository: https://github.com/###/###

Description:

My application has two authentication systems – one for members who register on the public site, and one for administrative users who use Nova.

The front end authentication system uses a Member model while Nova uses the conventional User model.

To facilitate this I have two guards defined in config.auth.guards. The public guard for members is defined on config.auth.guards.web and the Nova guard is defined on config.auth.guards.nova.

It looks like this…

'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'members',
        'passwords' => 'members',
    ],

    'nova' => [
        'driver' => 'session',
        'provider' => 'users',
        'passwords' => 'users',
    ],
],

I have two corresponding auth providers defined on config.auth.providers which looks like this…

'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => App\Models\User::class,
    ],

    'members' => [
        'driver' => 'eloquent',
        'model' => App\Models\Member::class,
    ],
],

The Nova authentication guard is defined in config.nova.guard' It looks like this…

'guard' => 'nova',

There are several actions available to Users in the Nova admin system. When viewing a Resource which has been the target of an Action, the Actions table fails to render and I see the following error…

"Class name must be a valid object or string"

Having followed the stack trace I have pinpointed the source of the error to line 46 of Nova\Actions\ActionEvent where the user() method is defined as follows…

/**
 * Get the user that initiated the action.
 */
public function user()
{
    return $this->belongsTo(
        config('auth.providers.'.(config('nova.guard') ?? 'users').'.model'), 'user_id' // <-- Line 46
    );
}

When the default authentication guards are used this works fine but changing the auth guard as I have done breaks the path retrieval for the auth.providers.xxxxx.model attribute. This is easily corrected by replacing line 46 as follows…

public function user()
{
    return $this->belongsTo(
        config('auth.providers.'.(config('auth.guards.'.(config('nova.guard') ?? 'users').'.provider')).'.model') // <-- Line 46
    );
}

Detailed steps to reproduce the issue on a fresh Nova installation:

Define a new authentication guard in config.auth. (It can use the default provider.)

'guards' => [
    'web' => [
        'driver' => 'session',
        'provider' => 'users',
    ],
    
    'nova' => [
        'driver' => 'session',
        'provider' => 'users',
    ],
],

Edit config.nova.guard to use the newly defined auth guard.

 'guard' => 'nova',

Generate and register a new Action.

Log in to Nova and perform the action.

Navigate to the Resource upon which the action was performed.

The Actions table fails to render and an error message is displayed.

closed time in 4 hours

duncmc

issue closedlaravel/nova-issues

when i switch between lenses with url the filters are not reloaded accordingly

  • Laravel Version: 7.0
  • Nova Version: 3.7
  • PHP Version: 7.2

I have 3 lenses each one of them contains specific filters when I switch between them with URL the filters of the first lens will be applied as expected but then when you change to another lens the filters will remain the exact same even if some filters do not exist in the lens that you just switched to!!!

filters of the first lense

	public function filters(Request $request)
	{
		return [
			(new OrderCountry),
			(new OrderCreatedAtStartDate),
			(new OrderCreatedAtEndDate),
			(new OrderUpdatedAtStartDate),
			(new OrderUpdatedAtEndDate),
		];
	}

filters of the second lens

	public function filters(Request $request)
	{
		return [
     		(new OrderWebsite(['pending'])),
			(new OrderWebsiteExcept),
		];
	}

filters of the third lens

	public function filters(Request $request)
	{
		return [
			(new OrderItemSize),
			(new OrderItemType),
			(new OrderItemTypeExcept),
			(new OrderItemBrand),
			(new OrderItemBrandExcept),
		];
	}

when I load the first lense

image

when I load the second lense

image

I'm getting the exact same filters even those filters are not in the new lense

I'm using links in the sidebar to switch between the lenses as below

image

closed time in 4 hours

osamaAbdullah

issue closedlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

  • Laravel Version: 7.29.3
  • Nova Version: 3.15.0
  • PHP Version: 7.4.11
  • Database Driver & Version:
  • Operating System and Version: windows 10 pro
  • Browser type and version: Chrome 73

Description:

In nova-dusk where we have to register global selectors or override the Laravel\Nova\Testing\Browser\Pages\Page;;

Detailed steps to reproduce the issue on a fresh Nova installation:

Visit any resource eg: Create which extends Laravel\Nova\Testing\Browser\Pages\Page;

closed time in 6 hours

shashitejatripurari

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

Tested with https://github.com/nova-issues/issue-3070/commit/bd6f65c64826f6f592d607760c999182386c76fb and have no issue using @file or other selectors.

image

shashitejatripurari

comment created time in 6 hours

issue openedlaravel/nova-issues

&users_per_page= not adhered to on page refresh

  • Laravel Version: 7.29.3
  • Nova Version: 3.15.0
  • PHP Version: 7.4.12
  • Database Driver & Version: mySQL 5.7.28
  • Operating System and Version: macOS Catalina 10.15.7 (19H15)
  • Browser type and version: Chrome 87.0.4280.67
  • Reproduction Repository: n/a

Description:

When visiting a resource page I am able to change the Per Page drop down to load more than the default number of records. When I do this, ?users_per_page=[chosen option] is appended to the URL.

However, if I refresh this page, ?users_per_page= is ignored.

I would like and expect this value to be recognised and utilised, especially since I can link to other filter options by serialising that data. Alternatively, I would expect ?users_per_page= to be handled in the same way as the other filter options (i.e. by being passed as a serialised string).

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. Visit a fresh resource page (e.g. Users).
  2. Change the Per Page option to something other than the default (e.g. 100).
  3. Observe that more rows are loaded successfully.
  4. Refresh the page.
  5. Observe that the URL still has ?users_per_page=[chosen option] in it, but value in the Per Page option has reverted back to the default and the number of rows loaded also adheres to the default.

created time in 6 hours

issue commentlaravel/nova-issues

Closing parenthesis doesn't properly show in action modal help text

Gues we will wait on those people, thanks for investigating!

preliot

comment created time in 7 hours

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

Post a reproducing code so I can check the issue. Still not clear or understand if there any issue to begin with.

I do see why you need to register siteElements(), you can use @{field.attribute} directly for FileField (if I understand the error correctly). Most file tests in nova-dusk-suite uses file as attribute so that why there's [dusk="file"] in the tests.

This is not only with @file selector but with other selectors too

shashitejatripurari

comment created time in 8 hours

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

Actual test file namespace Tests\Browser\Documents;

use Laravel\Dusk\Browser; use Laravel\Nova\Testing\Browser\Pages\Create; use Tests\DuskTestCase;

class CreateDocumentResourceTest extends DuskTestCase { /** * A Dusk test example. * * @return void */ public function testCreateDocumentResource() { $this->browse(function (Browser $browser) { $browser->loginAs(1) ->visit(new Create('documents')) ->waitForText('Create Document', 60) ->type('@name', 'test-document') ->attach('@file', base_path('storage/seeds/test_image.png')) ->create() ->waitForText('The document was created', 60); }); } }

Reference files

create.php file from vendor which is used in CreateDocumentResourceTest.php

namespace Laravel\Nova\Testing\Browser\Pages;

use Laravel\Dusk\Browser; use Laravel\Nova\Nova;

class Create extends Page { use HasSearchableRelations;

public $resourceName;

/**
 * Create a new page instance.
 *
 * @param  string  $resourceName
 * @return void
 */
public function __construct($resourceName)
{
    $this->resourceName = $resourceName;
}

/**
 * Get the URL for the page.
 *
 * @return string
 */
public function url()
{
    return Nova::path().'/resources/'.$this->resourceName.'/new';
}

/**
 * Run the inline create relation.
 */
public function runInlineCreate(Browser $browser, $uriKey, callable $fieldCallback)
{
    $browser->click("@{$uriKey}-inline-create")->pause(500);

    $browser->elsewhere('.modal', function ($browser) use ($fieldCallback) {
        $fieldCallback($browser);

        $browser->create()->pause(250);
    });
}

/**
 * Click the create button.
 */
public function create(Browser $browser)
{
    $browser->click('@create-button')->pause(500);
}

/**
 * Click the create and add another button.
 */
public function createAndAddAnother(Browser $browser)
{
    $browser->click('@create-and-add-another-button')->pause(500);
}

/**
 * Assert that the browser is on the page.
 *
 * @param  Browser  $browser
 * @return void
 */
public function assert(Browser $browser)
{
    $browser->pause(500);
}

/**
 * Assert that there are no search results.
 */
public function assertNoRelationSearchResults(Browser $browser, $resourceName)
{
    $browser->assertMissing('@'.$resourceName.'-search-input-result-0');
}
shashitejatripurari

comment created time in 8 hours

issue commentlaravel/nova-issues

Closing parenthesis doesn't properly show in action modal help text

Perhaps the Nova font doens't have italic and the browser tries to implent it's own? When i set the font to 'sans-serif' the issue is also gone.

Had verified there a bug with font https://github.com/googlefonts/nunito/issues/26

preliot

comment created time in 8 hours

issue closedlaravel/nova-issues

Add a suffix to Partition Metric

  • Laravel Version: 8.15.0
  • Nova Version: 3.15.0
  • PHP Version: 7.4
  • Database Driver & Version: Psql
  • Operating System and Version: ubuntu 20.04
  • Browser type and version: Chrome

Description:

Screenshot from 2020-11-24 11-23-37

I use partition metrics to display quantity and not counts. In my case, a user uses 13.43% of solar energy, and 86.57% from the grid. I need the quantity to be in kWh like below:

Conso réseau (58 kWh - 86.57%)
Autoconsomation (9 kWh - 13.43%)
(67 kWh total)

Is it possible ?

closed time in 8 hours

xoco70

issue commentlaravel/nova-issues

Add a suffix to Partition Metric

👋 Hi there! In order to keep this repository focused on bug reports, we auto-close feature requests and requests for help. Feel free to post your feature requests so others can discuss and add reactions. We'll keep an eye on them for later planning.

xoco70

comment created time in 8 hours

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

Post a reproducing code so I can check the issue. Still not clear or understand if there any issue to begin with.

shashitejatripurari

comment created time in 8 hours

issue openedlaravel/nova-issues

Add a suffix to Partition Metric

  • Laravel Version: 8.15.0
  • Nova Version: 3.15.0
  • PHP Version: 7.4
  • Database Driver & Version: Psql
  • Operating System and Version: ubuntu 20.04
  • Browser type and version: Chrome

Description:

Screenshot from 2020-11-24 11-23-37

I use partition metrics to display quantity and not counts. In my case, a user uses 25% of solar energy, and 75% from the grid. I need the quantity to be in kWh like below:

Conso réseau (58 kWh - 86.57%)
Autoconsomation (9 kWh - 13.43%)
(67 kWh total)

Is it possible ?

created time in 8 hours

issue commentlaravel/nova-issues

Closing parenthesis doesn't properly show in action modal help text

Perhaps the Nova font doens't have italic and the browser tries to implent it's own? When i set the font to 'sans-serif' the issue is also gone.

preliot

comment created time in 8 hours

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

In 3.14 version nova-dusk-suite is included for testing which comes with the above file in vendor folder, now how do I register the global selectors in this file?

What's not possible now? I haven't test it out but you should be able to extends the method normally, and you just using this to test your Nova app, right?

Yeah I'm using to test for my Nova app, now I'm not able to use those as mentioned in the document dusk#global-shorthand-selectors and gets the below error

bug-selector

shashitejatripurari

comment created time in 8 hours

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

In 3.14 version nova-dusk-suite is included for testing which comes with the above file in vendor folder, now how do I register the global selectors in this file?

What's not possible now? I haven't test it out but you should be able to extends the method normally, and you just using this to test your Nova app, right?

shashitejatripurari

comment created time in 9 hours

issue commentlaravel/nova-issues

Closing parenthesis doesn't properly show in action modal help text

image

image

It seem to be an issue with font-style: italic with the font. Will communicate with the team on how to handle this.

preliot

comment created time in 9 hours

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

namespace Tests\Browser\Pages;

use Laravel\Nova\Testing\Browser\Pages\Page as BasePage;

abstract class Page extends BasePage { /** * Get the global element shortcuts for the site. * * @return array */ public static function siteElements(): array { return [ '@file' => '#__media__files', '@custom-input' => 'input.w-full.form-control.form-input.form-input-bordered.input' ]; } }

before nova 3.14 version nova-dusk-suit was not included for testing, so I have added few global selectors in the above file stored in tests/Browser/Pages/ where I can use the selectors in all the dusk test pages.

In 3.14 version nova-dusk-suite is included for testing which comes with the above file in vendor folder, now how do I register the global selectors in this file?

I tried to override this Class but it requires URL method stub function as mandatory, I think this function is not required to register the elements globally, then what is the solution for it?

shashitejatripurari

comment created time in 11 hours

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

<?php

namespace Tests\Browser\Pages;

use Laravel\Nova\Testing\Browser\Pages\Page as BasePage;

abstract class Page extends BasePage { /** * Get the global element shortcuts for the site. * * @return array */ public static function siteElements(): array { return [ '@file' => '#__media__files', '@custom-input' => 'input.w-full.form-control.form-input.form-input-bordered.input' ]; } }

before nova 3.14 version nova-dusk-suit was not included for testing, so I have added few global selectors in the above file stored in tests/Browser/Pages/ where I can use the selectors in all the dusk test pages.

In 3.14 version nova-dusk-suite is included for testing which comes with the above file in vendor folder, now how do I register the global selectors in this file?

I tried to override this Class but it requires URL method stub function as mandatory, I think this function is not required to register the elements globally, then what is the solution for it?

shashitejatripurari

comment created time in 11 hours

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

Please provide detail about the issue. What do you mean by In nova-dusk where we have to register global selectors or override the Laravel\Nova\Testing\Browser\Pages\Page;

<?php

namespace Tests\Browser\Pages;

use Laravel\Nova\Testing\Browser\Pages\Page as BasePage;

abstract class Page extends BasePage { /** * Get the global element shortcuts for the site. * * @return array */ public static function siteElements(): array { return [ '@file' => '#__media__files', '@custom-input' => 'input.w-full.form-control.form-input.form-input-bordered.input' ]; } }

before nova 3.14 version nova-dusk-suit was not included for testing, so I have added few global selectors in the above file stored in tests/Browser/Pages/ where I can use the selectors in all the dusk test pages.

In 3.14 version nova-dusk-suite is included for testing which comes with the above file in vendor folder, now how do I register the global selectors in this file?

I tried to override this Class but it requires URL method stub function as mandatory, I think this function is not required to register the elements globally, then what is the solution for it?

shashitejatripurari

comment created time in 11 hours

issue openedlaravel/nova-issues

Closing parenthesis doesn't properly show in action modal help text

  • Laravel Version: 7.28.4
  • Nova Version: 3.14.0
  • PHP Version: 7.2.19
  • Database Driver & Version: 5.7.24
  • Operating System and Version: Windows 10 (64 bits)
  • Browser type and version: Chrome (latest), Firefox (latest)

Description:

Closing parenthesis ')' doens't show properly in help text. Observed this in latest chrome and firefox. See example:

image

translation file:


\\..
 'ExportOrderRemarkHelp' => 'Inclusief het order veld "Opmerking koper" (<strong>vinkje aan</strong>). Dit is het opmerking veld van een order.',
'ExportOrderItemRemarkHelp' => 'Inclusief het order artikel veld "Opmerking" (<strong>vinkje aan</strong>). Dit is het opmerking veld op artikel niveau.',

Couldn't find the cause, perhaps i'm making an obvious error? Tried to replace <strong> with <b>, same effect.

created time in 11 hours

issue commentlaravel/nova-issues

Soft deleting an Actionable model causes its ActionEvent history to be deleted permanently

Can you update the issue with following details, I see what you expect to see on softdelete and restore, but what about softdelete and force delete:

### Current Behavior

* Soft deleting resource will delete all action_events for the resource.
* Force deleting resource will delete all action_events for the resource.

### Expected Behavior

<!-- Can you provide what you would assume the expected behavior . -->
murat906

comment created time in 15 hours

issue closedlaravel/nova-issues

Overriding indexQuery() to use include withTrashed() throws an error on action responses

  • Laravel Version: 7.29.3
  • Nova Version: 3.15.0
  • PHP Version: 7.4.2
  • Database Driver & Version: MySQL 8.0.19
  • Operating System and Version: Ubuntu 18.04.3

Description:

I'm overriding a Nova resource to always include withTrashed().

    // Override the index query to show trashed
    public static function indexQuery(NovaRequest $request, $query)
    {
        return $query->withTrashed();
    }

This works fine to always include soft deleted models on index listings inside Nova.

With the latest update, I now get an error when running an action against a resource.

Call to undefined method Illuminate\Database\Eloquent\Builder::withTrashed()

Call to undefined method Illuminate\\Database\\Eloquent\\Builder::withTrashed() at /.../vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:50)

Perhaps there's a better way to override the index query to always include withTrashed() - but for now, as a temporary workaround, I've adjusted indexQuery() to this:

    // Override the index query to show trashed
    public static function indexQuery(NovaRequest $request, $query)
    {
        if(!isset($request->action)){
            return $query->withTrashed();
        }
        return $query;
    }

Is it possible that this is related to:

"Nova will now apply indexQuery to make selecting resources and select all matching more consistent when not viewing from viaRelationship. #1060" In the latest release?

closed time in 16 hours

alexpgates

issue commentlaravel/nova-issues

Nova Version - cant know current version of the Nova

Why don't you use tinker?

php artisan tinker and then Laravel\Nova\Nova::version();

Thanks, @ivanderbu2

h-zone

comment created time in 16 hours

issue commentlaravel/nova-issues

Overriding indexQuery() to use include withTrashed() throws an error on action responses

@crynobone That works! Thank you for providing a better solution. I really appreciate your help.

alexpgates

comment created time in 19 hours

issue commentlaravel/nova-issues

Nova-Dusk-Registering-Global-Elements

Please provide detail about the issue. What do you mean by In nova-dusk where we have to register global selectors or override the Laravel\Nova\Testing\Browser\Pages\Page;

shashitejatripurari

comment created time in 19 hours

issue commentlaravel/nova-issues

Overriding indexQuery() to use include withTrashed() throws an error on action responses

Perhaps there's a better way to override the index query to always include withTrashed()

Resource come with filter that allows you to toggle between the options. So that's not a good default.

but for now, as a temporary workaround, I've adjusted indexQuery() to this

This seem to be a good solution, but I would tweak it as:

use Laravel\Nova\Http\Requests\ActionRequest;

    /**
     * Build an "index" query for the given resource.
     *
     * @param  \Laravel\Nova\Http\Requests\NovaRequest  $request
     * @param  \Illuminate\Database\Eloquent\Builder  $query
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public static function indexQuery(NovaRequest $request, $query)
    {
        if (! $request instanceof ActionRequest) {
            return $query->withTrashed();
        }

        return $query;
    }

You can refer to https://github.com/laravel/nova-issues/issues/2266 to see why the changes has been added.

alexpgates

comment created time in 19 hours

issue closedlaravel/nova-issues

Code Field not allow to paste anything

  • Laravel Version: 8
  • Nova Version: 3.12
  • PHP Version: 7.4
  • Database Driver & Version: MySQL 8
  • Operating System and Version: Ubuntu 20.04
  • Browser type and version: Chrome 87

Description:

The code field not allow you to paste anything, there is a way to allow this?

My Code:

Code::make('Footer')->language('javascript'),

closed time in 21 hours

regiszanandrea
more