refactor: ingestionStatus renamed to activeIngestions
This commit is contained in:
@@ -484,7 +484,7 @@ export class ArchicadBridge {
|
||||
)
|
||||
|
||||
if (canCreateIngestion.queryAvailable) {
|
||||
const ingestionId = hostAppStore.ingestionStatus[args.modelCardId]
|
||||
const ingestionId = hostAppStore.activeIngestions[args.modelCardId]
|
||||
if (!ingestionId) {
|
||||
throw new Error(`Ingestion failed: Ingestion ID not found to create version.`)
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ export class SketchupBridge extends BaseBridge {
|
||||
)
|
||||
|
||||
if (canCreateIngestion.queryAvailable) {
|
||||
const ingestionId = hostAppStore.ingestionStatus[args.modelCardId]
|
||||
const ingestionId = hostAppStore.activeIngestions[args.modelCardId]
|
||||
if (!ingestionId) {
|
||||
throw new Error(`Ingestion failed: Ingestion ID not found to create version.`)
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export const useModelIngestion = () => {
|
||||
progressMessage: string,
|
||||
sourceData: SourceDataInput
|
||||
) => {
|
||||
const { ingestionStatus } = storeToRefs(store)
|
||||
const { activeIngestions } = storeToRefs(store)
|
||||
const client = accountStore.getAccountClient(senderModelCard.accountId)
|
||||
const { mutate } = provideApolloClient(client)(() =>
|
||||
useMutation(createModelIngestion)
|
||||
@@ -53,7 +53,7 @@ export const useModelIngestion = () => {
|
||||
|
||||
const ingestionId = res?.data?.projectMutations.modelIngestionMutations.create.id
|
||||
if (ingestionId) {
|
||||
ingestionStatus.value[senderModelCard.modelCardId] = ingestionId
|
||||
activeIngestions.value[senderModelCard.modelCardId] = ingestionId
|
||||
}
|
||||
|
||||
return res?.data?.projectMutations.modelIngestionMutations.create
|
||||
@@ -110,11 +110,11 @@ export const useModelIngestion = () => {
|
||||
throw new Error(res.errors[0].message)
|
||||
}
|
||||
|
||||
const { ingestionStatus } = storeToRefs(store)
|
||||
const { activeIngestions } = storeToRefs(store)
|
||||
|
||||
// clean the failed ingestion
|
||||
ingestionStatus.value = Object.fromEntries(
|
||||
Object.entries(ingestionStatus.value).filter(
|
||||
activeIngestions.value = Object.fromEntries(
|
||||
Object.entries(activeIngestions.value).filter(
|
||||
([key]) => key !== senderModelCard.modelCardId
|
||||
)
|
||||
)
|
||||
@@ -142,11 +142,11 @@ export const useModelIngestion = () => {
|
||||
throw new Error(res.errors[0].message)
|
||||
}
|
||||
|
||||
const { ingestionStatus } = storeToRefs(store)
|
||||
const { activeIngestions } = storeToRefs(store)
|
||||
|
||||
// clean the cancelled ingestion
|
||||
ingestionStatus.value = Object.fromEntries(
|
||||
Object.entries(ingestionStatus.value).filter(
|
||||
activeIngestions.value = Object.fromEntries(
|
||||
Object.entries(activeIngestions.value).filter(
|
||||
([key]) => key !== senderModelCard.modelCardId
|
||||
)
|
||||
)
|
||||
@@ -174,11 +174,11 @@ export const useModelIngestion = () => {
|
||||
throw new Error(res.errors[0].message)
|
||||
}
|
||||
|
||||
const { ingestionStatus } = storeToRefs(store)
|
||||
const { activeIngestions } = storeToRefs(store)
|
||||
|
||||
// clean the completed ingestion
|
||||
ingestionStatus.value = Object.fromEntries(
|
||||
Object.entries(ingestionStatus.value).filter(
|
||||
activeIngestions.value = Object.fromEntries(
|
||||
Object.entries(activeIngestions.value).filter(
|
||||
([key]) => key !== senderModelCard.modelCardId
|
||||
)
|
||||
)
|
||||
|
||||
+6
-6
@@ -75,7 +75,7 @@ export const useHostAppStore = defineStore('hostAppStore', () => {
|
||||
const availableSelectSendFilters = ref<Record<string, SendFilterSelect>>({})
|
||||
|
||||
// kvp for modelCardId - ingestionId
|
||||
const ingestionStatus = ref<Record<string, string>>({})
|
||||
const activeIngestions = ref<Record<string, string>>({})
|
||||
|
||||
const dismissNotification = () => {
|
||||
currentNotification.value = null
|
||||
@@ -314,7 +314,7 @@ export const useHostAppStore = defineStore('hostAppStore', () => {
|
||||
|
||||
if (canCreateIngestion.queryAvailable) {
|
||||
const ingestionId = modelCard
|
||||
? ingestionStatus.value[modelCard.modelCardId]
|
||||
? activeIngestions.value[modelCard.modelCardId]
|
||||
: undefined
|
||||
if (ingestionId && modelCard) {
|
||||
try {
|
||||
@@ -472,7 +472,7 @@ export const useHostAppStore = defineStore('hostAppStore', () => {
|
||||
|
||||
// Cancel the ingestion if applicable
|
||||
if (shouldHandleIngestion.value) {
|
||||
const ingestionId = ingestionStatus.value[modelCardId]
|
||||
const ingestionId = activeIngestions.value[modelCardId]
|
||||
if (ingestionId) {
|
||||
await cancelIngestion(model, ingestionId, 'Cancelled by user')
|
||||
}
|
||||
@@ -592,7 +592,7 @@ export const useHostAppStore = defineStore('hostAppStore', () => {
|
||||
model.typeDiscriminator.includes('SenderModelCard') &&
|
||||
shouldHandleIngestion.value // for the connectors that don't have SDK to handle graqhql
|
||||
) {
|
||||
const ingestionId = ingestionStatus.value[args.modelCardId]
|
||||
const ingestionId = activeIngestions.value[args.modelCardId]
|
||||
if (ingestionId) {
|
||||
await updateIngestion(
|
||||
model,
|
||||
@@ -626,7 +626,7 @@ export const useHostAppStore = defineStore('hostAppStore', () => {
|
||||
model.typeDiscriminator.includes('SenderModelCard') &&
|
||||
shouldHandleIngestion.value
|
||||
) {
|
||||
const ingestionId = ingestionStatus.value[args.modelCardId]
|
||||
const ingestionId = activeIngestions.value[args.modelCardId]
|
||||
if (ingestionId) {
|
||||
const errorMessage =
|
||||
typeof args.error === 'string' ? args.error : args.error.errorMessage
|
||||
@@ -878,7 +878,7 @@ export const useHostAppStore = defineStore('hostAppStore', () => {
|
||||
hostAppName,
|
||||
hostAppVersion,
|
||||
connectorVersion,
|
||||
ingestionStatus,
|
||||
activeIngestions,
|
||||
isConnectorUpToDate,
|
||||
latestAvailableVersion,
|
||||
documentInfo,
|
||||
|
||||
Reference in New Issue
Block a user