Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
abbyhu2000 committed Jun 19, 2023
1 parent 54e3370 commit 08e2a48
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,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 @@ -181,6 +180,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 @@ -254,6 +254,7 @@
"@osd/utility-types": "1.0.0",
"@percy/cli": "^1.0.0",
"@percy/sdk-utils": "^1.0.0",
"@rxjs-insights/devtools": "^0.5.0",
"@testing-library/dom": "^8.11.3",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.2",
Expand Down Expand Up @@ -287,6 +288,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 @@ -339,7 +341,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
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ const TopNav = ({
}

asyncSetIndexPattern()
}, [currentAppState, services.data.indexPatterns])
console.log("index pattern", indexPatterns)
}, [dashboardContainer, stateContainer, currentAppState, services.data.indexPatterns])

const shouldShowFilterBar = (forceHide: boolean): boolean =>
!forceHide && (filters!.length > 0 || !currentAppState?.fullScreenMode);
Expand All @@ -146,7 +147,6 @@ const TopNav = ({
const showFilterBar = shouldShowFilterBar(forceHideFilterBar);
const showSearchBar = showQueryBar || showFilterBar;

console.log("index pattern", indexPatterns)
return isChromeVisible ? (
<TopNavMenu
appName={'dashboard'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const useDashboardContainer = (
};

getDashboardContainer();
}, [appState, dashboardDom, eventEmitter, isChromeVisible, savedDashboardInstance, services]);
}, [savedDashboardInstance, appState]);

useEffect(() => {
const incomingEmbeddable = services.embeddable
Expand All @@ -95,15 +95,15 @@ export const useDashboardContainer = (
return { dashboardContainer };
};

const createDashboardEmbeddable = async (
const createDashboardEmbeddable = (
savedDash: any,
dashboardServices: DashboardServices,
appState: DashboardAppStateContainer
) => {
let dashboardContainer: DashboardContainer;
let inputSubscription: Subscription | undefined;
let outputSubscription: Subscription | undefined;

console.log('createing container!');
const {
embeddable,
data,
Expand Down Expand Up @@ -284,7 +284,9 @@ const createDashboardEmbeddable = async (
mapTo(dashboardContainer),
startWith(dashboardContainer) // to trigger initial index pattern update
)
.subscribe();
.subscribe(() => {
handleDashboardContainerChanges(container, appState, dashboardServices);
});

inputSubscription = dashboardContainer.getInput$().subscribe(() => {
// This has to be first because handleDashboardContainerChanges causes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ export const useEditorUpdates = (

const unsubscribeStateUpdates = appState.subscribe((state) => {
setCurrentAppState(state);
if(dashboardContainer.getChangesFromAppStateForContainerState){
const changes = dashboardContainer.getChangesFromAppStateForContainerState(dashboardContainer);
if(changes){
dashboardContainer.updateInput(changes)
console.log('before invoked');
if (dashboardContainer.getChangesFromAppStateForContainerState) {
console.log('invoked');
const changes = dashboardContainer.getChangesFromAppStateForContainerState(
dashboardContainer
);
if (changes) {
dashboardContainer.updateInput(changes);
}
}
});
Expand Down
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,18 @@
colors "~1.2.1"
string-argv "~0.3.1"

"@rxjs-insights/core@^0.5.0":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@rxjs-insights/core/-/core-0.5.0.tgz#567190414ab5b89d93e6e9ec31c289415ba37054"
integrity sha512-xvWcD9s9SWU9HX3GGI50EMLk5epstuCsln358Zno0+DT6jvN2FWwDxaIe6ohRKB4893H1dm0WWbIawXSBSTpNw==

"@rxjs-insights/devtools@^0.5.0":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@rxjs-insights/devtools/-/devtools-0.5.0.tgz#30ce80ef1d682ef222eca4b909a7fcc3f843f0fd"
integrity sha512-C59VFJqLf7SFYq5Vm3n2+NE8IDvzQHyH954cmxRzmUOWfkAZoM+9ZcYkIWM9BunjBdZgq8tych0fezQvUWawTQ==
dependencies:
"@rxjs-insights/core" "^0.5.0"

"@samverschueren/stream-to-observable@^0.3.0":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz#a21117b19ee9be70c379ec1877537ef2e1c63301"
Expand Down

0 comments on commit 08e2a48

Please sign in to comment.