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

Dashboard De-Angularization #4502

Merged
merged 24 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b6a783d
Replace angular modules with react components
abbyhu2000 May 11, 2023
527dc99
Skip dashboard state unit test
abbyhu2000 May 12, 2023
1d36377
[Dashboard De-Angular] Render dashboard listing page (#4015)
abbyhu2000 Jun 1, 2023
d42fb8d
Basic top nav bar for dashboard (#4108)
abbyhu2000 Jun 7, 2023
492cbad
Render editor page with basic nav actions (#4213)
abbyhu2000 Jun 20, 2023
c260669
Add visualization (#4257)
abbyhu2000 Jun 21, 2023
f9582df
Render empty screen (#4346)
abbyhu2000 Jun 22, 2023
70f07d7
Fix routing (#4357)
abbyhu2000 Jun 23, 2023
287edc3
[Dashboard De-Angular] Enable time filter functionalities (#4364)
abbyhu2000 Jun 23, 2023
fcca6a5
No index pattern routing (#4401)
abbyhu2000 Jun 26, 2023
1fc629c
Add embed mode and other URL param options (#4407)
abbyhu2000 Jun 29, 2023
e22e012
[Dashboard De-Angular] Add dashboard class for discard flow (#4478)
abbyhu2000 Jul 1, 2023
d6249fb
[Dashboard De-Angular] Add breadcrumb with view/edit mode and unsaved…
abbyhu2000 Jul 1, 2023
bf225cd
[Dashboard De-Angular] Enable URL title param for initial filter on d…
abbyhu2000 Jul 2, 2023
2538201
[Dashboard De-Angular] Fix dashboard save and back button functional …
abbyhu2000 Jul 4, 2023
56eb1a2
[Dashboard De-Angular] Fix filter and query related functional tests …
abbyhu2000 Jul 4, 2023
469526f
[Dashboard De-Angular] Fix remaining functional test (#4496)
abbyhu2000 Jul 5, 2023
f8d5e82
fix observibility dashboard delete (#4508)
abbyhu2000 Jul 6, 2023
2ea2885
[Dashboard De-Angular] Initial clean up and linter fix (#4511)
abbyhu2000 Jul 6, 2023
cfa9087
[Dashboard De-Angular] Cypress fix (#4521)
abbyhu2000 Jul 7, 2023
98a6b4b
delete old unit test
abbyhu2000 Jul 7, 2023
bd72786
Refactor app state and cleanup unused imports (#4504)
kavilla Jul 11, 2023
2358bf3
Merge branch 'main' into feature/deangular-dashboards
kavilla Jul 11, 2023
5c1a419
Set dashboard container functions and fix license headers (#4540)
kavilla Jul 11, 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Add `color-scheme` to the root styling ([#4477](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4477))
- [Multiple DataSource] Frontend support for adding sample data ([#4412](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4412))
- Enable plugins to augment visualizations with additional data and context ([#4361](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4361))
- Dashboard De-Angularization ([#4502](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4502))
- New management overview page and rename stack management to dashboard management ([#4287](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4287))
- [Vis Augmenter] Update base vis height in view events flyout ([#4535](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4535))


### 🐛 Bug Fixes

- [Chore] Update deprecated url methods (url.parse(), url.format()) ([#2910](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2910))
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
"dns-sync": "^0.2.1",
"elastic-apm-node": "^3.43.0",
"elasticsearch": "^16.7.0",
"http-aws-es": "npm:@zhongnansu/[email protected]",
"execa": "^4.0.2",
"expiry-js": "0.1.7",
"fast-deep-equal": "^3.1.1",
Expand All @@ -182,6 +181,7 @@
"globby": "^11.1.0",
"handlebars": "4.7.7",
"hjson": "3.2.1",
"http-aws-es": "npm:@zhongnansu/[email protected]",
"http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^5.0.0",
"inline-style": "^2.0.0",
Expand Down Expand Up @@ -290,6 +290,7 @@
"@types/has-ansi": "^3.0.0",
"@types/history": "^4.7.3",
"@types/hjson": "^2.4.2",
"@types/http-aws-es": "6.0.2",
"@types/jest": "^27.4.0",
"@types/joi": "^13.4.2",
"@types/jquery": "^3.3.31",
Expand Down Expand Up @@ -342,7 +343,6 @@
"@types/zen-observable": "^0.8.0",
"@typescript-eslint/eslint-plugin": "^3.10.0",
"@typescript-eslint/parser": "^3.10.0",
"@types/http-aws-es": "6.0.2",
"angular-aria": "^1.8.0",
"angular-mocks": "^1.8.2",
"angular-recursion": "^1.0.5",
Expand Down
9 changes: 7 additions & 2 deletions src/plugins/dashboard/common/migrate_to_730_panels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ function is640To720Panel(
panel: unknown | RawSavedDashboardPanel640To720
): panel is RawSavedDashboardPanel640To720 {
return (
semver.satisfies((panel as RawSavedDashboardPanel630).version, '>6.3') &&
semver.satisfies((panel as RawSavedDashboardPanel630).version, '<7.3')
semver.satisfies(
semver.coerce((panel as RawSavedDashboardPanel630).version)!.version,
'>6.3'
) &&
semver.satisfies(semver.coerce((panel as RawSavedDashboardPanel630).version)!.version, '<7.3')
);
}

Expand Down Expand Up @@ -273,10 +276,12 @@ function migrate640To720PanelsToLatest(
version: string
): RawSavedDashboardPanel730ToLatest {
const panelIndex = panel.panelIndex ? panel.panelIndex.toString() : uuid.v4();
const embeddableConfig = panel.embeddableConfig ?? {};
return {
...panel,
version,
panelIndex,
embeddableConfig,
};
}

Expand Down
14 changes: 0 additions & 14 deletions src/plugins/dashboard/public/application/_hacks.scss

This file was deleted.

11 changes: 11 additions & 0 deletions src/plugins/dashboard/public/application/app.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.dshAppContainer {
display: flex;
flex-direction: column;
flex-grow: 1;
}

#dashboardViewport {
display: flex;
flex-direction: column;
flex: 1;
}
27 changes: 27 additions & 0 deletions src/plugins/dashboard/public/application/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import './app.scss';
import React from 'react';
import { Route, Switch } from 'react-router-dom';
import { DashboardConstants, createDashboardEditUrl } from '../dashboard_constants';
import { DashboardEditor, DashboardListing, DashboardNoMatch } from './components';

export const DashboardApp = () => {
return (
<Switch>
<Route path={[DashboardConstants.CREATE_NEW_DASHBOARD_URL, createDashboardEditUrl(':id')]}>
<div className="app-container dshAppContainer">
<DashboardEditor />
<div id="dashboardViewport" />
</div>
</Route>
<Route exact path={['/', DashboardConstants.LANDING_PAGE_PATH]}>
<DashboardListing />
</Route>
<DashboardNoMatch />
</Switch>
);
};
167 changes: 0 additions & 167 deletions src/plugins/dashboard/public/application/application.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
kavilla marked this conversation as resolved.
Show resolved Hide resolved
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useState } from 'react';
import { useParams } from 'react-router-dom';
import { EventEmitter } from 'events';
import { DashboardTopNav } from '../components/dashboard_top_nav';
import { useChromeVisibility } from '../utils/use/use_chrome_visibility';
import { useOpenSearchDashboards } from '../../../../opensearch_dashboards_react/public';
import { useSavedDashboardInstance } from '../utils/use/use_saved_dashboard_instance';
import { DashboardServices } from '../../types';
import { useDashboardAppAndGlobalState } from '../utils/use/use_dashboard_app_state';
import { useEditorUpdates } from '../utils/use/use_editor_updates';

export const DashboardEditor = () => {
const { id: dashboardIdFromUrl } = useParams<{ id: string }>();
const { services } = useOpenSearchDashboards<DashboardServices>();
const { chrome } = services;
const isChromeVisible = useChromeVisibility({ chrome });
const [eventEmitter] = useState(new EventEmitter());

const { savedDashboard: savedDashboardInstance, dashboard } = useSavedDashboardInstance({
services,
eventEmitter,
isChromeVisible,
dashboardIdFromUrl,
});

const { appState, currentContainer, indexPatterns } = useDashboardAppAndGlobalState({
services,
eventEmitter,
savedDashboardInstance,
dashboard,
});

const { isEmbeddableRendered, currentAppState } = useEditorUpdates({
services,
eventEmitter,
savedDashboardInstance,
dashboard,
dashboardContainer: currentContainer,
appState,
});

return (
<div>
<div>
{savedDashboardInstance && appState && currentAppState && currentContainer && dashboard && (
<DashboardTopNav
isChromeVisible={isChromeVisible}
savedDashboardInstance={savedDashboardInstance}
appState={appState!}
dashboard={dashboard}
currentAppState={currentAppState}
isEmbeddableRendered={isEmbeddableRendered}
indexPatterns={indexPatterns}
currentContainer={currentContainer}
dashboardIdFromUrl={dashboardIdFromUrl}
/>
)}
</div>
</div>
);
};
Loading