-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
features: - Handler for fetching the current organization info (activated modules, logos, accent colors) fix: - Add base domain to the poi categories icon urls. This fixes image urls pointing to wrong environment.
- Loading branch information
1 parent
d718373
commit 582b12d
Showing
9 changed files
with
130 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) Situm Technologies. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
import { Organization } from "../types"; | ||
|
||
/** | ||
* Adapts the server response to our common Organization object, | ||
* cleaning deprecations, removing redundancies, and more. | ||
* | ||
* @param Organization Not normalized organization | ||
* @param domain Current domain to get the pictures urls | ||
* @returns Organization normalized object | ||
*/ | ||
export function getAdapter( | ||
organization: Record<string, unknown>, | ||
domain: string | ||
): Organization { | ||
organization.logoPath = organization?.logoPath | ||
? domain + organization.logoPath | ||
: undefined; | ||
organization.logoLoginPath = organization?.logoLoginPath | ||
? domain + organization.logoLoginPath | ||
: undefined; | ||
organization.logoFaviconPath = organization?.logoFaviconPath | ||
? domain + organization.logoFaviconPath | ||
: undefined; | ||
|
||
return organization as Organization; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Copyright (c) Situm Technologies. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
import { PoiCategory } from "../types"; | ||
|
||
/** | ||
* Adapts the server response to our common PoiCategory object, | ||
* cleaning deprecations, removing redundancies, and more. | ||
* | ||
* @param poiCategory Not normalized POI Category | ||
* @param domain Current domain to get the icon picture url | ||
* @returns POI Category normalized object | ||
*/ | ||
export function getAdapter( | ||
poiCategory: PoiCategory, | ||
domain: string | ||
): PoiCategory { | ||
poiCategory.iconUrl = !poiCategory.iconUrl.includes("https") | ||
? domain + poiCategory.iconUrl | ||
: poiCategory.iconUrl; | ||
|
||
return poiCategory as PoiCategory; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters