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

[Workspace] Make url stateful in hash with workspace id #5984

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [[Dynamic Configurations] Add support for dynamic application configurations ([#5855](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5855))
- [Workspace] Optional workspaces params in repository ([#5949](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5949))
- [Multiple Datasource] Refactoring create and edit form to use authentication registry ([#6002](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6002))
- [Workspace] Make url stateful in hash with workspace id ([#5984](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5984))

### 🐛 Bug Fixes

Expand Down Expand Up @@ -1039,4 +1040,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### 🔩 Tests

- Update caniuse to fix failed integration tests ([#2322](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2322))
- Update caniuse to fix failed integration tests ([#2322](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2322))
1 change: 1 addition & 0 deletions src/core/public/application/application_service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const createStartContractMock = (): jest.Mocked<ApplicationStart> => {
navigateToUrl: jest.fn(),
getUrlForApp: jest.fn(),
registerMountContext: jest.fn(),
history: createHistoryMock(),
};
};

Expand Down
12 changes: 6 additions & 6 deletions src/core/public/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,12 @@ export interface ApplicationStart {
* An observable that emits the current application id and each subsequent id update.
*/
currentAppId$: Observable<string | undefined>;

/**
* As the history is accessible when mounting the application,
* expose the global history instance to plugin in case plugin needs to listen to history change.
*/
history: History<unknown>;
}

/** @internal */
Expand Down Expand Up @@ -826,10 +832,4 @@ export interface InternalApplicationStart extends Omit<ApplicationStart, 'regist
* @internal
*/
currentActionMenu$: Observable<MountPoint | undefined>;

/**
* The global history instance, exposed only to Core.
* @internal
*/
history: History<unknown>;
}
1 change: 1 addition & 0 deletions src/core/public/plugins/plugin_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export function createPluginStartContext<
getUrlForApp: deps.application.getUrlForApp,
registerMountContext: (contextName, provider) =>
deps.application.registerMountContext(plugin.opaqueId, contextName, provider),
history: deps.application.history,
},
docLinks: deps.docLinks,
http: deps.http,
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/plugins/workspace/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

export const WORKSPACE_ID_STATE_KEY = '_w';
export const WORKSPACE_SAVED_OBJECTS_CLIENT_WRAPPER_ID = 'workspace';
export const WORKSPACE_CONFLICT_CONTROL_SAVED_OBJECTS_CLIENT_WRAPPER_ID =
'workspace_conflict_control';
5 changes: 3 additions & 2 deletions src/plugins/workspace/opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"id": "workspace",
"version": "opensearchDashboards",
"server": true,
"ui": false,
"ui": true,
"requiredPlugins": [
"savedObjects"
"savedObjects",
"opensearchDashboardsUtils"
],
"optionalPlugins": [],
"requiredBundles": []
Expand Down
Loading
Loading