move search header app into search domain

This commit is contained in:
Mads Rasmussen
2023-01-02 21:42:34 +01:00
parent e34b2ce66f
commit a51d3d258f
3 changed files with 20 additions and 42 deletions

View File

@@ -1,7 +1,6 @@
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { css, CSSResultGroup, html, LitElement } from 'lit';
import { customElement } from 'lit/decorators.js';
import { ManifestHeaderApp, umbExtensionsRegistry } from '@umbraco-cms/extensions-registry';
@customElement('umb-backoffice-header-apps')
export class UmbBackofficeHeaderApps extends LitElement {
@@ -16,47 +15,6 @@ export class UmbBackofficeHeaderApps extends LitElement {
`,
];
constructor() {
super();
this._registerHeaderApps();
}
// TODO: these registrations should be moved
private _registerHeaderApps() {
const headerApps: Array<ManifestHeaderApp> = [
{
type: 'headerApp',
alias: 'Umb.HeaderApp.Search',
name: 'Header App Search',
loader: () => import('../header-app/header-app-button.element'),
weight: 10,
meta: {
label: 'Search',
icon: 'search',
pathname: 'search',
},
},
{
type: 'headerApp',
alias: 'Umb.HeaderApp.Favorites',
name: 'Header App Favorites',
loader: () => import('../header-app/header-app-button.element'),
weight: 100,
meta: {
label: 'Favorites',
icon: 'favorite',
pathname: 'favorites',
},
},
];
// TODO: Can we make this functionality reuseable...
headerApps.forEach((headerApp) => {
if (umbExtensionsRegistry.isRegistered(headerApp.alias)) return;
umbExtensionsRegistry.register(headerApp);
});
}
render() {
return html` <umb-extension-slot id="apps" type="headerApp"></umb-extension-slot> `;
}

View File

@@ -6,6 +6,7 @@ import { manifests as languageManifests } from './languages/manifests';
import { manifests as propertyActionManifests } from './property-actions/manifests';
import { manifests as propertyEditorModelManifests } from './property-editors/models/manifests';
import { manifests as propertyEditorUIManifests } from './property-editors/uis/manifests';
import { manifests as searchManifests } from './search/manifests';
import { ManifestTypes, umbExtensionsRegistry } from '@umbraco-cms/extensions-registry';
@@ -25,4 +26,5 @@ registerExtensions([
...propertyActionManifests,
...propertyEditorModelManifests,
...propertyEditorUIManifests,
...searchManifests,
]);

View File

@@ -0,0 +1,18 @@
import type { ManifestHeaderApp } from '@umbraco-cms/models';
const headerApps: Array<ManifestHeaderApp> = [
{
type: 'headerApp',
alias: 'Umb.HeaderApp.Search',
name: 'Header App Search',
loader: () => import('src/backoffice/core/components/header-app/header-app-button.element'),
weight: 10,
meta: {
label: 'Search',
icon: 'search',
pathname: 'search',
},
},
];
export const manifests = [...headerApps];