Skip to content

Commit

Permalink
fix: Clean up for release (#2)
Browse files Browse the repository at this point in the history
* Clean up for release

* update to upload-artifactv4

* Fix descriptions
  • Loading branch information
MichaelKowal authored Jan 31, 2025
1 parent 2c9b548 commit e92ef28
Show file tree
Hide file tree
Showing 13 changed files with 402 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- run: cp LICENSE package.json README.md build

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: release
path: build/
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
access=public
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tabWidth": 4
}
11 changes: 11 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"preset": "conventionalcommits",
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"main",
"next",
"next-major",
{ "name": "beta", "prerelease": true },
{ "name": "alpha", "prerelease": true }
]
}
76 changes: 71 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"name": "vertigis-workflow-project",
"private": true,
"version": "1.0.0",
"description": "",
"license": "UNLICENSED",
"author": "",
"name": "@vertigis/workflow-activities-inline",
"version": "0.0.0-semantically-released",
"description": "VertiGIS Studio Workflow activities for VertiGIS Inline",
"license": "MIT",
"author": "VertiGIS",
"homepage": "https://github.com/vertigis/workflow-activities-inline#readme",
"keywords": [
"VertiGIS",
"Workflow",
"Inline",
"ArcGIS",
"GIS"
],
"scripts": {
"build": "vertigis-workflow-sdk build",
"generate": "vertigis-workflow-sdk generate",
Expand All @@ -16,6 +23,8 @@
"@arcgis/core": "^4.31.2",
"@vertigis/workflow": "5.43.0",
"@vertigis/workflow-sdk": "5.0.0",
"conventional-changelog-conventionalcommits": "^7.0.2",
"prettier": "^3.2.4",
"typescript": "^5.4.3"
},
"browserslist": [
Expand Down
37 changes: 23 additions & 14 deletions src/activities/GetCurrentRouteGeometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import { LinearReferencingConfig } from "../models/LinearReferencingConfig";
import SpatialReference from "@arcgis/core/geometry/SpatialReference";
import { trimFeatureSetToRange } from "../utils/geometryUtils";

/** An interface that defines the inputs of the activity. */
interface GetCurrentRouteGeometryInputs {
/**
* The Inline Manager of the current instance of VertiGIS Inline.
*
*
* @displayName Inline Manager
* @description The Inline Manager of the current instance of VertiGIS Inline.
* @required
Expand All @@ -17,40 +16,50 @@ interface GetCurrentRouteGeometryInputs {

/**
* Whether to trim the geometry to the current range or return the entire route. Default is false.
*
*
* @displayName Trim To Range
* @description Whether to trim the geometry to the current range or return the entire route. Default is false.
*/
trimToRange: boolean;
}

/** An interface that defines the outputs of the activity. */
interface GetCurrentRouteGeometryOutputs {
/**
* @description The result of the activity.
* The geometry of the current highlighted route or range.
*
* @displayName Geometry
* @description The geometry of the current highlighted route or range.
*/
geometry: __esri.Geometry | __esri.Geometry[];
}

/**
* Get the geometry of the current highlighted route.
*
* @displayName Get Current Route Geometry
* @category VertiGIS Inline
* @description Get the geometry of the current highlighted route.
* @description Get the geometry of the current highlighted route or range.
*/
export default class GetCurrentRouteGeometryActivity implements IActivityHandler {
/** Perform the execution logic of the activity. */
async execute(inputs: GetCurrentRouteGeometryInputs): Promise<GetCurrentRouteGeometryOutputs> {
const lrs = inputs.inlineManager.linearReferencingConfig as LinearReferencingConfig;
export default class GetCurrentRouteGeometryActivity
implements IActivityHandler
{
async execute(
inputs: GetCurrentRouteGeometryInputs,
): Promise<GetCurrentRouteGeometryOutputs> {
const lrs = inputs.inlineManager
.linearReferencingConfig as LinearReferencingConfig;
const sr = inputs.inlineManager.spatialReference as SpatialReference;
const routeId = inputs.inlineManager.currentRoute.routeId as string;

const route = await getSegmentsForRoute(lrs, routeId, sr);

if (inputs.trimToRange) {
const start = inputs.inlineManager.currentRange.beginStation.measure as number;
const end = inputs.inlineManager.currentRange.endStation.measure as number;

trimFeatureSetToRange(route, start, end, lrs)
const start = inputs.inlineManager.currentRange.beginStation
.measure as number;
const end = inputs.inlineManager.currentRange.endStation
.measure as number;

trimFeatureSetToRange(route, start, end, lrs);
}

// The response will have one feature. We need the geometry included with that feature.
Expand Down
Loading

0 comments on commit e92ef28

Please sign in to comment.