Skip to content

Commit

Permalink
[Dashboard De-Angular] Fix remaining functional test (#4496)
Browse files Browse the repository at this point in the history
* fix dashboard state function test in group 4

Signed-off-by: abbyhu2000 <[email protected]>

* fix expanding panel

Signed-off-by: abbyhu2000 <[email protected]>

---------

Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 committed Jul 5, 2023
1 parent 765e335 commit a94b339
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export const DashboardEditor = () => {
isEmbeddableRendered={isEmbeddableRendered}
indexPatterns={indexPatterns}
dashboardContainer={dashboardContainer}
dashboardIdFromUrl={dashboardIdFromUrl}
/>
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface DashboardTopNavProps {
isEmbeddableRendered: boolean;
indexPatterns: IndexPattern[];
dashboardContainer?: DashboardContainer;
dashboardIdFromUrl?: string;
}

export enum UrlParams {
Expand All @@ -42,6 +43,7 @@ const TopNav = ({
isEmbeddableRendered,
dashboardContainer,
indexPatterns,
dashboardIdFromUrl,
}: DashboardTopNavProps) => {
const [topNavMenu, setTopNavMenu] = useState<any>();
const [isFullScreenMode, setIsFullScreenMode] = useState<any>();
Expand Down Expand Up @@ -80,6 +82,7 @@ const TopNav = ({
savedDashboardInstance,
services,
dashboard,
dashboardIdFromUrl,
dashboardContainer
);
setTopNavMenu(
Expand All @@ -99,6 +102,7 @@ const TopNav = ({
stateContainer,
isEmbeddableRendered,
dashboard,
dashboardIdFromUrl
]);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@

&:hover,
&:focus {
background-color: $embEditingModeHoverColor;
// TODO: this is a sass error, $embEditingModeHoverColor is undefined, comment it out for now
//background-color: $embEditingModeHoverColor;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import 'react-grid-layout/css/styles.css';
import 'react-resizable/css/styles.css';
import './_dashboard_grid.scss'

// @ts-ignore
import sizeMe from 'react-sizeme';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export function saveDashboard(

updateSavedDashboard(savedDashboard, appState, timeFilter, dashboard);

// TODO: should update Dashboard class in the if(id) block
return savedDashboard.save(saveOptions).then((id: string) => {
if (id) {
return id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const getNavActions = (
savedDashboard: any,
services: DashboardServices,
dashboard: Dashboard,
dashboardIdFromUrl?: string,
dashboardContainer?: DashboardContainer
) => {
const {
Expand Down Expand Up @@ -390,7 +391,11 @@ export const getNavActions = (
'data-test-subj': 'saveDashboardSuccess',
});

chrome.docTitle.change(savedDashboard.lastSavedTitle);
if (id !== dashboardIdFromUrl) {
history.replace(createDashboardEditUrl(id));
}

chrome.docTitle.change(savedDashboard.title);
stateContainer.transitions.set('viewMode', ViewMode.VIEW);
}
return { id };
Expand Down

0 comments on commit a94b339

Please sign in to comment.