Skip to content

Commit

Permalink
refactor(hub-sites): remove hub-sites re-exports from hub-common
Browse files Browse the repository at this point in the history
affects: @esri/hub-common, @esri/hub-sites

BREAKING CHANGE:
remove getTheme(), _addSiteDomains, registerSiteAsApplication, registerBrowserApp from hub-sites
  • Loading branch information
tomwayson committed Jul 26, 2022
1 parent 516b6ee commit b3e2503
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 95 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { getTheme } from "../src";
import { DEFAULT_THEME } from "@esri/hub-common";
import { DEFAULT_THEME, getOrgDefaultTheme } from "../../src";
import { IPortal } from "@esri/arcgis-rest-portal";

describe("getTheme", () => {
describe("getOrgDefaultTheme", () => {
it("returns default theme if no shared theme", async () => {
expect(getTheme({} as IPortal)).toEqual(DEFAULT_THEME);
expect(getOrgDefaultTheme({} as IPortal)).toEqual(DEFAULT_THEME);
});

it("extends default theme ", async () => {
expect(
getTheme({
getOrgDefaultTheme({
portalProperties: {
sharedTheme: {
header: {
Expand Down
21 changes: 0 additions & 21 deletions packages/sites/src/_add-site-domains.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/sites/src/create-site-model-from-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
IModelTemplate,
IHubRequestOptions,
getHubProduct,
getOrgDefaultTheme,
getProp,
cloneObject,
deepSet,
Expand All @@ -12,7 +13,6 @@ import {
} from "@esri/hub-common";
import { createHubTeams } from "@esri/hub-teams";
import { HubTeamType } from "@esri/hub-teams";
import { getTheme } from "./get-theme";
import { getPortalSiteHostname } from "./get-portal-site-hostname";
import { getPortalSiteUrl } from "./get-portal-site-url";
import { _createSiteInitiative } from "./_create-site-initiative";
Expand Down Expand Up @@ -104,7 +104,7 @@ export function createSiteModelFromTemplate(
.then((uniqueSubdomain) => {
const portal = hubRequestOptions.portalSelf;
// TODO: Revisit this if/when we do more site templates which we want to maintain their theme
settings.solution.theme = getTheme(portal);
settings.solution.theme = getOrgDefaultTheme(portal);
// set site-specific settings properties...
settings.solution.subdomain = uniqueSubdomain;
// setup the url properties
Expand Down
15 changes: 0 additions & 15 deletions packages/sites/src/get-theme.ts

This file was deleted.

4 changes: 0 additions & 4 deletions packages/sites/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ export * from "./_get-portal-domain-type-keyword";
export * from "./_ensure-optional-groups-templating";
export * from "./_ensure-type-and-tags";
export * from "./get-site-item-type";
export * from "./_add-site-domains";
export * from "./_ensure-portal-domain-keyword";
export * from "./get-site-edit-url";
export * from "./update-site-application-uris";
export * from "./update-app-redirect-uris";
export * from "./register-site-as-application";
export * from "./register-browser-app";
export * from "./unlink-site-and-page";
export * from "./link-site-and-page";
export * from "./unlink-pages-from-site";
Expand All @@ -33,7 +30,6 @@ export * from "./update-site";
export * from "./create-site";
export * from "./get-portal-site-url";
export * from "./get-portal-site-hostname";
export * from "./get-theme";
export * from "./_create-site-initiative";
export * from "./_update-team-tags";
export * from "./create-site-model-from-template";
Expand Down
24 changes: 0 additions & 24 deletions packages/sites/src/register-browser-app.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/sites/src/register-site-as-application.ts

This file was deleted.

0 comments on commit b3e2503

Please sign in to comment.