Skip to content

Commit

Permalink
Fixes fetchAssetInformation (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
seicke authored Mar 1, 2025
1 parent 44c3fee commit e123845
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 21 deletions.
4 changes: 2 additions & 2 deletions aas-web-ui/src/composables/Client/AASDiscoveryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export function useAASDiscoveryClient() {
const aasIds = aasDiscoveryResponse.data.result;
if (Array.isArray(aasIds) && aasIds.length > 0) return aasIds[0];
}
} catch {
// handle error
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down
6 changes: 4 additions & 2 deletions aas-web-ui/src/composables/Client/AASRegistryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export function useAASRegistryClient() {
const aasDescriptors = aasRegistryResponse.data.result;
return aasDescriptors;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}
return failResponse;
Expand Down Expand Up @@ -87,7 +88,8 @@ export function useAASRegistryClient() {
) {
return aasRegistryResponse.data;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}
return failResponse;
Expand Down
18 changes: 11 additions & 7 deletions aas-web-ui/src/composables/Client/AASRepositoryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export function useAASRepositoryClient() {
const aasList = aasRepoResponse.data.result;
return aasList;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}
return failResponse;
Expand Down Expand Up @@ -112,7 +113,8 @@ export function useAASRepositoryClient() {

return aas;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down Expand Up @@ -166,7 +168,8 @@ export function useAASRepositoryClient() {
if (aasRepoResponse?.success && aasRepoResponse?.data && Object.keys(aasRepoResponse?.data).length > 0) {
return true;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down Expand Up @@ -253,17 +256,17 @@ export function useAASRepositoryClient() {
assetInformation.defaultThumbnail.path &&
!assetInformation.defaultThumbnail.path.startsWith('http')
) {
// TODO: This does not work with active keycloak because there the thumbnail would have to be fetched with a token
const assetInformationThumbnailEndpoint = assetInformationEndpoint + '/thumbnail';
assetInformation.defaultThumbnail.path = assetInformationThumbnailEndpoint;
assetInformation.defaultThumbnail.isExternal = false;
} else {
} else if (assetInformation.defaultThumbnail) {
assetInformation.defaultThumbnail.isExternal = true;
}

return assetInformation;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down Expand Up @@ -400,7 +403,8 @@ export function useAASRepositoryClient() {
const submodelRefList = aasRepoResponse.data.result;
return submodelRefList;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down
9 changes: 6 additions & 3 deletions aas-web-ui/src/composables/Client/CDRepositoryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export function useCDRepositoryClient() {
if (cdRepoResponse.success && cdRepoResponse.data.result && cdRepoResponse.data.result.length > 0) {
return cdRepoResponse.data.result;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down Expand Up @@ -105,7 +106,8 @@ export function useCDRepositoryClient() {

return cd;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down Expand Up @@ -160,7 +162,8 @@ export function useCDRepositoryClient() {
if (cdRepoResponse?.success && cdRepoResponse?.data && Object.keys(cdRepoResponse?.data).length > 0) {
return true;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down
6 changes: 4 additions & 2 deletions aas-web-ui/src/composables/Client/SMRegistryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export function useSMRegistryClient() {
) {
return smRegistryResponse.data.result;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}
return failResponse;
Expand Down Expand Up @@ -86,7 +87,8 @@ export function useSMRegistryClient() {
) {
return smRegistryResponse.data;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}
return failResponse;
Expand Down
12 changes: 8 additions & 4 deletions aas-web-ui/src/composables/Client/SMRepositoryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export function useSMRepositoryClient() {
if (smRepoResponse.success && smRepoResponse.data.result && smRepoResponse.data.result.length > 0) {
return smRepoResponse.data.result;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down Expand Up @@ -105,7 +106,8 @@ export function useSMRepositoryClient() {

return sm;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down Expand Up @@ -142,7 +144,8 @@ export function useSMRepositoryClient() {
const sme = smRepoResponse.data;
return sme;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down Expand Up @@ -197,7 +200,8 @@ export function useSMRepositoryClient() {
if (smRepoResponse?.success && smRepoResponse?.data && Object.keys(smRepoResponse?.data).length > 0) {
return true;
}
} catch {
} catch (e) {
console.warn(e);
return failResponse;
}

Expand Down
3 changes: 2 additions & 1 deletion aas-web-ui/src/composables/DashboardHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export function useDashboardHandling() {
const response = await getRequest(path, context, disableMessage);
if (response.success) return true;
return false;
} catch {
} catch (e) {
console.warn(e);
return false;
}
}
Expand Down

0 comments on commit e123845

Please sign in to comment.