Skip to content

Commit

Permalink
Merge branch 'main' into sass-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
steve9164 authored Oct 17, 2023
2 parents 8ec5dca + 045e7b4 commit 3e0f19c
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Change Log

#### next release (8.3.7)
#### next release (8.4.0)

- **Breaking change:** Replaced `node-sass` with (dart) `sass`
- You will need to update your `TerriaMap` to use `sass` instead of `node-sass`.
- Fix `WebMapServiceCatalogItem` `allowFeaturePicking`
- Allow translation of TableStylingWorkflow.
- Fix "Remove all" not removing selected/picked features
- [The next improvement]
Expand Down
5 changes: 3 additions & 2 deletions buildprocess/ci-cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function makeSafeName(name) {
return name
.toLowerCase()
.replace(/[^-a-z0-9]/g, "-")
.substring(0, 40);
.substring(0, 32)
.replace(/-*$/, "");
}

function createIngress(branches) {
Expand All @@ -73,7 +74,7 @@ function createIngress(branches) {
host: "ci.terria.io",
http: {
paths: branches.map((branch) => ({
path: "/" + branch.name + "(/|$)(.*)",
path: "/" + makeSafeName(branch.name) + "(/|$)(.*)",
pathType: "ImplementationSpecific",
backend: {
service: {
Expand Down
4 changes: 3 additions & 1 deletion buildprocess/ci-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ if [[ $GITHUB_BRANCH =~ ^greenkeeper/ ]]; then
fi

# A version of the branch name that can be used as a DNS name once we prepend and append some stuff.
SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH,,:0:40}" | sed 's/[^-a-z0-9]/-/g')
SAFE_BRANCH_NAME=$(printf '%s' "${GITHUB_BRANCH:0:32}" | sed -e 's/./\L&/g' -e 's/[^-a-z0-9]/-/g' -e 's/-*$//')

[[ $SAFE_BRANCH_NAME != $GITHUB_BRANCH ]] && echo "::warning file=buildprocess/ci-deploy.sh::Branch name sanitised to '${SAFE_BRANCH_NAME}' for kubernetes resources. This may work, however using branch names less than 32 characters long with [a-z0-9] and hyphen separators are preferred"

gh api /repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA} -f state=pending -f context=deployment -f target_url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}

Expand Down
9 changes: 6 additions & 3 deletions lib/Models/Catalog/Ows/WebMapServiceCatalogItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,9 @@ class WebMapServiceCatalogItem
return undefined;
}

imageryProvider.enablePickFeatures = true;
// Reset feature picking for the current imagery layer.
// We disable feature picking for the next imagery layer.
imageryProvider.enablePickFeatures = this.allowFeaturePicking;

return {
imageryProvider,
Expand All @@ -422,6 +424,7 @@ class WebMapServiceCatalogItem
return undefined;
}

// Disable feature picking for the next imagery layer.
imageryProvider.enablePickFeatures = false;

return {
Expand Down Expand Up @@ -574,8 +577,8 @@ class WebMapServiceCatalogItem
tilingScheme: this.tilingScheme,
maximumLevel: this.getMaximumLevel(true) ?? this.maximumLevel,
minimumLevel: this.minimumLevel,
credit: this.attribution,
enablePickFeatures: this.allowFeaturePicking
credit: this.attribution
// Note: we set enablePickFeatures in _currentImageryParts and _nextImageryParts
};

if (isDefined(this.getFeatureInfoFormat?.type)) {
Expand Down
79 changes: 79 additions & 0 deletions test/Models/Catalog/Ows/WebMapServiceCatalogItemSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,85 @@ describe("WebMapServiceCatalogItem", function () {
);
});

it('creates "next" imagery provider when animating', async function () {
const terria = new Terria();
const wmsItem = new WebMapServiceCatalogItem("some-layer", terria);
runInAction(() => {
wmsItem.setTrait(CommonStrata.definition, "url", "http://example.com");
wmsItem.setTrait(
CommonStrata.definition,
"getCapabilitiesUrl",
"test/WMS/styles_and_dimensions.xml"
);
wmsItem.setTrait(CommonStrata.definition, "layers", "C");
wmsItem.setTrait(
CommonStrata.definition,
"currentTime",
"2002-01-01T00:00:00.000Z"
);
});

terria.timelineStack.addToTop(wmsItem);
terria.timelineStack.activate();

(await wmsItem.loadMapItems()).throwIfError();

expect(wmsItem.mapItems.length).toBe(1);
expect(wmsItem.isPaused).toBe(true);

runInAction(() => {
wmsItem.setTrait(CommonStrata.definition, "isPaused", false);
});

expect(wmsItem.mapItems.length).toBe(2);
expect(wmsItem.isPaused).toBe(false);

const currentImageryProvider = wmsItem.mapItems[0]
.imageryProvider as WebMapServiceImageryProvider;
expect(currentImageryProvider instanceof WebMapServiceImageryProvider).toBe(
true
);
expect(currentImageryProvider.enablePickFeatures).toBe(true);

const nextMapItem = wmsItem.mapItems[1];
const nextImageryProvider =
nextMapItem.imageryProvider as WebMapServiceImageryProvider;
expect(nextImageryProvider instanceof WebMapServiceImageryProvider).toBe(
true
);
expect(nextImageryProvider.enablePickFeatures).toBe(false);
expect(nextMapItem.alpha).toBe(0);
expect(nextMapItem.show).toBe(true);
});

it("sets enableFeaturePicking to false", async function () {
const terria = new Terria();
const wmsItem = new WebMapServiceCatalogItem("some-layer", terria);
runInAction(() => {
wmsItem.setTrait(CommonStrata.definition, "url", "http://example.com");
wmsItem.setTrait(CommonStrata.definition, "allowFeaturePicking", false);
wmsItem.setTrait(
CommonStrata.definition,
"getCapabilitiesUrl",
"test/WMS/styles_and_dimensions.xml"
);
wmsItem.setTrait(CommonStrata.definition, "layers", "C");
});

(await wmsItem.loadMetadata()).throwIfError();

expect(wmsItem.mapItems.length).toBe(1);
expect(wmsItem.allowFeaturePicking).toBe(false);

const imageryProvider = wmsItem.mapItems[0]
.imageryProvider as WebMapServiceImageryProvider;
expect(
imageryProvider instanceof WebMapServiceImageryProvider
).toBeTruthy();

expect(imageryProvider.enablePickFeatures).toBe(false);
});

it("dimensions and styles for a 'real' WMS layer", function (done) {
const terria = new Terria();
const wmsItem = new WebMapServiceCatalogItem("some-layer", terria);
Expand Down

0 comments on commit 3e0f19c

Please sign in to comment.