TP: adds the ability to rearrange table columns as well as toggle column visibility#3680
TP: adds the ability to rearrange table columns as well as toggle column visibility#3680rawlinp merged 19 commits intoapache:masterfrom
Conversation
a8f1be4 to
4fda031
Compare
|
Refer to this link for build results (access rights to CI server needed): |
4fda031 to
1aa70cf
Compare
|
Refer to this link for build results (access rights to CI server needed): |
e882b33 to
6c3067a
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
6c3067a to
8e66460
Compare
|
Refer to this link for build results (access rights to CI server needed): |
8e66460 to
d5e3621
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
ocket8888
left a comment
There was a problem hiding this comment.
Still need to test things, will review again after testing.
There was a problem hiding this comment.
The standard Storage interface doesn't appear to support indexing. It does work in Firefox, and I assume you tested it in Chrome, so maybe we don't care, but indexing seems to be non-standard and implementation-dependent. I'd recommend using Storage.getItem() instead.
This line also has an uncaught SyntaxError from that call to JSON.parse, which I guess is fine if it's somehow implicitly handled by the dataTables? Seems unlikely though.
You're also accessing a property of an object by indexing it with a string, which isn't exactly a problem in this case because of how the Storage API works, but it's a bad habit to get into because it forces type coercion on the indexed value.
Finally, you should check for the availability of the localStorage object (MDN Guide). This is because some browsers don't have localStorage (though I'm sure we don't support them), but also because sometimes it may just not be available even if it is supported. As an example, Safari's private browsing mode gives you an empty object with 0 quota on every access. It's possible that dataTablesSort or whatever it's called does this already, but you should be sure; I'm not.
There was a problem hiding this comment.
ok, i'll see what i can clean up here. thanks
There was a problem hiding this comment.
I hate this name, because it's tying our UI directly to object representation in the database, which is meant to be opaque to Traffic Portal. But I don't have a better suggestion, so if you don't either, I guess it's fine.
There was a problem hiding this comment.
yes, i'm not a fan either. it's a bad practice imo that bubbled up to the UI
There was a problem hiding this comment.
a [role="menuitem"] must be the direct child of a [role="menu"] or [role="menubar"] - you can add these roles to the <ul>, or you can get that implicitly by using a <menu> instead.
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
4cae9cf to
8a6e531
Compare
|
Refer to this link for build results (access rights to CI server needed): |
traffic_portal/app/src/app.js
Outdated
There was a problem hiding this comment.
no. i thought it might be useful but i never used it. there's an init function in applicationService you can use instead if you need to do something at startup.
There was a problem hiding this comment.
👍 that sounds like a more proper use of Angular anyway.
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
ocket8888
left a comment
There was a problem hiding this comment.
Tests pass, manually tested the table changes, code looks good.
…visiblity/searchability - started with types table
leveraged new col.name property to enable ng-repeat on column checkboxes
…y when visible is changed.
…ges can be captured in history via a seperate PR
…ifications that were made
c7c4dff to
90b659d
Compare
|
Refer to this link for build results (access rights to CI server needed): |
This PR adds the ability to show/hide table columns in TP as well as reorder the visible columns of a table. The changes made by the user will be persisted in the browsers local storage.
I tackled an easy table (the types table) to start and prove out the concept.
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Note: I'm not going to document this functionality or add it to the changelog until it is added to other tables in subsequent PRs.
The following criteria are ALL met by this PR