Skip to content

Commit

Permalink
Revert commits back to after 2.11 release (#1231)
Browse files Browse the repository at this point in the history
* Revert "Update empty allowed roles to admin only (#1217) (#1220)"

This reverts commit 4288504.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Increment version to 2.11.1.0 (#1190)"

This reverts commit ccd5fb8.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Add S3 integration for Nginx and VPC (#1214) (#1216)"

This reverts commit e0a509c.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "disabling inspect and default pattern/timestamp buttons when using async data sources (#1205) (#1212)"

This reverts commit ca5ad02.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Saved object datasource backward compatibility fixes (#1208) (#1210)"

This reverts commit 467a0b3.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Link integrations from datasources UI (#1203) (#1207)"

This reverts commit 8e9fe5e.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "[Explorer] Fixes for cancel button and saved object loading (#1197) (#1201)"

This reverts commit f0e7a9d.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Correct query schema for ELB mview generation (#1196) (#1199)"

This reverts commit 0b7be95.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "[Backport 2.11] Add integrations queries for Flint (#1195)"

This reverts commit 97f46ba.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "remove husky pre-commit checks (#1192) (#1193)"

This reverts commit 25d52f3.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Bug fixes for observability count distribution and application analytics (#1187) (#1189)"

This reverts commit e2440d2.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Support cancellation of async queries (#1177) (#1186)"

This reverts commit 6b495f3.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "[Explorer] Supports session for s3 direct query (#1178) (#1183)"

This reverts commit d50047f.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "[Explorer] Modify text in empty prompt (#1172) (#1182)"

This reverts commit 95a60cc.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "[Feature] Match discover look and feel (#1135) (#1179)"

This reverts commit b69801e.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "config panel dark mode fix (#1169) (#1176)"

This reverts commit 34696b3.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Fix events home table and toast life time (#1170)"

This reverts commit a9b36fc.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Quiet react-dnd draggableId/droppableId warnings. (#1147) (#1166)"

This reverts commit a2f9a00.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Fix integration labeling to identify S3 integrations (#1157) (#1164)"

This reverts commit 9de9aea.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Remove loading progress for integration setup (#1156) (#1162)"

This reverts commit a08721b.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Switch from toast to callout for integration set up failures (#1155) (#1159)"

This reverts commit e6a474a.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Disable integration set up button if invalid (#1152) (#1161)"

This reverts commit 74aae17.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Update URL of create datasources, fix spacing (#1149) (#1154)"

This reverts commit 0b66d83.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "Allow patch on allowedRoles (#1143) (#1145)"

This reverts commit 0acc0f3.

Signed-off-by: Eric <menwe@amazon.com>

* Revert "fix for explorer data grid not paginating (#1139) (#1141)"

This reverts commit c5ead50.

Signed-off-by: Eric <menwe@amazon.com>

---------

Signed-off-by: Eric <menwe@amazon.com>
  • Loading branch information
mengweieric authored Nov 13, 2023
1 parent 4288504 commit c170e58
Show file tree
Hide file tree
Showing 110 changed files with 12,378 additions and 11,884 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
8 changes: 0 additions & 8 deletions common/constants/data_connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,4 @@ export const DatasourceTypeToDisplayName: { [key in DatasourceType]: string } =
S3GLUE: 'Amazon S3',
};

export const PrometheusURL = 'Prometheus';
export const AmazonS3URL = 'AmazonS3AWSGlue';

export const UrlToDatasourceType: { [key: string]: DatasourceType } = {
[PrometheusURL]: 'PROMETHEUS',
[AmazonS3URL]: 'S3GLUE',
};

export type AuthMethod = 'noauth' | 'basicauth' | 'awssigv4';
22 changes: 0 additions & 22 deletions common/constants/data_sources.ts

This file was deleted.

7 changes: 0 additions & 7 deletions common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export const OBSERVABILITY_BASE = '/api/observability';
export const INTEGRATIONS_BASE = '/api/integrations';
export const JOBS_BASE = '/query/jobs';
export const DATACONNECTIONS_BASE = '/api/dataconnections';
export const EDIT = '/edit';
export const SECURITY_ROLES = '/api/v1/configuration/roles';
export const EVENT_ANALYTICS = '/event_analytics';
export const SAVED_OBJECTS = '/saved_objects';
export const SAVED_QUERY = '/query';
Expand Down Expand Up @@ -242,11 +240,6 @@ export const WAITING_TIME_ON_USER_ACTIONS = 300;
export const VISUALIZATION_ERROR = {
NO_DATA: 'No data found.',
INVALID_DATA: 'Invalid visualization data',
NO_SERIES: 'Add a field to start',
};

export const S3_DATASOURCE_TYPE = 'S3_DATASOURCE';

export const ASYNC_QUERY_SESSION_ID = 'async-query-session-id';

export const DIRECT_DUMMY_QUERY = 'select 1';
30 changes: 1 addition & 29 deletions common/types/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import {
SavedObjectsStart,
} from '../../../../src/core/public/saved_objects';
import { ChromeBreadcrumb } from '../../../../src/core/public/chrome';
import { DataSourceType } from '../../../../src/plugins/data/public';

export interface IQueryTab {
id: string;
Expand Down Expand Up @@ -146,23 +145,13 @@ export interface IExplorerProps {
queryManager?: QueryManager;
}

export interface SelectedDataSource {
label: string;
name: string;
value: string;
type: string;
ds?: DataSourceType;
}

export interface SavedQuery extends SavedObjectAttributes {
export interface SavedQuery {
description: string;
name: string;
query: string;
selected_date_range: { start: string; end: string; text: string };
selected_fields: { text: string; tokens: IField[] };
selected_timestamp: IField;
dataSources: string; // list of type SelectedDataSources that is stringified
queryLang: string;
}

export interface SavedVisualization extends SavedObjectAttributes {
Expand All @@ -177,8 +166,6 @@ export interface SavedVisualization extends SavedObjectAttributes {
user_configs?: string;
units_of_measure?: string;
application_id?: string;
dataSources: string; // list of type SelectedDataSources that is stringified
queryLang: string;
}

export interface ExplorerDataType {
Expand Down Expand Up @@ -419,18 +406,3 @@ export interface GridSortingColumn {
id: string;
direction: 'asc' | 'desc';
}

export enum DirectQueryLoadingStatus {
SUCCESS = 'SUCCESS',
FAILED = 'FAILED',
RUNNING = 'RUNNING',
SCHEDULED = 'SCHEDULED',
CANCELED = 'CANCELED',
}

export interface DirectQueryRequest {
query: string;
lang: string;
datasource: string;
sessionId?: string;
}
16 changes: 2 additions & 14 deletions common/types/observability_saved_object_attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
*/

import { SavedObjectAttributes } from '../../../../src/core/types';
import { SavedQuery, SavedVisualization } from './explorer';
import { SavedVisualization } from './explorer';

export const VISUALIZATION_SAVED_OBJECT = 'observability-visualization';
export const SEARCH_SAVED_OBJECT = 'observability-search';
export const OBSERVABILTY_SAVED_OBJECTS = [
VISUALIZATION_SAVED_OBJECT,
SEARCH_SAVED_OBJECT,
] as const;
export const OBSERVABILTY_SAVED_OBJECTS = [VISUALIZATION_SAVED_OBJECT] as const;
export const SAVED_OBJECT_VERSION = 1;

export interface VisualizationSavedObjectAttributes extends SavedObjectAttributes {
Expand All @@ -21,11 +17,3 @@ export interface VisualizationSavedObjectAttributes extends SavedObjectAttribute
createdTimeMs: number;
savedVisualization: SavedVisualization;
}

export interface SearchSavedObjectAttributes extends SavedObjectAttributes {
title: string;
description: string;
version: number;
createdTimeMs: number;
savedQuery: SavedQuery;
}
1 change: 0 additions & 1 deletion common/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export {
buildRawQuery,
composeFinalQuery,
removeBacktick,
getSavingCommonParams,
} from '../../public/components/common/query_utils';

export * from './core_services';
16 changes: 0 additions & 16 deletions common/utils/query_session_utils.ts

This file was deleted.

8 changes: 0 additions & 8 deletions common/utils/shared.ts

This file was deleted.

6 changes: 3 additions & 3 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "observabilityDashboards",
"version": "2.11.1.0",
"opensearchDashboardsVersion": "2.11.1",
"version": "2.11.0.0",
"opensearchDashboardsVersion": "2.11.0",
"server": true,
"ui": true,
"requiredPlugins": [
Expand All @@ -21,4 +21,4 @@
"optionalPlugins": [
"managementOverview"
]
}
}
20 changes: 17 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "observability-dashboards",
"version": "2.11.1.0",
"version": "2.11.0.0",
"main": "index.ts",
"license": "Apache-2.0",
"scripts": {
Expand All @@ -10,8 +10,17 @@
"cypress:run": "TZ=America/Los_Angeles cypress run",
"cypress:open": "TZ=America/Los_Angeles cypress open",
"plugin-helpers": "node ../../scripts/plugin_helpers",
"prepare": "husky install",
"lint:es": "node ../../scripts/eslint",
"lint": "yarn lint:es",
"cypress:parallel": "cypress-parallel -s cypress:run -t 2 -d .cypress/integration"
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
"yarn lint --fix",
"git add"
]
},
"dependencies": {
"@algolia/autocomplete-core": "^1.4.1",
"@algolia/autocomplete-theme-classic": "^1.2.1",
Expand Down Expand Up @@ -67,5 +76,10 @@
"tough-cookie": "^4.1.3",
"semver": "^7.5.2",
"@cypress/request": "^3.0.0"
}
}
},
"eslintIgnore": [
"common/query_manager/antlr/output/*",
"node_modules/*",
"target/*"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export function Application(props: AppDetailProps) {
callback,
queryManager,
mode,
dataSourcePluggables,
} = props;
const [application, setApplication] = useState<ApplicationType>({
id: '',
Expand Down Expand Up @@ -372,7 +371,6 @@ export function Application(props: AppDetailProps) {
callbackInApp={callbackInApp}
queryManager={queryManager}
curSelectedTabId={selectedTabId}
dataSourcePluggables={dataSourcePluggables}
/>
);
};
Expand Down
2 changes: 0 additions & 2 deletions public/components/application_analytics/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export const Home = (props: HomeProps) => {
chrome,
notifications,
queryManager,
dataSourcePluggables,
} = props;
const [triggerSwitchToEvent, setTriggerSwitchToEvent] = useState(0);
const dispatch = useDispatch();
Expand Down Expand Up @@ -141,7 +140,6 @@ export const Home = (props: HomeProps) => {
setEndTime,
mode: 'data_prepper',
dataPrepperIndicesExist: indicesExist,
dataSourcePluggables,
};

const setToast = (title: string, color = 'success', text?: ReactChild) => {
Expand Down
2 changes: 1 addition & 1 deletion public/components/common/field_icon/field_icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const typeToEuiIconMap: Partial<Record<string, EuiTokenProps>> = {
export function FieldIcon({
type,
label,
size = 's',
size = 'l',
scripted,
className,
...rest
Expand Down
56 changes: 20 additions & 36 deletions public/components/common/query_utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@
import dateMath from '@elastic/datemath';
import { Moment } from 'moment-timezone';
import { isEmpty } from 'lodash';
import { SearchMetaData } from 'public/components/event_analytics/redux/slices/search_meta_data_slice';
import moment from 'moment';
import {
DATE_PICKER_FORMAT,
PPL_DEFAULT_PATTERN_REGEX_FILETER,
SELECTED_DATE_RANGE,
SELECTED_FIELDS,
SELECTED_TIMESTAMP,
} from '../../../../common/constants/explorer';
import {
PPL_DATE_FORMAT,
PPL_INDEX_INSERT_POINT_REGEX,
PPL_INDEX_REGEX,
PPL_NEWLINE_REGEX,
} from '../../../../common/constants/shared';
import { IExplorerFields, IQuery } from '../../../../common/types/explorer';

/*
* "Query Utils" This file contains different reused functions in operational panels
Expand Down Expand Up @@ -189,6 +186,9 @@ export const preprocessQuery = ({

if (!start || !end) return finalQuery;

const formattedStart = moment(start).utc().format(DATE_PICKER_FORMAT);
const formattedEnd = moment(end).utc().format(DATE_PICKER_FORMAT);

const promQLTokens = parsePromQLIntoKeywords(rawQuery);

if (promQLTokens?.connection) {
Expand Down Expand Up @@ -246,14 +246,23 @@ export const buildPatternsQuery = (
};

export const buildQuery = (baseQuery: string, currQuery: string) => {
if (!currQuery) return baseQuery;
return `${baseQuery} | ${currQuery}`;
let fullQuery: string;
if (baseQuery) {
fullQuery = baseQuery;
if (currQuery) {
fullQuery += '| ' + currQuery;
}
} else {
fullQuery = currQuery;
}
return fullQuery;
};

export const buildRawQuery = (query: IQuery, appBaseQuery: string) => {
if (appBaseQuery && !query.rawQuery.includes(appBaseQuery))
return buildQuery(appBaseQuery, query.rawQuery);
return query.rawQuery;
export const buildRawQuery = (query: any, appBaseQuery: string) => {
const rawQueryStr = (query.rawQuery as string).includes(appBaseQuery)
? query.rawQuery
: buildQuery(appBaseQuery, query.rawQuery);
return rawQueryStr;
};

export const composeFinalQuery = (
Expand Down Expand Up @@ -285,28 +294,3 @@ export const removeBacktick = (stringContainsBacktick: string) => {
if (!stringContainsBacktick) return '';
return stringContainsBacktick.replace(/`/g, '');
};

export const getSavingCommonParams = (
queryState: IQuery,
appBaseQuery: string,
fields: IExplorerFields,
savingTitle: string,
explorerSearchMeta: SearchMetaData
) => {
return {
dataSources: JSON.stringify([
{
name: explorerSearchMeta.datasources?.[0]?.name || '',
type: explorerSearchMeta.datasources?.[0]?.type || '',
label: explorerSearchMeta.datasources?.[0]?.label || '',
value: explorerSearchMeta.datasources?.[0]?.value || '',
},
]),
queryLang: explorerSearchMeta.lang,
query: buildRawQuery(queryState, appBaseQuery),
fields: fields[SELECTED_FIELDS],
dateRange: queryState[SELECTED_DATE_RANGE],
name: savingTitle,
timestamp: queryState[SELECTED_TIMESTAMP],
};
};
Loading

0 comments on commit c170e58

Please sign in to comment.