diff --git a/src/persistence/mapiObjectStorage.ts b/src/persistence/mapiObjectStorage.ts index b2792567f..376f81549 100644 --- a/src/persistence/mapiObjectStorage.ts +++ b/src/persistence/mapiObjectStorage.ts @@ -7,6 +7,7 @@ import { ArmResource } from "../contracts/armResource"; import { AppError } from "../errors"; import { defaultPageSize } from "../constants"; import { PageContract } from "../contracts/page"; +import { LocaleModel } from "@paperbits/common/localization"; const localizedContentTypes = ["page", "layout", "blogpost", "navigation", "block"]; @@ -374,6 +375,18 @@ export class MapiObjectStorage implements IObjectStorage { const isLocalized = localizedContentTypes.includes(contentType); const localeSearchPrefix = isLocalized ? `${selectedLocale}/` : ""; + if (key === "locales") { + const pageOfLocales: Page = { + value: [{ + key: `contentTypes/locales/contentItem/en_us`, + code: "en-us", + displayName: "English (US)" + }] + }; + + return pageOfLocales; + } + try { let filterQueryString = ""; let orderQueryString = ""; @@ -422,10 +435,8 @@ export class MapiObjectStorage implements IObjectStorage { const paperbitsContract = this.convertArmContractToPaperbitsContract(armContract, isLocalized); return paperbitsContract.nodes; } - else { - return await this.loadNextPage(resource, localeSearchPrefix, filterQueryString, orderQueryString, 0, isLocalized); - } + return await this.loadNextPage(resource, localeSearchPrefix, filterQueryString, orderQueryString, 0, isLocalized); } catch (error) { throw new AppError(`Could not search object '${key}'. Error: ${error.message}`, error); diff --git a/src/services/oauthService.ts b/src/services/oauthService.ts index fb7de8985..a38ecefa8 100644 --- a/src/services/oauthService.ts +++ b/src/services/oauthService.ts @@ -88,7 +88,7 @@ export class OAuthService { * @param backendUrl {string} Portal backend URL. * @param authorizationServer {AuthorizationServer} Authorization server details. */ - public authenticateImplicit(backendUrl: string, authorizationServer: AuthorizationServer): Promise { + public authenticateImplicit(backendUrl: string, authorizationServer: AuthorizationServer): Promise { const redirectUri = `${backendUrl}/signin-oauth/implicit/callback`; const query = { state: Utils.guid() @@ -120,7 +120,13 @@ export class OAuthService { } const oauthToken = await oauthClient.token.getToken(redirectUri + tokenHash); - resolve(`${oauthToken.tokenType} ${oauthToken.accessToken}`); + + if (oauthToken.accessToken) { + resolve(`${oauthToken.tokenType} ${oauthToken.accessToken}`); + } + else if (oauthToken.data?.id_token) { + resolve(`Bearer ${oauthToken.data.id_token}`); + } }; window.addEventListener("message", receiveMessage, false); diff --git a/src/themes/website/styles/widgets/collapsibles.scss b/src/themes/website/styles/widgets/collapsibles.scss index 0f831b1a8..d08d93ed9 100644 --- a/src/themes/website/styles/widgets/collapsibles.scss +++ b/src/themes/website/styles/widgets/collapsibles.scss @@ -98,3 +98,15 @@ } } } + +.collapsible-dropdown { + position: absolute; + background: #fff; + box-shadow: 1px 1px 3px 0 rgba(0, 0, 0, 0.5); + z-index: 9000; + padding: 20px; + width: 100%; + top: 100%; + left: 0; + right: 0; +} \ No newline at end of file