Skip to content

Commit 1932f54

Browse files
kavillarupal-bq
authored andcommitted
[Dashboard listing] update edit url and view url
Update to include BASE_URL if basePath is defined. Since create url is just a direct nav and needs the basePath when passing props to the provider, the source code no longer appends the basePath to keep these URLs consistent. A feature should consolidate the basePaths in the dashboard listing service so that createUrl also adds the base path. At which point we no longer need the base path. Also removed some rogue URLs. Core PR: opensearch-project/OpenSearch-Dashboards#3922 Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
1 parent 1749156 commit 1932f54

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

public/components/custom_panels/custom_panel_view_so.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ export const CustomPanelViewSO = (props: CustomPanelViewProps) => {
296296
}, [panel]);
297297

298298
const cancelEdit = () => {
299-
console.log('cancelEdits');
300299
dispatch(fetchPanel(panelId));
301300
setIsEditing(false);
302301
};

public/components/trace_analytics/requests/dashboard_request_handler.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,7 @@ export const handleJaegerDashboardRequest = async (
191191
return map;
192192
})
193193
.catch((error) => {
194-
console.log("error here")
195-
console.error(error)
196-
197-
setToast('hello')
194+
console.error(error);
198195
});
199196

200197
await handleDslRequest(http, DSL, getJaegerDashboardQuery(), mode, true, setShowTimeoutToast)

public/plugin.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export class ObservabilityPlugin
8484
core: CoreSetup<AppPluginStartDependencies>,
8585
setupDeps: SetupDependencies
8686
): ObservabilitySetup {
87-
console.log('core: ', core, ', setupDeps: ', setupDeps);
8887
uiSettingsService.init(core.uiSettings, core.notifications);
8988
const pplService = new PPLService(core.http);
9089
const qm = new QueryManager();
@@ -108,16 +107,16 @@ export class ObservabilityPlugin
108107
// if (window.location.pathname.includes('application_analytics')) {
109108
// window.location.assign(convertLegacyAppAnalyticsUrl(window.location));
110109
// }
111-
110+
const BASE_URL = core.http.basePath.prepend('/app/observability-dashboards#');
112111
setupDeps.dashboard.registerDashboardProvider({
113112
appId: 'observability-panel',
114113
savedObjectsType: 'observability-panel',
115114
savedObjectsName: 'Observability',
116-
editUrlPathFn: (obj: SavedObject) => `/app/observability-dashboards#/${obj.id}/edit`,
117-
viewUrlPathFn: (obj: SavedObject) => `/app/observability-dashboards#/${obj.id}`,
115+
editUrlPathFn: (obj: SavedObject) => `${BASE_URL}/${obj.id}/edit`,
116+
viewUrlPathFn: (obj: SavedObject) => `${BASE_URL}/${obj.id}`,
118117
createLinkText: 'Observability Dashboard',
119118
createSortText: 'Observability Dashboard',
120-
createUrl: '/app/observability-dashboards#/create',
119+
createUrl: `${BASE_URL}/create`,
121120
});
122121

123122
const OBSERVABILITY_APP_CATEGORIES: Record<string, AppCategory> = Object.freeze({
@@ -131,7 +130,6 @@ export class ObservabilityPlugin
131130
});
132131

133132
const appMountWithStartPage = (startPage: string) => async (params: AppMountParameters) => {
134-
console.log('start page: ', startPage);
135133
const { Observability } = await import('./components/index');
136134
const [coreStart, depsStart] = await core.getStartServices();
137135
const dslService = new DSLService(coreStart.http);

public/services/saved_objects/saved_object_savers/ppl/save_as_new_query.ts

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export class SaveAsNewQuery extends SavedQuerySaver {
2424
const { batch, dispatch, changeQuery, updateTabName } = this.dispatchers;
2525
const { tabId, history, notifications, showPermissionErrorToast } = this.saveContext;
2626
const { name } = this.saveParams;
27-
console.log('this.saveParams: ', this.saveParams);
2827
this.saveClient
2928
.create({ ...this.saveParams })
3029
.then((res: any) => {

0 commit comments

Comments
 (0)