Skip to content

Commit

Permalink
Merge branch 'frontend-dev-#74' of https://github.com/amosproj/amos-s…
Browse files Browse the repository at this point in the history
…s2021-carbon-footprint into frontend-dev-#74
  • Loading branch information
gandompm committed Jun 6, 2021
2 parents 69831a4 + 47dd008 commit 5fc9b11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/dropdown/DropDownComponent.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React from 'react';
import theme from 'resources/theme';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ModelDropdownComponent = (props) => {
const [selectedProducts, setSelectedProducts] = useContext(PrivateSectionContext);

// set the initial values for the dropdown list derived from getModels
const variables = getModels(productID);
const variables = getModels(productName, productID);

const [selected, setSelected] = useState('Select a model');

Expand Down
11 changes: 3 additions & 8 deletions frontend/src/interface/simaProInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,12 @@ export async function getCategorizedProducts(scope = 'All') {
* @returns
*/
//export async function getModels(productID) {
export function getModels(productID) {
export function getModels(productName, productID) {
switch (productID) {
case '09f64eeb-13b0-4e09-9fb4-50398483ecfd':
return [{ modelID: 1, productID: productID, modelName: 'Electric Motor Type 25b' }];
case 'aufwlc93-kldp-4fer-15s7-51245631fega':
return [
{ modelID: 2, productID: productID, modelName: 'Motor Type 42a' },
{ modelID: 3, productID: productID, modelName: 'Motor Type 42b' },
{ modelID: 4, productID: productID, modelName: 'Motor Type 42b' },
{ modelID: 5, productID: productID, modelName: 'Motor Type 42b' }
];
return [];
case '7ghnaoeb-kfue-qp04-slfg-12059492begp':
return [
{ modelID: 6, productID: productID, modelName: 'Transformer DIN42a' },
Expand All @@ -67,7 +62,7 @@ export function getModels(productID) {
{ modelID: 17, productID: productID, modelName: 'Allround Product 4' }
];
default:
return null;
return [{ modelID: 42, productID: productID, modelName: productName }];
}
}

Expand Down

0 comments on commit 5fc9b11

Please sign in to comment.