-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix!: add support for inclusion of orphans in verbatim PFB (#264) * feat: added tests for file facets status (#264) * feat: added tests for file manifest request filters (#264) * fix: import (#264) --------- Co-authored-by: Fran McDade <[email protected]>
- Loading branch information
Showing
14 changed files
with
479 additions
and
71 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
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
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,34 @@ | ||
import { buildFileManifestRequestURL } from "../../hooks/useFileManifest/common/buildFileManifestRequestURL"; | ||
import { | ||
FileManifestContext, | ||
FileManifestState, | ||
UpdateFileManifestPayload, | ||
} from "../fileManifestState"; | ||
import { getRequestFilters, updateFilesFacetsStatus } from "./utils"; | ||
|
||
/** | ||
* Update file manifest action. | ||
* @param state - State. | ||
* @param payload - Payload. | ||
* @param context - Context. | ||
* @returns state. | ||
*/ | ||
export function updateFileManifestAction( | ||
state: FileManifestState, | ||
payload: UpdateFileManifestPayload, | ||
context: FileManifestContext | ||
): FileManifestState { | ||
const { catalog, URL } = context; | ||
const filesFacetsStatus = updateFilesFacetsStatus(state, payload); | ||
const nextState = { ...state, ...payload, filesFacetsStatus }; | ||
const fileManifestRequest = buildFileManifestRequestURL( | ||
URL, | ||
getRequestFilters(nextState), | ||
catalog, | ||
nextState.fileManifestFormat | ||
); | ||
return { | ||
...nextState, | ||
...fileManifestRequest, | ||
}; | ||
} |
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,31 @@ | ||
import { | ||
FILE_MANIFEST_TYPE, | ||
FILES_FACETS_STATUS, | ||
} from "../../hooks/useFileManifest/common/entities"; | ||
import { FileManifestState } from "../fileManifestState"; | ||
|
||
export const ENTITIES_FILE_MANIFEST_TYPES: FILE_MANIFEST_TYPE[] = [ | ||
FILE_MANIFEST_TYPE.BULK_DOWNLOAD, | ||
FILE_MANIFEST_TYPE.DOWNLOAD_MANIFEST, | ||
FILE_MANIFEST_TYPE.EXPORT_TO_TERRA, | ||
]; | ||
|
||
export const FILE_MANIFEST_STATE: FileManifestState = { | ||
fileManifestFormat: undefined, | ||
fileManifestType: undefined, | ||
fileSummary: undefined, | ||
fileSummaryFacetName: undefined, | ||
fileSummaryFilters: [], | ||
filesFacets: [], | ||
filesFacetsStatus: FILES_FACETS_STATUS.NOT_STARTED, | ||
filters: [], | ||
isEnabled: false, | ||
isFacetsLoading: false, | ||
isFacetsSuccess: false, | ||
isFileSummaryLoading: false, | ||
isLoading: false, | ||
isSummaryLoading: false, | ||
requestParams: undefined, | ||
requestURL: undefined, | ||
summary: undefined, | ||
}; |
Oops, something went wrong.