@equinor/fusion
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -9,4 +9,4 @@ import BaseApiClient from './BaseApiClient'; | ||
apiSignInAsync(): Promise<void>; | ||
getHandoverAsync(siteCode: string, projectIdentifier: string): Promise<HttpResponse<HandoverItem[]>>; | ||
getHandoverChildrenAsync<TKey extends keyof HandoverActions, T = HandoverActions[TKey]>(siteCode: string, projectIdentifier: string, commpkgId: string, action: TKey): Promise<HttpResponse<T[]>>; | ||
getHandoverAsync(context: string, invalidateCache: boolean): Promise<HttpResponse<HandoverItem[]>>; | ||
getHandoverChildrenAsync<TKey extends keyof HandoverActions, T = HandoverActions[TKey]>(context: string, commpkgId: string, action: TKey): Promise<HttpResponse<T[]>>; | ||
getAccumulatedItemAsync<TKey extends keyof AccumulatedActions, T = AccumulatedActions[TKey]>(siteCode: string, projectIdentifier: string, action: TKey): Promise<HttpResponse<T[]>>; | ||
@@ -13,0 +13,0 @@ getMilestonesAsync(contextId: string): Promise<HttpResponse<Milestone[]>>; |
@@ -10,8 +10,9 @@ import BaseApiClient from './BaseApiClient'; | ||
} | ||
async getHandoverAsync(siteCode, projectIdentifier) { | ||
const url = this.resourceCollections.dataProxy.handover(siteCode, projectIdentifier); | ||
return await this.httpClient.getAsync(url); | ||
async getHandoverAsync(context, invalidateCache) { | ||
const url = this.resourceCollections.dataProxy.handover(context); | ||
const options = invalidateCache ? { headers: { 'x-pp-cache-policy': 'no-cache' } } : {}; | ||
return await this.httpClient.getAsync(url, options); | ||
} | ||
async getHandoverChildrenAsync(siteCode, projectIdentifier, commpkgId, action) { | ||
const url = this.resourceCollections.dataProxy.handoverChildren(siteCode, projectIdentifier, commpkgId, action); | ||
async getHandoverChildrenAsync(context, commpkgId, action) { | ||
const url = this.resourceCollections.dataProxy.handoverChildren(context, commpkgId, action); | ||
return await this.httpClient.getAsync(url); | ||
@@ -18,0 +19,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { HandoverStatus } from './HandoverStatus'; | ||
export declare type HandoverItem = { | ||
@@ -6,3 +7,3 @@ actualFinishDate: string | null; | ||
commpkgNo: string | null; | ||
commpkgStatus: string | null; | ||
commpkgStatus: HandoverStatus | null; | ||
createdDate: string | null; | ||
@@ -23,2 +24,3 @@ demolitionActualFinishDate: string | null; | ||
hasYellowLineMarkup: boolean; | ||
hasBlueLineMarkup: boolean; | ||
id: string | null; | ||
@@ -36,3 +38,3 @@ isDemolition: boolean; | ||
mcPkgsRFOCSigned: number; | ||
mcStatus: string | null; | ||
mcStatus: HandoverStatus | null; | ||
phase: string | null; | ||
@@ -45,4 +47,8 @@ plannedFinishDate: string | null; | ||
priority3: string | null; | ||
priority1Description: string | null; | ||
priority2Description: string | null; | ||
priority3Description: string | null; | ||
progress: string | null; | ||
projectIdentifier: string | null; | ||
projectDescription: string | null; | ||
remark: string | null; | ||
@@ -49,0 +55,0 @@ responsible: string | null; |
import { ApiClientHookResult } from '../useApiClient'; | ||
import { HandoverItem, HandoverActions } from '../../apiClients/DataProxyClient'; | ||
export declare const useHandover: (siteCode: string, projectIdentifier: string) => ApiClientHookResult<HandoverItem[]>; | ||
export declare function useHanoverChild<TKey extends keyof HandoverActions, T = HandoverActions[TKey]>(siteCode: string, projectIdentifier: string, commpkgId: string, action: TKey): ApiClientHookResult<T[]>; | ||
export declare const useHandover: (context: string, invalidateCache: boolean) => ApiClientHookResult<HandoverItem[]>; | ||
export declare function useHandoverChild<TKey extends keyof HandoverActions, T = HandoverActions[TKey]>(context: string, commpkgId: string, action: TKey): ApiClientHookResult<T[]>; |
import useApiClient from '../useApiClient'; | ||
export const useHandover = (siteCode, projectIdentifier) => { | ||
export const useHandover = (context, invalidateCache) => { | ||
return useApiClient(async (apiClients) => { | ||
const response = await apiClients.dataProxy.getHandoverAsync(siteCode, projectIdentifier); | ||
const response = await apiClients.dataProxy.getHandoverAsync(context, invalidateCache); | ||
return response.data; | ||
}, [siteCode, projectIdentifier]); | ||
}, [context, invalidateCache]); | ||
}; | ||
export function useHanoverChild(siteCode, projectIdentifier, commpkgId, action) { | ||
export function useHandoverChild(context, commpkgId, action) { | ||
return useApiClient(async (apiClients) => { | ||
const response = await apiClients.dataProxy.getHandoverChildrenAsync(siteCode, projectIdentifier, commpkgId, action); | ||
const response = await apiClients.dataProxy.getHandoverChildrenAsync(context, commpkgId, action); | ||
return response.data; | ||
}, [siteCode, projectIdentifier]); | ||
}, [context, commpkgId]); | ||
} |
@@ -26,4 +26,4 @@ import BaseResourceCollection from './BaseResourceCollection'; | ||
apiSignin(): string; | ||
handover(siteCode: string, projectIdentifier: string): string; | ||
handoverChildren(siteCode: string, projectIdentifier: string, commpkgId: string, action: keyof HandoverActions): string; | ||
handover(context: string): string; | ||
handoverChildren(context: string, commpkgId: string, action: keyof HandoverActions): string; | ||
accumulatedItem(siteCode: string, projectIdentifier: string, action: keyof AccumulatedActions): string; | ||
@@ -30,0 +30,0 @@ milestones(contextId: string): string; |
@@ -10,7 +10,7 @@ import BaseResourceCollection from './BaseResourceCollection'; | ||
} | ||
handover(siteCode, projectIdentifier) { | ||
return this.getSiteAndProjectUrl(siteCode, projectIdentifier, 'handover'); | ||
handover(context) { | ||
return combineUrls(this.getBaseUrl(), 'api', 'contexts', context, 'handover'); | ||
} | ||
handoverChildren(siteCode, projectIdentifier, commpkgId, action) { | ||
return this.getSiteAndProjectUrl(siteCode, projectIdentifier, `handover/${commpkgId}/${action}/`); | ||
handoverChildren(context, commpkgId, action) { | ||
return combineUrls(this.handover(context), commpkgId, action); | ||
} | ||
@@ -17,0 +17,0 @@ accumulatedItem(siteCode, projectIdentifier, action) { |
@@ -1,2 +0,2 @@ | ||
declare const _default: "2.4.0"; | ||
declare const _default: "2.4.1"; | ||
export default _default; |
@@ -1,1 +0,1 @@ | ||
export default '2.4.0'; | ||
export default '2.4.1'; |
{ | ||
"name": "@equinor/fusion", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "Everything a Fusion app needs to communicate with the core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
336182
354
7907