-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/ngageoint/mage-server in…
…to ArcProcessingFacelift
- Loading branch information
Showing
29 changed files
with
1,526 additions
and
1,912 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Build with arcgis plugin | ||
|
||
Follow the instructions in the root README. After completing the web-app package install and build in the 'Building from source' section: | ||
|
||
Build arcgis plugin: | ||
```bash | ||
cd plugins/arcgis/service | ||
npm ci | ||
npm link ../../../service # **IMPORTANT** see root README | ||
npm run build | ||
``` | ||
```bash | ||
cd plugins/arcgis/web-app | ||
npm ci | ||
npm link ../../../web-app # **IMPORTANT** see root README | ||
npm run build | ||
``` | ||
|
||
Continue to install dependencies in the `instance` package as instructed in the root README. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
118 changes: 0 additions & 118 deletions
118
plugins/arcgis/service/src/ArcGISIdentityManagerFactory.ts
This file was deleted.
Oops, something went wrong.
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,57 @@ | ||
import { ArcGISIdentityManager } from '@esri/arcgis-rest-request' | ||
import { FeatureServiceConfig } from './ArcGISConfig' | ||
import { PluginStateRepository } from '@ngageoint/mage.service/lib/plugins.api' | ||
|
||
export interface ArcGISIdentityService { | ||
signin(featureService: FeatureServiceConfig): Promise<ArcGISIdentityManager> | ||
updateIndentityManagers(): Promise<void> | ||
} | ||
|
||
export function createArcGISIdentityService( | ||
stateRepo: PluginStateRepository<any> | ||
): ArcGISIdentityService { | ||
const identityManagerCache: Map<string, Promise<ArcGISIdentityManager>> = new Map() | ||
|
||
return { | ||
async signin(featureService: FeatureServiceConfig): Promise<ArcGISIdentityManager> { | ||
let cached = await identityManagerCache.get(featureService.url) | ||
if (!cached) { | ||
const identityManager = ArcGISIdentityManager.deserialize(featureService.identityManager) | ||
const promise = identityManager.getUser().then(() => identityManager) | ||
identityManagerCache.set(featureService.url, promise) | ||
return promise | ||
} else { | ||
return cached | ||
} | ||
}, | ||
async updateIndentityManagers() { | ||
const config = await stateRepo.get() | ||
for (let [url, persistedIdentityManagerPromise] of identityManagerCache) { | ||
const persistedIdentityManager = await persistedIdentityManagerPromise | ||
const featureService: FeatureServiceConfig | undefined = config.featureServices.find((service: FeatureServiceConfig) => service.url === url) | ||
if (featureService) { | ||
const identityManager = ArcGISIdentityManager.deserialize(featureService.identityManager) | ||
if (identityManager.token !== persistedIdentityManager.token || identityManager.refreshToken !== persistedIdentityManager.refreshToken) { | ||
featureService.identityManager = persistedIdentityManager.serialize() | ||
await stateRepo.put(config) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
export function getPortalUrl(featureService: FeatureServiceConfig | string): string { | ||
const url = getFeatureServiceUrl(featureService) | ||
return `https://${url.hostname}/arcgis/sharing/rest` | ||
} | ||
|
||
export function getServerUrl(featureService: FeatureServiceConfig | string): string { | ||
const url = getFeatureServiceUrl(featureService) | ||
return `https://${url.hostname}/arcgis` | ||
} | ||
|
||
export function getFeatureServiceUrl(featureService: FeatureServiceConfig | string): URL { | ||
const url = typeof featureService === 'string' ? featureService : featureService.url | ||
return new URL(url) | ||
} |
Oops, something went wrong.