Skip to content

Commit 10c46a1

Browse files
committed
FLS-1450: Update form selection to direct editing
- Remove form cloning complexity - Direct navigation to form designer from Pre-Award API - Forms now edited directly instead of creating copies
1 parent 611a345 commit 10c46a1

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

designer/client/pages/landing-page/ViewFundForms.tsx

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type Props = {
1313
type State = {
1414
configs: { Key: string; DisplayName: string }[];
1515
loading?: boolean;
16+
1617
};
1718

1819
export class ViewFundForms extends Component<Props, State> {
@@ -25,30 +26,23 @@ export class ViewFundForms extends Component<Props, State> {
2526
};
2627
}
2728

28-
componentDidMount() {
29-
formConfigurationApi.loadConfigurations().then((configs) => {
29+
async componentDidMount() {
30+
try {
31+
const configs = await formConfigurationApi.loadConfigurations();
3032
this.setState({
3133
loading: false,
3234
configs,
3335
});
34-
});
36+
} catch (error) {
37+
logger.error("ViewFundForms componentDidMount", error);
38+
this.setState({ loading: false });
39+
}
3540
}
3641

3742
selectForm = async (form) => {
3843
try {
39-
const response = await window.fetch("/api/new", {
40-
method: "POST",
41-
body: JSON.stringify({
42-
selected: {Key: form},
43-
name: "",
44-
}),
45-
headers: {
46-
Accept: "application/json",
47-
"Content-Type": "application/json",
48-
},
49-
});
50-
const responseJson = await response.json();
51-
this.props.history.push(`/designer/${responseJson.id}`);
44+
// Always go directly to edit the form from Pre-Award API
45+
this.props.history.push(`/designer/${form}`);
5246
} catch (e) {
5347
logger.error("ChooseExisting", e);
5448
}

0 commit comments

Comments
 (0)