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

Features/better table options #5018

Merged
merged 18 commits into from
Feb 16, 2018
Merged

Features/better table options #5018

merged 18 commits into from
Feb 16, 2018

Conversation

snipe
Copy link
Owner

@snipe snipe commented Feb 15, 2018

Hi all,

I've spent the better part of the last 30 hours going through all of our bootstrap tables and beating them up a bit.

What's In This PR

  • Some BS table scripts were fixed
  • bootstrap-tables.blade.php is cleaner now - none less of that awful conditional PHP logic. Switching to use data attributes took FOREVER, but that table partial is so much cleaner now, and less magical.

Specifically, this....

  • Fixes a LOOOOONG time bug where exports would download twice, and wouldn't have a file extension or would be called just "untitled". This is a huge win, as far as I'm concerned. It's been a thorn in my side issue for years.

  • Basically every table we have now has the ability to export it (yay!). And every export has a USEFUL and MEANINGFUL name. OMG!

  • Fixes a NEW issue that I think was a newly introduced bug with a later version of the bootstrap tables cookie extension (Table Column Cookies are set to expire on browser close #5014) where the expiration was limited to the browser session, so users had to re-select their columns every time. Ugh. I'm still trying to optimize this by re-using cookie names, but it doesn't seem to preserve that state between different sections (or I'm doing it wrong. Very possible. I'm quite tired.)

A few notes....

  • A few of the BS tables that are still using client-side tables will eventually need to be switched over to use the API.

  • The Reports section is well and truly fucked, and I'm not even sure that it makes sense anymore, since the same issue that prevents users from downloading the entire result set when using server side data is the same one we see there. We need to solve that problem once and for all (offer a "selected" vs "all" option and an external "export" button that triggers a PHP stream). Also the reports section doesn't actually provide any information you can't get elsewhere for the most part, so it's likely many of those reports will be retired and new ones developed. That section made sense back when we weren't using server-side BS tables, but many users have too much data and those sections crash.

  • Any BS tables that were not manually updated through this process WILL BE BROKEN. Hopefully collectively we can find anything I've missed.

Review/Feedback requested!

Please do review these changes when you get a chance, if you can. I've reviewed the code AND the actual UI several times, but it's easy to forget how big this app is.

If you can, please help me test on IE. I've tested it in my VMs, but IE is no friend to Javascript, so I'm worried.

Pinging @uberbrady, @dmeltzer, @HinchK and maybe @fordster78 for extra testing and eyeballs before we merge to develop. <3 You may need to clear your caches, since there was a bit of cookie shenanigans.

alwaysonsomequest

Also I did all this with a 4 keys falling off of my laptop, so look for dumb typos. :)

@snipe snipe added this to the v4.1.11 milestone Feb 15, 2018
@snipe snipe requested a review from uberbrady February 15, 2018 00:38
Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

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

This is absolutely excellent. I have two microscopically tiny points that stylistically, I'd like to see change. But if you completely ignored me it wouldn't bother me in the slightest, as they are extraordinarily simple changes.


var $table = $('.snipe-table');
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this bit can be cleaned up - the only place you reference $table is within buildTable(), the only thing you run in your DOM=ready function is buildTable - you should be able to wrap all that together into the body of the DOM-ready function instead.


@if (!isset($simple_view))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would rather see this as something like -

{
 /*  ... */
  showMultiSort: {{ !isset($imple_view) && isset($multiSort) }}
}

Because I get weird feelings when I see lots of conditional stuff in a view that dynamically changes javascript. It just freaks me out and it hard to mentally parse and map between multiple different languages.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'm honestly not even sure that we use that option anymore.

Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

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

Looks great!

@snipe snipe merged commit 3744a68 into develop Feb 16, 2018
@snipe snipe deleted the features/better_table_options branch July 19, 2018 03:08
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