-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[TE] frontend - aaronucsd/added new custom component for Resolution #2634
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
Conversation
0101e48 to
cab99c7
Compare
justYves
left a comment
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.
Thanks for doing this! Super clean PR, added a few minor comments. Let me know if they make sense.
comments with nit or fyi are of course non-blocking.
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.
sanity check: is this the format the back end will send this? no camelCase? metricAnomalyId
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.
Ah darn. I did a replace all for Id:..with anomalyId. Need to revert.
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.
DONE
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.
nit: could use .mapBy('name') here
example:
import EmberObject from '@ember/object';
let hawaii = EmberObject.create({
capital: 'Honolulu'
});
let california = EmberObject.create({
capital: 'Sacramento'
});
let states = [hawaii, california];
states.mapBy('capital')
documentation:
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.
DONE
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.
nit: let's use async/await to avoid the nested then's?
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.
Ok cool. It was copied of existing codes didn't check to refractor the method itself. I can do it now.
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.
@aaronucsd ah didn't realize this was a copy/pasta. a TODO comment in the code is fine for now 👍
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.
DONE
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.
fyi, We could leverage getWithDefault here:
documentation:
example:
import { getWithDefault } from '@ember/object';
// ....
const filterMap = getWithDefault(res, 'searchFilters. statusFilterMap', null);
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.
Sure. But i don't see why we need invoke a method that does the same kind of ternary underneath. I like it this way, it's more explicit to read.
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.
DONE
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.
if anomalyRecord is an ember object (it should be),
we can utilize setProperties so that we don't notify property changes for each sets. An alternative would be to wrap that in an ember run.
documentation:
example:
anomalyRecord.setProperties({
anomalyFeedback: selectedResponse,
showResponseSaved: true
})
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.
again existing codes. But updated. Thanks.
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.
DONE
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.
let's use setProperties here
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.
again existing codes. But updated. Thanks.
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.
DONE
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.
nit: if we're sure that range contains both name and value property, we could deconstruct it
({ name, value }) => {
// ...
return {
name,
value,
isActive: false
};
// ...
}
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 not sure on this code. It existing and shows green because of merge conflict resolved.
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.
SKIPPED
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.
👍 fyi, I believe Steve started an API file, we can start thinking about putting new urls there in an effort to alleviate new tech debt
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.
He has it for self-serve only. I can put another one for maybe something general.
app/utils/api/self-serve.js
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.
added utils/api/anomaly.js. DONE
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 curious what's the rationale behind choosing to implement it as a utils vs a service?
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.
https://guides.emberjs.com/v3.0.0/applications/services/ explains the criteria for when to create a service. THere is no need to require shared state etc here.
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.
DONE
|
Also, understand that styling is not the highest priority, but I feel that some spacing between the icon and the input would be nicer visually. Perhaps 4 or 8 px? this should already exist as sass spacing variables |
newsummit
left a comment
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.
Thanks for modularizing. Lets test thoroughly to make sure all is well with Alert Page.
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 jsDoc here doesn't seem to match the component.
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.
done
eebb4ae to
a313575
Compare
justYves
left a comment
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.
LGTM!
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.
Every new line above 435 should be removed (merge resolution fix)
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.
DONE
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.
onRangeOptionClick no longer needed.
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.
removed.
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.
DONE
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.
You can restore onRangeSelection
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.
DONE
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.
Lets try import { anomalyResponseObj } from 'thirdeye-frontend/utils/anomaly';
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.
DONE
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.
Not needed, right?
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.
yep. Let me remove.
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.
Nice - thank you!
newsummit
left a comment
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.
Thanks for modularizing/extending the resolution bit. I just indicated some cleanup items for manage/alert/explore controller.
1. Added new resolution custom component 2. fixed the icon issue on resolution select for model table 3. Updated styling for the fix in apache#2 4. Added new method to anomaly util file and moved a few needed anomaly methods from app/pods/manage/alert/explore/controller.js 5. Moved anomalyResponseObj constant to anomaly util from app/pods/manage/alert/explore/route.js 6. Updated app/pods/manage/alert/explore/* to use the methods from anomaly util 7. updated anomaly util unit test and ran all tests for sanity 8. Added new api anomaly file and unit test
a313575 to
acef124
Compare
newsummit
left a comment
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.
OK - Looks good.
…2634) 1. Added new resolution custom component 2. fixed the icon issue on resolution select for model table 3. Updated styling for the fix in #2 4. Added new method to anomaly util file and moved a few needed anomaly methods from app/pods/manage/alert/explore/controller.js 5. Moved anomalyResponseObj constant to anomaly util from app/pods/manage/alert/explore/route.js 6. Updated app/pods/manage/alert/explore/* to use the methods from anomaly util 7. updated anomaly util unit test and ran all tests for sanity 8. Added new api anomaly file and unit test
app/pods/manage/alert/explore/controller.js
app/pods/manage/alert/explore/route.js