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

Revert commits back to after 2.11 release #1231

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
01e8746
Revert "Update empty allowed roles to admin only (#1217) (#1220)"
mengweieric Nov 8, 2023
c2c0899
Revert "Increment version to 2.11.1.0 (#1190)"
mengweieric Nov 8, 2023
a6516ed
Revert "Add S3 integration for Nginx and VPC (#1214) (#1216)"
mengweieric Nov 8, 2023
415e73c
Revert "disabling inspect and default pattern/timestamp buttons when …
mengweieric Nov 8, 2023
40d21ab
Revert "Saved object datasource backward compatibility fixes (#1208) …
mengweieric Nov 8, 2023
4146047
Revert "Link integrations from datasources UI (#1203) (#1207)"
mengweieric Nov 8, 2023
06bbd29
Revert "[Explorer] Fixes for cancel button and saved object loading (…
mengweieric Nov 8, 2023
a59a262
Revert "Correct query schema for ELB mview generation (#1196) (#1199)"
mengweieric Nov 8, 2023
f17ce22
Revert "[Backport 2.11] Add integrations queries for Flint (#1195)"
mengweieric Nov 8, 2023
03ff648
Revert "remove husky pre-commit checks (#1192) (#1193)"
mengweieric Nov 8, 2023
a44b3e7
Revert "Bug fixes for observability count distribution and applicatio…
mengweieric Nov 8, 2023
de41cd3
Revert "Support cancellation of async queries (#1177) (#1186)"
mengweieric Nov 8, 2023
2dc32a6
Revert "[Explorer] Supports session for s3 direct query (#1178) (#1183)"
mengweieric Nov 8, 2023
46fa996
Revert "[Explorer] Modify text in empty prompt (#1172) (#1182)"
mengweieric Nov 8, 2023
61a3355
Revert "[Feature] Match discover look and feel (#1135) (#1179)"
mengweieric Nov 8, 2023
5162627
Revert "config panel dark mode fix (#1169) (#1176)"
mengweieric Nov 8, 2023
b45f2e6
Revert "Fix events home table and toast life time (#1170)"
mengweieric Nov 8, 2023
389fddf
Revert "Quiet react-dnd draggableId/droppableId warnings. (#1147) (#1…
mengweieric Nov 8, 2023
ebcd7c0
Revert "Fix integration labeling to identify S3 integrations (#1157) …
mengweieric Nov 8, 2023
bec0b26
Revert "Remove loading progress for integration setup (#1156) (#1162)"
mengweieric Nov 8, 2023
21f0d58
Revert "Switch from toast to callout for integration set up failures …
mengweieric Nov 8, 2023
5eb606c
Revert "Disable integration set up button if invalid (#1152) (#1161)"
mengweieric Nov 8, 2023
e797550
Revert "Update URL of create datasources, fix spacing (#1149) (#1154)"
mengweieric Nov 8, 2023
bc88efb
Revert "Allow patch on allowedRoles (#1143) (#1145)"
mengweieric Nov 8, 2023
9dd8818
Revert "fix for explorer data grid not paginating (#1139) (#1141)"
mengweieric Nov 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading