-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tech(): refactor buildUiSchema Utils to not take EntityEditorOptions (#…
…1312) * refactor(): update getLocationOptions * refactor(): getFeaturedImageUrl * refactor(): getLocationExtent and getTagItems * refactor(): getThumbnailUiSchemaElement * refactor(): entityEditorOptions just hubEntity type * refactor(): fix typing for location * refactor(): feedback from pr
- Loading branch information
1 parent
02934d7
commit f3cf4a5
Showing
24 changed files
with
673 additions
and
123 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
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
11 changes: 2 additions & 9 deletions
11
...e/schemas/internal/getFeaturedImageUrl.ts → ...ore/schemas/internal/getAuthedImageUrl.ts
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 |
---|---|---|
@@ -1,17 +1,10 @@ | ||
import { IArcGISContext } from "../../../ArcGISContext"; | ||
import { cacheBustUrl } from "../../../urls/cacheBustUrl"; | ||
import { EntityEditorOptions } from "./EditorOptions"; | ||
|
||
export function getFeaturedImageUrl( | ||
options: EntityEditorOptions, | ||
context: IArcGISContext | ||
) { | ||
export function getAuthedImageUrl(url: string, context: IArcGISContext) { | ||
const queryParams = context.isAuthenticated | ||
? `?token=${context.session.token}` | ||
: ""; | ||
// TODO: Decide if the url should be passed in or plucked out of this deep path here | ||
return ( | ||
options.view?.featuredImageUrl && | ||
cacheBustUrl(`${options.view.featuredImageUrl}${queryParams}`) | ||
); | ||
return url && cacheBustUrl(`${url}${queryParams}`); | ||
} |
9 changes: 5 additions & 4 deletions
9
packages/common/src/core/schemas/internal/getLocationExtent.ts
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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { bBoxToExtent, orgExtent } from "../../../extent"; | ||
import { IHubRequestOptions } from "../../../types"; | ||
import { EntityEditorOptions } from "./EditorOptions"; | ||
import { IHubLocation } from "../../types"; | ||
|
||
/** | ||
* Get the extent from the entity's location, if it has one. | ||
* Otherwise, fall back to using the org extent. | ||
*/ | ||
export async function getLocationExtent( | ||
options: EntityEditorOptions, | ||
location: IHubLocation, | ||
hubRequestOptions: IHubRequestOptions | ||
) { | ||
return options.location?.extent?.length | ||
? bBoxToExtent(options.location.extent) | ||
return location?.extent?.length | ||
? bBoxToExtent(location.extent) | ||
: await orgExtent(hubRequestOptions); | ||
} |
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
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
Oops, something went wrong.