rusackas commented on code in PR #42245: URL: https://github.com/apache/superset/pull/42245#discussion_r3616685344
########## superset-frontend/plugins/plugin-chart-echarts/src/TimePivot/controlPanel.ts: ########## @@ -0,0 +1,170 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { t } from '@apache-superset/core/translation'; +import { ControlPanelConfig, sections } from '@superset-ui/chart-controls'; + +// Control names match the legacy nvd3 chart so saved charts keep working +// without a form-data migration. nvd3-specific pixel-margin and min/max +// toggles are intentionally dropped; ECharts lays those out automatically. +const config: ControlPanelConfig = { + controlPanelSections: [ + sections.legacyTimeseriesTime, + { + label: t('Query'), + expanded: true, + controlSetRows: [ + ['metric'], + ['adhoc_filters'], + [ + { + name: 'freq', + config: { + type: 'SelectControl', + label: t('Frequency'), + default: 'W-MON', + freeForm: true, + clearable: false, + choices: [ + ['AS', t('Year (freq=AS)')], + ['52W-MON', t('52 weeks starting Monday (freq=52W-MON)')], + ['W-SUN', t('1 week starting Sunday (freq=W-SUN)')], + ['W-MON', t('1 week starting Monday (freq=W-MON)')], + ['D', t('Day (freq=D)')], + ['4W-MON', t('4 weeks (freq=4W-MON)')], + ], + description: t( + `The periodicity over which to pivot time. Users can provide + "Pandas" offset alias. + Click on the info bubble for more details on accepted "freq" expressions.`, + ), + tooltipOnClick: () => { + window.open( + 'https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases', + ); + }, Review Comment: Fixed — added `_blank`, `noopener noreferrer` to that `window.open` call. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
