-
Notifications
You must be signed in to change notification settings - Fork 108
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
Update metadata #3361
Update metadata #3361
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving, because catching the dashboard up to the API changes is important (and sorry for missing that when I change the API 😢 ); but I also have some concerns/suggestions/questions ...
a5c00a8
to
2e509f7
Compare
c269dd8
to
f9bc78a
Compare
f9bc78a
to
30cd88e
Compare
let errorText = ""; | ||
|
||
for (const [key, value] of Object.entries(errors)) { | ||
errorText += `${key} : ${value} \n`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternately,
const errorText = Object.entries(errors).reduce(
(a, [k, v]) => a += `${k} : ${v} \n`,
""
);
export const setSelectedSavedRuns = (rows) => { | ||
return { | ||
type: TYPES.SELECTED_SAVED_RUNS, | ||
payload: rows, | ||
}; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternately,
export const setSelectedSavedRuns = (rows) => (
{
type: TYPES.SELECTED_SAVED_RUNS,
payload: rows,
}
);
That is, we only need to return a value which is an object -- we don't need any actual code (like a return
statement).
@@ -1 +1,2 @@ | |||
export const DANGER = "danger"; | |||
export const ERROR_MSG = "Something went wrong!"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is expedient, but it would be really handy if we could come up with something less generic. Any context would potentially be helpful.
const areAllRunsSelected = | ||
savedRuns?.length > 0 && savedRuns?.length === selectedRuns?.length; | ||
savedRuns?.length > 0 && savedRuns?.length === selectedSavedRuns?.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ?.
operator needs to be used with considerable care.
For instance, while savedRuns?.length > 0
will "do the right thing" if length
is not present, the inverse, savedRuns?.length <= 0
, probably won't (that is, they both return false if length
is not present, which might be counterintuitive).
Also, we can (and should) use .
instead of ?.
in the second reference to savedRuns.length
, because we know that the field is present if we get past the first test.
So, this code should do an explicit test for the presence of the field, and then test it's value:
savedRuns?.length && savedRuns.length > 0 && savedRuns.length === selectedSavedRuns?.length;
However, if saved?.length
is true-y, then I'm pretty sure that it is greater than zero, so we can omit the middle comparison.
@@ -107,6 +109,7 @@ const SavedRunsComponent = () => { | |||
selectAllRuns(isSelecting), | |||
isSelected: areAllRunsSelected, | |||
}} | |||
style={{ borderTop: "1px solid #d2d2d2" }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, why are we specifying the style
in-line instead of putting it in the .less
file?
{item?.message && | ||
item?.message.split("\n").map((i, key) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need (and therefore shouldn't use) the ?.
operator in the second reference.
This PR fixes the following bugs:
Update metadata API changes
Table Border for select box column
Selecting Saved and New Runs