Skip to content

Commit

Permalink
Merge pull request AOT-Technologies#2609 from fahad-aot/feature/fwf-4…
Browse files Browse the repository at this point in the history
…346-new-submission-page

feature/fwf-4346:Added new submission page
  • Loading branch information
arun-s-aot authored Mar 7, 2025
2 parents f52f485 + ea69124 commit 8fb1ba6
Show file tree
Hide file tree
Showing 6 changed files with 549 additions and 6 deletions.
1 change: 1 addition & 0 deletions forms-flow-web/src/apiManager/endpoints/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const API = {
EXPORT_FORM_PDF: `${DOCUMENT_SERVICE_URL}/form/<form_id>/submission/<submission_id>/export/pdf`,
CUSTOM_SUBMISSION: `${CUSTOM_SUBMISSION_URL}/form/<form_id>/submission`,
PUBLIC_CUSTOM_SUBMISSION: `${CUSTOM_SUBMISSION_URL}/public/form/<form_id>/submission`,
//These endpoints will be updated once the new API is ready
DRAFT_BASE: `${WEB_BASE_URL}/draft`,
DRAFT_PUBLIC_CREATE: `${WEB_BASE_URL}/draft/public/create`,
DRAFT_UPDATE: `${WEB_BASE_URL}/draft/<draft_id>`,
Expand Down
2 changes: 2 additions & 0 deletions forms-flow-web/src/apiManager/services/draftService.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const draftCreate = (data, ...rest) => {
.then((res) => {
if (res.data) {
dispatch(setDraftSubmission(res.data));
dispatch(setDraftDetail(res.data));

done(true);
} else {
dispatch(setDraftSubmissionError("Error Posting data"));
Expand Down
5 changes: 3 additions & 2 deletions forms-flow-web/src/components/Draft/EditDraft.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { getForm, getSubmission } from "@aot-technologies/formio-react";
// import { Translation } from "react-i18next";
import { MULTITENANCY_ENABLED } from "../../constants/constants";
import { getDraftById } from "../../apiManager/services/draftService";
import Edit from "./Edit";
// import Edit from "./Edit";
import UserForm from "../../routes/Submit/Forms/UserForm";
import { push } from "connected-react-router";

const EditDraft = React.memo(() => {
Expand Down Expand Up @@ -43,7 +44,7 @@ const EditDraft = React.memo(() => {
if (isDraftDetailLoading) {
return <Loading />;
}
return <Edit page="draft-edit" />;
return <UserForm page="draft-edit" />;
});

export default EditDraft;
5 changes: 3 additions & 2 deletions forms-flow-web/src/components/PublicRoute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import React, { useEffect } from "react";
import { Route } from "react-router-dom";
import { connect } from "react-redux";
import { getForm } from "@aot-technologies/formio-react";
import View from "../routes/Submit/Forms/View";
// import View from "../routes/Submit/Forms/View";
import NotFound from "./NotFound";
import UserForm from "../routes/Submit/Forms/UserForm";

const PublicRoute = ({publish}) => {

Expand All @@ -13,7 +14,7 @@ const PublicRoute = ({publish}) => {

return (
<div className="container py-2 min-hightcontainer">
<Route exact path="/public/form/:formId" render={(props) => <View {...props} publish={publish} />} />
<Route exact path="/public/form/:formId" render={(props) => <UserForm {...props} publish={publish} />} />
<Route path="/public/form/:formId/:notavailable" component={NotFound} />
</div>
);
Expand Down
5 changes: 3 additions & 2 deletions forms-flow-web/src/routes/Submit/Forms/SubmitIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MULTITENANCY_ENABLED,
} from "../../../constants/constants";
import userRoles from "../../../constants/permissions";
import View from "./View";
// import View from "./View";
import Submission from "../Submission";
import { checkIsObjectId } from "../../../apiManager/services/formatterService";
import { fetchFormByAlias } from "../../../apiManager/services/bpmFormServices";
Expand All @@ -25,6 +25,7 @@ import { getClientList, getReviewerList } from "../../../apiManager/services/aut
import NotFound from "../../../components/NotFound";
import { setApiCallError } from "../../../actions/ErroHandling";
import proptypes from 'prop-types';
import UserForm from "./UserForm";

const SubmissionRoute = ({ component: Component, createSubmissions,
viewSubmissions, redirectUrl, ...rest }) => (
Expand Down Expand Up @@ -140,7 +141,7 @@ const Item = React.memo(() => {
return (
<div>
<Switch>
<Route exact path={`${BASE_ROUTE}form/:formId`} component={View} />
<Route exact path={`${BASE_ROUTE}form/:formId`} component={UserForm} />
<SubmissionRoute
path={`${BASE_ROUTE}form/:formId/submission`}
component={Submission}
Expand Down
Loading

0 comments on commit 8fb1ba6

Please sign in to comment.