Skip to content

Commit 7b43184

Browse files
committed
V14 Integrations (Semrush)
- Add workspace and manifests
1 parent 0bff1ca commit 7b43184

File tree

5 files changed

+127
-1
lines changed

5 files changed

+127
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { ManifestGlobalContext } from "@umbraco-cms/backoffice/extension-registry";
2+
3+
const contextManifest: ManifestGlobalContext = {
4+
type: "globalContext",
5+
alias: "semrush.context",
6+
name: "Semrush Context",
7+
js: () => import("./semrush.context")
8+
};
9+
10+
export const manifest = contextManifest;

src/Umbraco.Cms.Integrations.SEO.Semrush/Client/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import type { UmbEntryPointOnInit } from "@umbraco-cms/backoffice/extension-api";
22
import { UMB_AUTH_CONTEXT } from "@umbraco-cms/backoffice/auth";
33
import { OpenAPI } from "@umbraco-integrations/semrush/generated";
4+
import { manifest as semrushContext } from "./context/manifest";
5+
import { manifests as workspaceManifest } from "./workspace/manifests";
46

57
export const onInit: UmbEntryPointOnInit = (host, extensionRegistry) => {
68
extensionRegistry.registerMany([
7-
9+
semrushContext,
10+
...workspaceManifest
811
]);
912

1013
host.consumeContext(UMB_AUTH_CONTEXT, async (instance) => {
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import type { ManifestWorkspaceView, ManifestTypes, ManifestWorkspace } from '@umbraco-cms/backoffice/extension-registry';
2+
3+
export const SEMRUSH_WORKSPACE_ALIAS = "Umb.Workspace.Semrush";
4+
5+
const workspace: ManifestWorkspace = {
6+
type: "workspace",
7+
kind: "routable",
8+
alias: SEMRUSH_WORKSPACE_ALIAS,
9+
name: "Form Workspace",
10+
api: () => import("./semrush-workspace.context"),
11+
meta: {
12+
entityType: 'block-grid-type',
13+
},
14+
};
15+
16+
const workspaceView: Array<ManifestWorkspaceView> = [
17+
{
18+
type: "workspaceView",
19+
alias: "Umb.WorkspaceView.Semrush.View",
20+
name: "Umbraco Integration Workspace for Semrush",
21+
element: () => import("./semrush-workspace.element"),
22+
weight: 30,
23+
meta: {
24+
label: "Semrush",
25+
pathname: "semrush",
26+
icon: "info",
27+
},
28+
conditions: [
29+
{
30+
alias: "Umb.Condition.WorkspaceAlias",
31+
match: SEMRUSH_WORKSPACE_ALIAS,
32+
},
33+
],
34+
},
35+
];
36+
37+
export const manifests: Array<ManifestTypes> = [...workspaceView, workspace];
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { UmbBlockTypeWithGroupKey } from "@umbraco-cms/backoffice/block-type";
2+
import { UmbControllerHost } from "@umbraco-cms/backoffice/controller-api";
3+
import { Observable, UmbObjectState } from "@umbraco-cms/backoffice/observable-api";
4+
import { UmbPropertyDatasetContext } from "@umbraco-cms/backoffice/property";
5+
import { UmbVariantId } from "@umbraco-cms/backoffice/variant";
6+
import { UmbInvariantDatasetWorkspaceContext, UmbRoutableWorkspaceContext, UmbSubmittableWorkspaceContextBase } from "@umbraco-cms/backoffice/workspace";
7+
8+
export class SemrushWorkspaceContext<BlockTypeData extends UmbBlockTypeWithGroupKey = UmbBlockTypeWithGroupKey>
9+
extends UmbSubmittableWorkspaceContextBase<BlockTypeData>
10+
implements UmbInvariantDatasetWorkspaceContext, UmbRoutableWorkspaceContext{
11+
#data = new UmbObjectState<BlockTypeData | undefined>(undefined);
12+
readonly unique = this.#data.asObservablePart((data) => data?.contentElementTypeKey);
13+
getUnique(): string | undefined {
14+
throw new Error("Method not implemented.");
15+
}
16+
getEntityType(): string {
17+
throw new Error("Method not implemented.");
18+
}
19+
getData(): BlockTypeData | undefined {
20+
throw new Error("Method not implemented.");
21+
}
22+
protected submit(): Promise<void> {
23+
throw new Error("Method not implemented.");
24+
}
25+
26+
readonly name = this.#data.asObservablePart(() => 'block');
27+
28+
getName(): string | undefined {
29+
throw new Error("Method not implemented.");
30+
}
31+
setName(name: string): void {
32+
throw new Error("Method not implemented.");
33+
}
34+
propertyValueByAlias<ReturnType = unknown>(alias: string): Promise<Observable<ReturnType | undefined>> {
35+
throw new Error("Method not implemented.");
36+
}
37+
getPropertyValue<ReturnType = unknown>(alias: string): ReturnType {
38+
throw new Error("Method not implemented.");
39+
}
40+
setPropertyValue(alias: string, value: unknown): Promise<void> {
41+
throw new Error("Method not implemented.");
42+
}
43+
createPropertyDatasetContext(host: UmbControllerHost, variantId?: UmbVariantId): UmbPropertyDatasetContext {
44+
throw new Error("Method not implemented.");
45+
}
46+
47+
}
48+
49+
export { SemrushWorkspaceContext as api };
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
2+
import { css, html, nothing, customElement, state } from '@umbraco-cms/backoffice/external/lit';
3+
import { SEMRUSH_CONTEXT_TOKEN } from '../context/semrush.context';
4+
import type { UmbTableColumn, UmbTableItem } from '@umbraco-cms/backoffice/components';
5+
import { UUIPaginationEvent } from '@umbraco-cms/backoffice/external/uui';
6+
import { UmbPaginationManager } from "@umbraco-cms/backoffice/utils";
7+
8+
const elementName = "semrush-workspace-view";
9+
@customElement(elementName)
10+
export class SemrushWorkspaceElement extends UmbLitElement {
11+
constructor() {
12+
super();
13+
}
14+
15+
render(){
16+
return html`
17+
<div>ABCD</div>
18+
`;
19+
}
20+
}
21+
export default SemrushWorkspaceElement;
22+
23+
declare global {
24+
interface HTMLElementTagNameMap {
25+
[elementName]: SemrushWorkspaceElement;
26+
}
27+
}

0 commit comments

Comments
 (0)