Skip to content
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

Added changes for making tree view persistent, made changes for bugs for loading screen #153

Merged
merged 9 commits into from
Oct 20, 2023
12 changes: 10 additions & 2 deletions common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ export const OPENSEARCH_ACC_DOCUMENTATION_URL =
export const ACC_INDEX_TYPE_DOCUMENTATION_URL =
'https://github.com/opensearch-project/opensearch-spark/blob/main/docs/index.md';

export const SKIPPING_INDEX = `skipping_index`;
export const ON_LOAD_QUERY = `SHOW tables LIKE '%';`;
export const TREE_ITEM_SKIPPING_INDEX_DEFAULT_NAME = `skipping_index`;
export const TREE_ITEM_COVERING_INDEX_DEFAULT_NAME = `covering_index`;
export const TREE_ITEM_MATERIALIZED_VIEW_DEFAULT_NAME = `materialized_view`;
export const TREE_ITEM_DATABASE_NAME_DEFAULT_NAME = `database`;
export const TREE_ITEM_TABLE_NAME_DEFAULT_NAME = `table`;
export const TREE_ITEM_LOAD_MATERIALIZED_BADGE_NAME = `Load Materialized View`;
export const TREE_ITEM_BADGE_NAME =`badge`
export const LOAD_OPENSEARCH_INDICES_QUERY = `SHOW tables LIKE '%';`;
export const SKIPPING_INDEX_QUERY = `CREATE SKIPPING INDEX ON myS3.logs_db.http_logs
(status VALUE_SET)
WITH (
Expand Down Expand Up @@ -84,3 +90,5 @@ export const ACCELERATION_INDEX_NAME_INFO = `All OpenSearch acceleration indices
`;

export const SIDEBAR_POLL_INTERVAL_MS = 5000;

export const FETCH_OPENSEARCH_INDICES_PATH = '/api/sql_console/sqlquery'
10 changes: 9 additions & 1 deletion common/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,12 @@ export interface CreateAccelerationForm {
formErrors: FormErrorsType;
}

export type AsyncQueryLoadingStatus = 'SUCCESS' | 'FAILED' | 'RUNNING' | 'SCHEDULED' | 'CANCELLED';
export type AsyncQueryLoadingStatus = 'SUCCESS' | 'FAILED' | 'RUNNING' | 'SCHEDULED' | 'CANCELLED';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to consider using enum here? something like

export enum AsyncQueryLoadingStatus {
  SUCCESS = 'SUCCESS',
  FAILED = 'FAILED',
  RUNNING = 'RUNNING',
  SCHEDULED = 'SCHEDULED',
  CANCELLED = 'CANCELLED'
}

export enum TreeItemType {
  COVERING_INDEX = 'covering_index',
  SKIPPING_INDEX = 'skipping_index',
  TABLE = 'table',
  DATABASE = 'database',
  MATERIALIZED_VIEW = 'materialized_view',
  LOAD_MATERIALIZED_VIEW = 'Load Materialized View', // Consider renaming this for consistency
  BADGE = 'badge'
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sumukhswamy Can you take this as a fast follow in the next PR?

export type TreeItemType = 'covering_index' | 'skipping_index' | 'table' | 'database' | 'materialized_view' | 'Load Materialized View' | 'badge'

export interface TreeItem {
name: string;
type: TreeItemType;
isExpanded: boolean;
values?: TreeItem[];
}
Loading