-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from Azure/users/v-aryapparov/onboarding-v2-da…
…shboard onboarding v2 dashboard
- Loading branch information
Showing
36 changed files
with
877 additions
and
983 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
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,42 @@ | ||
import { getEnvs } from 'common/functions'; | ||
import { useUserStore } from '../store/user.store'; | ||
|
||
const uploadApiVersion = '2.0'; | ||
const creatorApiVersion = '2023-03-01-preview'; | ||
|
||
const getUploads = () => { | ||
const { geography, subscriptionKey } = useUserStore.getState(); | ||
const url = `${getEnvs()[geography].URL}/mapData?api-version=${uploadApiVersion}&subscription-key=${subscriptionKey}`; | ||
return fetch(url); | ||
}; | ||
|
||
const getConversions = () => { | ||
const { geography, subscriptionKey } = useUserStore.getState(); | ||
const url = `${getEnvs()[geography].URL}/conversions?api-version=${creatorApiVersion}&subscription-key=${subscriptionKey}`; | ||
return fetch(url); | ||
}; | ||
|
||
const getDatasets = () => { | ||
const { geography, subscriptionKey } = useUserStore.getState(); | ||
const url = `${getEnvs()[geography].URL}/datasets?api-version=${creatorApiVersion}&subscription-key=${subscriptionKey}`; | ||
return fetch(url); | ||
}; | ||
|
||
const getTilesets = () => { | ||
const { geography, subscriptionKey } = useUserStore.getState(); | ||
const url = `${getEnvs()[geography].URL}/tilesets?api-version=${creatorApiVersion}&subscription-key=${subscriptionKey}`; | ||
return fetch(url); | ||
}; | ||
|
||
export const getAllData = () => ( | ||
Promise.all([getUploads(), getConversions(), getDatasets(), getTilesets()]).then(re => ( | ||
Promise.all([re[0].json(), re[1].json(), re[2].json(), re[3].json()]) | ||
)).then(([uploads, conversions, datasets, tilesets]) => ( | ||
{ | ||
...uploads, | ||
...conversions, | ||
...datasets, | ||
...tilesets, | ||
} | ||
)) | ||
); |
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,21 @@ | ||
import { create } from 'zustand'; | ||
|
||
import { conversionStatuses, conversionSteps} from './conversion.store'; | ||
|
||
export const useConversionPastStore = create((set) => ({ | ||
selectedStep: conversionSteps.upload, | ||
uploadStepStatus: conversionStatuses.empty, | ||
uploadUdId: null, | ||
conversionStepStatus: conversionStatuses.empty, | ||
conversionId: null, | ||
datasetStepStatus: conversionStatuses.empty, | ||
datasetId: null, | ||
tilesetStepStatus: conversionStatuses.empty, | ||
tilesetId: null, | ||
mapConfigurationId: null, | ||
bbox: null, | ||
setStep: (selectedStep) => set({ | ||
selectedStep, | ||
}), | ||
setData: (data) => set(data), | ||
})); |
Oops, something went wrong.