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

Data Options button on card report #130

Open
ftrotter opened this issue Jul 16, 2020 · 3 comments
Open

Data Options button on card report #130

ftrotter opened this issue Jul 16, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request Ready for QA

Comments

@ftrotter
Copy link
Contributor

The tablular and graph report has this lovely "Data Options" button that is auto-generated from the Socket/Wrench System.

The Card Report view needs the same button. The layout should float the button to the right of the main report title to save vertical space.

The card view is basically just a blade looping through various html layers (its gotten much smarter lately) that displays the data in a particular order with a specific bootstrap based html pattern. It would be best if the "Data Options" button were something that could be modular enough that it would sit at the top of the report.. perhaps that would be something that would work on any fork of the card report for other layout purposes...

@ftrotter ftrotter added the enhancement New feature or request label Jul 16, 2020
kchapple added a commit that referenced this issue Jul 24, 2020
…commented out until we can test, and made wrenceh and socket models fillable to make testing the data-options easier (#130
@kchapple
Copy link
Contributor

@ftrotter @seanccsmith This is done. I added a CardTest report to LoreCommander to test.

I also added eager-loading of sockets to the wrench model, so all associated sockets will be automatically joined and added to the wrench model when fetched by eloquent. This should fix the performance issue in the defaultSocket check. I left that code commented-out though because I'm not sure what dataset to test on.

The CardTest report also has an example of creating on-demand sockets and wrenches in the report constructor, which might be interesting. In the constructor, we create the sockets and wrenches, or get them from the database if they already exist. That looks like this:

`
public function __construct(?string $Code, array $Parameters = [], array $Input = [])
{
$wrench = Wrench::firstOrCreate([
'wrench_lookup_string' => 'CardTest_music_filter',
'wrench_label' => 'Card Type Filter'
]);

    $socket1 = Socket::firstOrCreate([
        'wrench_id' => $wrench->id,
        'socket_value' => "`type` = 'music'",
        'socket_label' => "Music Cards",
        'is_default_socket' => 1,
        'socketsource_id' => 0
    ]);

    $socket2 = Socket::firstOrCreate([
        'wrench_id' => $wrench->id,
        'socket_value' => "`type` = 'video'",
        'socket_label' => "Video Cards",
        'is_default_socket' => 0,
        'socketsource_id' => 0
    ]);

    parent::__construct($Code, $Parameters, $Input);
}

`
Here's what it should look like:
Screen Shot 2020-07-24 at 2 02 34 PM

@ftrotter
Copy link
Contributor Author

Hey Ken, I finally found some time to test this, and the basic socket wrench lookup seems to fail.
Can you please take a look at the OneR project and help me understand why this is not working?

I am getting the following error message:

Screen Shot 2020-10-24 at 6 15 09 PM

I can confirm that I appear to have a properly configured wrench and socket, etc etc...

I am commiting a backup of the databases so that you can build an instance if you would like to debug that way...

@ftrotter
Copy link
Contributor Author

Also the "data options" button should not appear unless there is at least one working wrench.. otherwise it is just something to click on and get back "there are no data options configured for this report". No Data Options... should mean no Data Options button...

-FT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Ready for QA
Projects
None yet
Development

No branches or pull requests

2 participants