Skip to content

Commit

Permalink
Bundles forward availability (#24)
Browse files Browse the repository at this point in the history
* restructure bundles.json to express avail fwding

* support multiple parents to a single bundle
  • Loading branch information
Frencil authored Sep 21, 2020
1 parent a83a85f commit aad9e95
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 13 deletions.
74 changes: 72 additions & 2 deletions lib/components/NeonContext/NeonContext.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,43 @@ declare function useNeonContextState(): ({
"DP4.00007.001": string;
"DP4.00137.001": string;
"DP4.00201.001": string;
"DP1.10102.001": string[];
"DP1.10099.001": string[];
"DP1.10053.001": string;
"DP1.10031.001": string;
"DP1.10101.001": string;
"DP1.10080.001": string;
"DP1.10078.001": string;
"DP1.10100.001": string;
"DP1.10008.001": string;
"DP1.00097.001": string;
};
parents: {
"DP4.00200.001": {
forwardAvailability: boolean;
};
"DP1.10067.001": {
forwardAvailability: boolean;
};
"DP1.10026.001": {
forwardAvailability: boolean;
};
"DP1.10033.001": {
forwardAvailability: boolean;
};
"DP1.10086.001": {
forwardAvailability: boolean;
};
"DP1.10047.001": {
forwardAvailability: boolean;
};
"DP1.00096.001": {
forwardAvailability: boolean;
};
"DP1.10066.001": {
forwardAvailability: boolean;
};
};
parents: string[];
};
timeSeriesDataProducts: {
productCodes: string[];
Expand Down Expand Up @@ -893,8 +928,43 @@ declare function useNeonContextState(): ({
"DP4.00007.001": string;
"DP4.00137.001": string;
"DP4.00201.001": string;
"DP1.10102.001": string[];
"DP1.10099.001": string[];
"DP1.10053.001": string;
"DP1.10031.001": string;
"DP1.10101.001": string;
"DP1.10080.001": string;
"DP1.10078.001": string;
"DP1.10100.001": string;
"DP1.10008.001": string;
"DP1.00097.001": string;
};
parents: {
"DP4.00200.001": {
forwardAvailability: boolean;
};
"DP1.10067.001": {
forwardAvailability: boolean;
};
"DP1.10026.001": {
forwardAvailability: boolean;
};
"DP1.10033.001": {
forwardAvailability: boolean;
};
"DP1.10086.001": {
forwardAvailability: boolean;
};
"DP1.10047.001": {
forwardAvailability: boolean;
};
"DP1.00096.001": {
forwardAvailability: boolean;
};
"DP1.10066.001": {
forwardAvailability: boolean;
};
};
parents: string[];
};
timeSeriesDataProducts: {
productCodes: string[];
Expand Down
25 changes: 21 additions & 4 deletions lib/staticJSON/bundles.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,26 @@
"DP4.00002.001": "DP4.00200.001",
"DP4.00007.001": "DP4.00200.001",
"DP4.00137.001": "DP4.00200.001",
"DP4.00201.001": "DP4.00200.001"
"DP4.00201.001": "DP4.00200.001",
"DP1.10102.001": ["DP1.10066.001", "DP1.10067.001"],
"DP1.10099.001": ["DP1.10066.001", "DP1.10067.001"],
"DP1.10053.001": "DP1.10026.001",
"DP1.10031.001": "DP1.10033.001",
"DP1.10101.001": "DP1.10033.001",
"DP1.10080.001": "DP1.10086.001",
"DP1.10078.001": "DP1.10086.001",
"DP1.10100.001": "DP1.10086.001",
"DP1.10008.001": "DP1.10047.001",
"DP1.00097.001": "DP1.00096.001"
},
"parents": [
"DP4.00200.001"
]
"parents": {
"DP4.00200.001": { "forwardAvailability": true },
"DP1.10067.001": { "forwardAvailability": false },
"DP1.10026.001": { "forwardAvailability": false },
"DP1.10033.001": { "forwardAvailability": false },
"DP1.10086.001": { "forwardAvailability": false },
"DP1.10047.001": { "forwardAvailability": false },
"DP1.00096.001": { "forwardAvailability": false },
"DP1.10066.001": { "forwardAvailability": false }
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "portal-core-components",
"version": "1.5.1",
"version": "1.5.2",
"main": "./lib/index.js",
"private": true,
"homepage": "http://localhost:3010/core-components",
Expand Down Expand Up @@ -91,7 +91,7 @@
"lib:clean": "rm -r ./lib || true",
"lib:clean-build": "(rm -r ./lib || true) && npm run lib",
"lib:types": "tsc --project tsconfig.d.json",
"lib:post-cleanup": "rm ./lib/components/**/StyleGuide.* && rm -rf ./lib/*/__tests__ && rm -rf ./lib/*/*/__tests__ && node ./lib-fix-worker-babel.js"
"lib:post-cleanup": "rm ./lib/components/**/StyleGuide.* && rm -rf ./lib/components/SiteMap/png && rm -rf ./lib/*/__tests__ && rm -rf ./lib/*/*/__tests__ && node ./lib-fix-worker-babel.js"
},
"jest": {
"collectCoverageFrom": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const AllProductsTimeSeries = () => {
product.siteCodes
&& product.siteCodes.length
&& productIsIS(product)
&& !bundles.parents.includes(product.productCode)
&& !Object.keys(bundles.parents).includes(product.productCode)
&& !Object.keys(bundles.children).includes(product.productCode)
))
.map(product => ({ productCode: product.productCode, productName: product.productName }));
Expand Down
25 changes: 21 additions & 4 deletions src/lib_components/staticJSON/bundles.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,26 @@
"DP4.00002.001": "DP4.00200.001",
"DP4.00007.001": "DP4.00200.001",
"DP4.00137.001": "DP4.00200.001",
"DP4.00201.001": "DP4.00200.001"
"DP4.00201.001": "DP4.00200.001",
"DP1.10102.001": ["DP1.10066.001", "DP1.10067.001"],
"DP1.10099.001": ["DP1.10066.001", "DP1.10067.001"],
"DP1.10053.001": "DP1.10026.001",
"DP1.10031.001": "DP1.10033.001",
"DP1.10101.001": "DP1.10033.001",
"DP1.10080.001": "DP1.10086.001",
"DP1.10078.001": "DP1.10086.001",
"DP1.10100.001": "DP1.10086.001",
"DP1.10008.001": "DP1.10047.001",
"DP1.00097.001": "DP1.00096.001"
},
"parents": [
"DP4.00200.001"
]
"parents": {
"DP4.00200.001": { "forwardAvailability": true },
"DP1.10067.001": { "forwardAvailability": false },
"DP1.10026.001": { "forwardAvailability": false },
"DP1.10033.001": { "forwardAvailability": false },
"DP1.10086.001": { "forwardAvailability": false },
"DP1.10047.001": { "forwardAvailability": false },
"DP1.00096.001": { "forwardAvailability": false },
"DP1.10066.001": { "forwardAvailability": false }
}
}

0 comments on commit aad9e95

Please sign in to comment.