Skip to content

Commit

Permalink
fix: Initial value tweak
Browse files Browse the repository at this point in the history
More tweaks to bring initial values inline
  • Loading branch information
Jack-Golding committed Sep 26, 2024
1 parent 859b48a commit 1704f26
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
18 changes: 17 additions & 1 deletion src/routes/RulesetEditRoute/RulesetEditRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const RulesetEditRoute = () => {
.then(() => handleClose());
}
);

console.log(ruleset);

// istanbul ignore next
const handleSubmitValues = (values) => {
const submitValues = {
Expand All @@ -44,7 +47,20 @@ const RulesetEditRoute = () => {
};

const getInitialValues = () => {
return ruleset;
const iv = {
...ruleset,
patternType: ruleset?.recurrence?.rules?.[0]?.patternType?.value,
omission: {
...ruleset?.omission,
patternType: ruleset?.omission?.rules?.[0]?.patternType?.value,
},
combination: {
...ruleset?.combination,
patternType: ruleset?.combination?.rules?.[0]?.patternType?.value,
},
};
console.log(iv);
return iv;
};
// istanbul ignore next
const submitRuleset = async (values) => {
Expand Down
3 changes: 2 additions & 1 deletion translations/ui-serials-management/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@
"ruleset.pickList": "Pick list",
"ruleset.templatePopover": "Templates are used to generate the values to be used in each predicted piece Display Summary.",
"ruleset.templateTokensPopover": "Templates tokens are used in the Template to insert enumeration and chronology values in the predicted piece Display Summary.",

"ruleset.editPublicationPattern": "Edit publication pattern",

"pieceSets": "Piece sets",
"pieceSets.predictedPieceSets": "Predicted piece sets",
"pieceSets.dateGenerated": "Date generated",
Expand Down

0 comments on commit 1704f26

Please sign in to comment.