Skip to content

Commit 07cb1f5

Browse files
committed
remove the parseAppUrl unused core API
1 parent a8cae8e commit 07cb1f5

15 files changed

Lines changed: 1 addition & 128 deletions

docs/development/core/public/kibana-plugin-core-public.applicationstart.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ export interface ApplicationStart
2626
| [getUrlForApp(appId, options)](./kibana-plugin-core-public.applicationstart.geturlforapp.md) | Returns an URL to a given app, including the global base path. By default, the URL is relative (/basePath/app/my-app). Use the <code>absolute</code> option to generate an absolute url (http://host:port/basePath/app/my-app)<!-- -->Note that when generating absolute urls, the origin (protocol, host and port) are determined from the browser's location. |
2727
| [navigateToApp(appId, options)](./kibana-plugin-core-public.applicationstart.navigatetoapp.md) | Navigate to a given app |
2828
| [navigateToUrl(url)](./kibana-plugin-core-public.applicationstart.navigatetourl.md) | Navigate to given url, which can either be an absolute url or a relative path, in a SPA friendly way when possible.<!-- -->If all these criteria are true for the given url: - (only for absolute URLs) The origin of the URL matches the origin of the browser's current location - The pathname of the URL starts with the current basePath (eg. /mybasepath/s/my-space) - The pathname segment after the basePath matches any known application route (eg. /app/<id>/ or any application's <code>appRoute</code> configuration)<!-- -->Then a SPA navigation will be performed using <code>navigateToApp</code> using the corresponding application and path. Otherwise, fallback to a full page reload to navigate to the url using <code>window.location.assign</code> |
29-
| [parseAppUrl(url)](./kibana-plugin-core-public.applicationstart.parseappurl.md) | Parse given url, which can either be an absolute url or a relative path including the basePath, and return the corresponding app info if available. |
3029
| [registerMountContext(contextName, provider)](./kibana-plugin-core-public.applicationstart.registermountcontext.md) | Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context. Deprecated, use [CoreSetup.getStartServices](./kibana-plugin-core-public.coresetup.getstartservices.md)<!-- -->. |
3130

docs/development/core/public/kibana-plugin-core-public.applicationstart.parseappurl.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

docs/development/core/public/kibana-plugin-core-public.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
100100
| [OverlayRef](./kibana-plugin-core-public.overlayref.md) | Returned by [OverlayStart](./kibana-plugin-core-public.overlaystart.md) methods for closing a mounted overlay. |
101101
| [OverlayStart](./kibana-plugin-core-public.overlaystart.md) | |
102102
| [PackageInfo](./kibana-plugin-core-public.packageinfo.md) | |
103-
| [ParsedAppUrl](./kibana-plugin-core-public.parsedappurl.md) | Application info returned by [ApplicationStart.parseAppUrl()](./kibana-plugin-core-public.applicationstart.parseappurl.md) |
104103
| [Plugin](./kibana-plugin-core-public.plugin.md) | The interface that should be returned by a <code>PluginInitializer</code>. |
105104
| [PluginInitializerContext](./kibana-plugin-core-public.plugininitializercontext.md) | The available core services passed to a <code>PluginInitializer</code> |
106105
| [SavedObject](./kibana-plugin-core-public.savedobject.md) | |

docs/development/core/public/kibana-plugin-core-public.parsedappurl.app.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/development/core/public/kibana-plugin-core-public.parsedappurl.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/development/core/public/kibana-plugin-core-public.parsedappurl.path.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/core/public/application/application_service.mock.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ const createStartContractMock = (): jest.Mocked<ApplicationStart> => {
5454
navigateToApp: jest.fn(),
5555
navigateToUrl: jest.fn(),
5656
getUrlForApp: jest.fn(),
57-
parseAppUrl: jest.fn(),
5857
registerMountContext: jest.fn(),
5958
};
6059
};
@@ -90,7 +89,6 @@ const createInternalStartContractMock = (): jest.Mocked<InternalApplicationStart
9089
currentAppId$: currentAppId$.asObservable(),
9190
getComponent: jest.fn(),
9291
getUrlForApp: jest.fn(),
93-
parseAppUrl: jest.fn(),
9492
navigateToApp: jest.fn().mockImplementation((appId) => currentAppId$.next(appId)),
9593
navigateToUrl: jest.fn(),
9694
registerMountContext: jest.fn(),

src/core/public/application/application_service.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ export class ApplicationService {
310310
const relUrl = http.basePath.prepend(getAppUrl(availableMounters, appId, path));
311311
return absolute ? relativeToAbsolute(relUrl) : relUrl;
312312
},
313-
parseAppUrl: (url) => parseAppUrl(url, http.basePath, this.apps),
314313
navigateToApp,
315314
navigateToUrl: async (url) => {
316315
const appInfo = parseAppUrl(url, http.basePath, this.apps);

src/core/public/application/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export {
4242
LegacyApp,
4343
PublicAppInfo,
4444
PublicLegacyAppInfo,
45-
ParsedAppUrl,
4645
// Internal types
4746
InternalApplicationSetup,
4847
InternalApplicationStart,

src/core/public/application/types.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -574,11 +574,7 @@ export type Mounter<T = App | LegacyApp> = SelectivePartial<
574574
T extends LegacyApp ? never : 'unmountBeforeMounting'
575575
>;
576576

577-
/**
578-
* Application info returned by {@link ApplicationStart.parseAppUrl}
579-
*
580-
* @public
581-
*/
577+
/** @internal */
582578
export interface ParsedAppUrl {
583579
app: string;
584580
path?: string;
@@ -726,26 +722,6 @@ export interface ApplicationStart {
726722
*/
727723
navigateToUrl(url: string): Promise<void>;
728724

729-
/**
730-
* Parse given url, which can either be an absolute url or a relative path including the basePath, and
731-
* return the corresponding app info if available.
732-
*
733-
* @example
734-
* ```ts
735-
* // current url: `https://kibana:8080/base-path/s/my-space/app/dashboard`
736-
*
737-
* // will return `{ app: 'discover', path: '/some-path?foo=bar'}`
738-
* application.parseAppUrl('https://kibana:8080/base-path/s/my-space/app/discover/some-path?foo=bar')
739-
* application.parseAppUrl('/base-path/s/my-space/app/discover/some-path?foo=bar')
740-
*
741-
* // will return `undefined`
742-
* application.parseAppUrl('https://elsewhere:8080/base-path/s/my-space/app/discover/some-path') // origin does not match
743-
* application.parseAppUrl('/app/discover/some-path') // does not include the current basePath
744-
* application.parseAppUrl('/base-path/s/my-space/app/unknown-app/some-path') // unknown application
745-
* ```
746-
*/
747-
parseAppUrl(url: string): ParsedAppUrl | undefined;
748-
749725
/**
750726
* Returns an URL to a given app, including the global base path.
751727
* By default, the URL is relative (/basePath/app/my-app).

0 commit comments

Comments
 (0)