From notifications-return-50414-archive-asf-public=cust-asf.ponee.io@superset.apache.org Wed Sep 9 17:47:03 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mailroute1-lw-us.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 4C414180652 for ; Wed, 9 Sep 2020 19:47:03 +0200 (CEST) Received: from mail.apache.org (localhost [127.0.0.1]) by mailroute1-lw-us.apache.org (ASF Mail Server at mailroute1-lw-us.apache.org) with SMTP id 7E649121AF7 for ; Wed, 9 Sep 2020 17:47:02 +0000 (UTC) Received: (qmail 55378 invoked by uid 500); 9 Sep 2020 17:47:02 -0000 Mailing-List: contact notifications-help@superset.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.apache.org Delivered-To: mailing list notifications@superset.apache.org Received: (qmail 55368 invoked by uid 99); 9 Sep 2020 17:47:02 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2020 17:47:02 +0000 From: =?utf-8?q?GitBox?= To: notifications@superset.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-superset=5D_ktmud_commented_on_a_change_?= =?utf-8?q?in_pull_request_=2310815=3A_chore=3A_type_src/logger?= Message-ID: <159967362222.32230.16838529678973655253.asfpy@gitbox.apache.org> Date: Wed, 09 Sep 2020 17:47:02 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit In-Reply-To: References: ktmud commented on a change in pull request #10815: URL: https://github.com/apache/incubator-superset/pull/10815#discussion_r485803045 ########## File path: superset-frontend/src/logger/actions/index.ts ########## @@ -16,10 +16,12 @@ * specific language governing permissions and limitations * under the License. */ +import { Dispatch } from 'react-redux'; + export const LOG_EVENT = 'LOG_EVENT'; -export function logEvent(eventName, eventData) { - return dispatch => +export function logEvent(eventName: string, eventData: Record) { Review comment: E.g. ```diff diff --git a/superset-frontend/src/logger/actions/index.js b/superset-frontend/src/logger/actions.ts similarity index 79% rename from superset-frontend/src/logger/actions/index.js rename to superset-frontend/src/logger/actions.ts index f319068e6..884a8982f 100644 --- a/superset-frontend/src/logger/actions/index.js +++ b/superset-frontend/src/logger/actions.ts @@ -16,10 +16,16 @@ * specific language governing permissions and limitations * under the License. */ +import { Dispatch } from 'react-redux'; +import { LogEventName, LogEventPayload } from './constants'; + export const LOG_EVENT = 'LOG_EVENT'; -export function logEvent(eventName, eventData) { - return dispatch => +export function logEvent( + eventName: T, + eventData: LogEventPayload, +) { + return (dispatch: Dispatch) => dispatch({ type: LOG_EVENT, payload: { diff --git a/superset-frontend/src/logger/constants.ts b/superset-frontend/src/logger/constants.ts new file mode 100644 index 000000000..7180e1a21 --- /dev/null +++ b/superset-frontend/src/logger/constants.ts @@ -0,0 +1,39 @@ +/** + * 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. + */ +export const LogEvents = { + load_chart: 'load_chart', + render_chart: 'render_chart', + hide_browser_tab: 'hide_browser_tab', + mount_dashboard: 'mount_dashboard', + mount_explorer: 'mount_explorer', + select_dashboard_tab: 'select_dashboard_tab', + force_refresh_chart: 'force_refresh_chart', + change_explore_controls: 'change_explore_controls', + toggle_edit_dashboard: 'toggle_edit_dashboard', + force_refresh_dashboard: 'force_refresh_dashboard', + periodic_render_dashboard: 'periodic_render_dashboard', + explore_dashboard_chart: 'explore_dashboard_chart', + export_csv_dashboard_chart: 'export_csv_dashboard_chart', + change_dashboard_filter: 'change_dashboard_filter', + omnibar_triggered: 'omnibar_triggered', +}; + +export type LogEventName = keyof typeof LogEvents; + +export type LogEventPayload = Record; diff --git a/superset-frontend/src/logger/index.ts b/superset-frontend/src/logger/index.ts new file mode 100644 index 000000000..d3bd62022 --- /dev/null +++ b/superset-frontend/src/logger/index.ts @@ -0,0 +1,20 @@ +/** + * 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. + */ +export * from './constants'; +export * from './actions'; ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: users@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org For additional commands, e-mail: notifications-help@superset.apache.org