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

Fixes #18495: Add a reset columns button and some guard on localstorage cache #3331

Conversation

VinceMacBuche
Copy link
Member

@@ -1229,12 +1230,12 @@ function createNodeTable(gridId, nope, contextPath, refresh) {
var cacheId = gridId + "_columns"
var cacheColumns = localStorage.getItem(cacheId)
if (cacheColumns !== null) {
columns = JSON.parse(cacheColumns).filter(function(c) { return c !== null})
console.log(columns)
// Filter columns that are null, and columns that have a title that is not a key in of AllColumns, or if data doesnot start bien software or property
Copy link
Member

Choose a reason for hiding this comment

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

start /by/


delete params["ajax"];

dynColumns = Object.keys(allColumns).filter(function(c) { return !(defaultColumns.map(function(col) { return col.title}).includes(c))});
Copy link
Member

Choose a reason for hiding this comment

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

marvelous how much boilerplate you need for a lambda .map(_.title) :)

Copy link
Member Author

Choose a reason for hiding this comment

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

That's terrible ...

There is a MUCH better syntax that exists but i don't know if i can use it or not (some old browser may not have it) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

( x => x.title )

@VinceMacBuche
Copy link
Member Author

PR updated with a new commit

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder/pull/3331
-- Your faithful QA
Kant merge: "Two things awe me most, the starry sky above me and the moral law within me."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/32071/console)

@fanf
Copy link
Member

fanf commented Nov 5, 2020

OK, squash merging this PR

@fanf fanf force-pushed the ust_18495/add_a_reset_columns_button_and_some_guard_on_localstorage_cache branch from 4de82f7 to 6bbc5d4 Compare November 5, 2020 09:31
@fanf fanf merged commit 6bbc5d4 into Normation:branches/rudder/6.2 Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants