catalog-import: use type locally
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
This commit is contained in:
@@ -244,7 +244,11 @@ export type PreparePullRequestFormProps<
|
||||
export type PrepareResult =
|
||||
| {
|
||||
type: 'locations';
|
||||
locations: NewLocations;
|
||||
locations: Array<{
|
||||
exists?: boolean;
|
||||
target: string;
|
||||
entities: CompoundEntityRef[];
|
||||
}>;
|
||||
}
|
||||
| {
|
||||
type: 'repository';
|
||||
@@ -360,5 +364,4 @@ export interface StepPrepareCreatePullRequestProps {
|
||||
// Warnings were encountered during analysis:
|
||||
//
|
||||
// src/api/CatalogImportApi.d.ts:25:5 - (ae-forgotten-export) The symbol "PartialEntity" needs to be exported by the entry point index.d.ts
|
||||
// src/components/useImportState.d.ts:21:5 - (ae-forgotten-export) The symbol "NewLocations" needs to be exported by the entry point index.d.ts
|
||||
```
|
||||
|
||||
+5
-7
@@ -31,15 +31,13 @@ type Props = {
|
||||
onReset: () => void;
|
||||
};
|
||||
|
||||
type NewLocations = Array<{
|
||||
exists?: boolean;
|
||||
target: string;
|
||||
entities: CompoundEntityRef[];
|
||||
}>;
|
||||
|
||||
// Among the newly registered entities, return a software entity (e.g. Component, API, Resource)
|
||||
const filterComponentEntity = (
|
||||
newLocations: NewLocations,
|
||||
newLocations: Array<{
|
||||
exists?: boolean;
|
||||
target: string;
|
||||
entities: CompoundEntityRef[];
|
||||
}>,
|
||||
): CompoundEntityRef | null => {
|
||||
for (const location of newLocations) {
|
||||
for (const entity of location.entities) {
|
||||
|
||||
@@ -32,12 +32,6 @@ export type ImportFlows =
|
||||
// the available states of the stepper
|
||||
type ImportStateTypes = 'analyze' | 'prepare' | 'review' | 'finish';
|
||||
|
||||
type NewLocations = Array<{
|
||||
exists?: boolean;
|
||||
target: string;
|
||||
entities: CompoundEntityRef[];
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Result of the prepare state.
|
||||
*
|
||||
@@ -46,7 +40,11 @@ type NewLocations = Array<{
|
||||
export type PrepareResult =
|
||||
| {
|
||||
type: 'locations';
|
||||
locations: NewLocations;
|
||||
locations: Array<{
|
||||
exists?: boolean;
|
||||
target: string;
|
||||
entities: CompoundEntityRef[];
|
||||
}>;
|
||||
}
|
||||
| {
|
||||
type: 'repository';
|
||||
|
||||
Reference in New Issue
Block a user