You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/05/05 18:37:39 UTC

[GitHub] [superset] ktmud commented on a diff in pull request #19130: refactor: Refactor reports for Charts and Dashboards

ktmud commented on code in PR #19130:
URL: https://github.com/apache/superset/pull/19130#discussion_r866180083


##########
superset-frontend/src/views/CRUD/alert/types.ts:
##########
@@ -79,16 +82,44 @@ export type AlertObject = {
   sql?: string;
   timezone?: string;
   recipients?: Array<Recipient>;
-  report_format?: 'PNG' | 'CSV' | 'TEXT';
+  report_format?: NOTIFICATION_FORMATS;
   type?: string;
   validator_config_json?: {
     op?: Operator;
     threshold?: number;
   };
   validator_type?: string;
   working_timeout?: number;
+  error?: string;
 };
 
+export enum NOTIFICATION_FORMATS {
+  TEXT = 'TEXT',
+  PNG = 'PNG',
+  CSV = 'CSV',
+}
+export interface ReportObject {
+  id?: number;
+  active: boolean;
+  crontab: string;
+  dashboard?: number;
+  chart?: number;
+  description?: string;
+  log_retention: number;
+  name: string;
+  owners: number[];
+  recipients: [{ recipient_config_json: { target: string }; type: string }];
+  report_format: string;
+  timezone: string;
+  type: string;
+  validator_config_json: {} | null;
+  validator_type: string;
+  working_timeout: number;
+  creation_method: string;
+  force_screenshot: boolean;
+  error?: string;
+}

Review Comment:
   I think these will be better moved to top level types file in `src/reports/types.ts`. 



##########
superset-frontend/src/dashboard/reducers/types.ts:
##########
@@ -34,6 +34,16 @@ export type ChartConfiguration = {
   };
 };
 
+export type User = {
+  email: string;
+  firstName: string;
+  isActive: boolean;
+  lastName: string;
+  permissions: Record<string, any>;
+  roles: Record<string, any>;
+  userId: number;
+  username: string;
+};

Review Comment:
   We already have `User` type in `src/types/bootstrapTypes.ts`. Are they the same thing?



-- 
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: notifications-unsubscribe@superset.apache.org

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