akshayrai commented on a change in pull request #3636: [TE] frontend -
aaronucsd/Basic yaml editor with alert and subscripti…
URL: https://github.com/apache/incubator-pinot/pull/3636#discussion_r247680066
##########
File path:
thirdeye/thirdeye-frontend/app/pods/components/yaml-editor/component.js
##########
@@ -0,0 +1,326 @@
+/**
+ * Component to render pre-set time range selection pills and a 'custom' one
using date-range-picker.
+ * @module components/range-pill-selectors
+ * @property {Object} timeRangeOptions - object containing our range options
+ * @property {Number} timePickerIncrement - determines selectable time
increment in date-range-picker
+ * @property {Date} activeRangeStart - default start date for range picker
+ * @property {Date} activeRangeEnd - default end date for range picker
+ * @property {String} uiDateFormat - date format specified by parent route
(often specific to metric granularity)
+ * @property {Action} selectAction - closure action from parent
+ * @example
+ {{yaml-editor
+ alertTitle="New Editor Title"
+ isEditMode=true
+ showSettings=true
+ onYMLSelector=(action "onYMLSelector")
+ saveAlertYaml=(action "saveAlertYaml")
+ cancelAlertYaml=(action "cancelAlertYaml")
+ }}
+ * @author
+ */
+
+import Component from '@ember/component';
+import { computed, set, get, getProperties } from '@ember/object';
+import { checkStatus } from 'thirdeye-frontend/utils/utils';
+import { yamlAlertProps, yamlAlertSettings, yamIt } from
'thirdeye-frontend/utils/constants';
+import yamljs from 'yamljs';
+import RSVP from "rsvp";
+import fetch from 'fetch';
+import {
+ selfServeApiGraph,
+ selfServeApiCommon
+} from 'thirdeye-frontend/utils/api/self-serve';
+import { inject as service } from '@ember/service';
+import { task } from 'ember-concurrency';
+
+export default Component.extend({
+ classNames: ['yaml-editor'],
+ notifications: service('toast'),
+ /**
+ * Properties we expect to receive for the yaml-editor
+ */
+ //isForm: true,
+ currentMetric: null,
+ isYamlParseable: true,
+ alertTitle: 'Define anomaly detection in YAML',
+ alertSettingsTitle: 'Define notification settings',
+ isEditMode: false,
+ showSettings: true,
+ disableYamlSave: true,
+ errorMsg: '',
+ alertYaml: null, // The YAML for the anomaly alert detection
+ detectionSettingsYaml: null, // The YAML for the subscription group
+ //currentYamlSettings: null,// The YAML content for the notification settings
Review comment:
I'd prefer removing commented code if not required.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]