diff --git a/public/locales/cs/translation.json b/public/locales/cs/translation.json index f3cb981c..873523ee 100644 --- a/public/locales/cs/translation.json +++ b/public/locales/cs/translation.json @@ -82,7 +82,8 @@ "lastModified": "Poslední úprava", "lastEditor": "Poslední editor", "status": "Stav", - "edit": "Upravit" + "edit": "Upravit", + "created": "Vytvořeno" }, "faultEventMenu": { "criticality": "Kritičnost", @@ -91,7 +92,8 @@ "ataSystem": "ATA systém", "partNumber": "Číslo součásti", "stock": "Zásoba", - "quantity": "Množství" + "quantity": "Množství", + "schematicDesignation": "Schématické označení" }, "appBar": { "selectSystemPlaceholder": "Vyberte systém" diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 313cc8e1..64588dda 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -82,7 +82,8 @@ "lastModified": "Last modified", "lastEditor": "Last editor", "status": "Status", - "edit": "Edit" + "edit": "Edit", + "created": "Created" }, "faultEventMenu": { "criticality": "Criticality", @@ -91,7 +92,8 @@ "ataSystem": "ATA System", "partNumber": "Part number", "stock": "Stock", - "quantity": "Quantity" + "quantity": "Quantity", + "schematicDesignation": "Schematic designation" }, "appBar": { "selectSystemPlaceholder": "Select system" diff --git a/src/components/editor/faultTree/menu/faultEvent/FaultEventMenu.tsx b/src/components/editor/faultTree/menu/faultEvent/FaultEventMenu.tsx index 2bd1f0a5..d8dd009e 100644 --- a/src/components/editor/faultTree/menu/faultEvent/FaultEventMenu.tsx +++ b/src/components/editor/faultTree/menu/faultEvent/FaultEventMenu.tsx @@ -33,6 +33,7 @@ const FaultEventMenu = ({ shapeToolData, onEventUpdated, refreshTree, rootIri }: const [partNumber, setPartNumber] = useState(undefined); const [stock, setStock] = useState(undefined); const [quantity, setQuantity] = useState(undefined); + const [schematicDesignation, setSchematicDesignation] = useState(undefined); const handleFailureModeClicked = (failureMode: FailureMode) => { setFailureModeOverview(failureMode); @@ -68,12 +69,10 @@ const FaultEventMenu = ({ shapeToolData, onEventUpdated, refreshTree, rootIri }: setAtaSystem(undefined); } - if (filteredPartNumber.length === 1 && filteredPartNumber[0].partNumber && filteredPartNumber[0].stock) { + if (filteredPartNumber.length === 1 && filteredPartNumber[0].partNumber) { setPartNumber(filteredPartNumber[0].partNumber); - setStock(filteredPartNumber[0].stock); } else { setPartNumber(undefined); - setStock(undefined); } if (shapeToolData?.supertypes?.behavior?.item?.quantity) { @@ -81,6 +80,18 @@ const FaultEventMenu = ({ shapeToolData, onEventUpdated, refreshTree, rootIri }: } else { setQuantity(undefined); } + + if (shapeToolData?.supertypes?.behavior?.item?.stock) { + setStock(shapeToolData?.supertypes?.behavior?.item?.stock); + } else { + setStock(undefined); + } + + if (shapeToolData?.supertypes?.behavior?.item?.schematicDesignation) { + setSchematicDesignation(shapeToolData?.supertypes?.behavior?.item?.schematicDesignation); + } else { + setSchematicDesignation(undefined); + } }, [shapeToolData]); const basedFailureRate = shapeToolData?.supertypes?.supertypes?.hasFailureRate?.estimate?.value; @@ -213,6 +224,12 @@ const FaultEventMenu = ({ shapeToolData, onEventUpdated, refreshTree, rootIri }: {t("faultEventMenu.quantity")}: {quantity} )} + {schematicDesignation && ( + + {t("faultEventMenu.schematicDesignation")}:{" "} + {schematicDesignation} + + )} diff --git a/src/models/eventModel.tsx b/src/models/eventModel.tsx index 5a0c437d..832daa09 100644 --- a/src/models/eventModel.tsx +++ b/src/models/eventModel.tsx @@ -51,6 +51,7 @@ const ctx = { editor: VocabularyUtils.PREFIX + "editor", username: VocabularyUtils.PREFIX + "username", estimate: VocabularyUtils.PREFIX + "has-estimate", + schematicDesignation: VocabularyUtils.PREFIX + "schematic-designation", }; export const CONTEXT = Object.assign({}, ctx, ABSTRACT_CONTEXT, FAILURE_MODE_CONTEXT, RECTANGLE_CONTEXT); @@ -95,6 +96,8 @@ export interface FaultEvent extends AbstractModel { supertypes?: { ataCode?: string; }; + stock?: string; + schematicDesignation?: string; }; }; hasFailureRate?: {