Skip to content

Commit a0207c5

Browse files
committed
conflicts fixed
2 parents cc50a74 + bc14077 commit a0207c5

File tree

11 files changed

+502
-22
lines changed

11 files changed

+502
-22
lines changed

.github/workflows/forms-flow-documents-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
SKIP_IN_CI: "True"
7777
USE_DOCKER_MOCK: "True"
7878
JWT_OIDC_TEST_PRIVATE_KEY_PEM: ${{ secrets.JWT_OIDC_TEST_PRIVATE_KEY_PEM }}
79+
FORMIO_TEST_JWT_TOKEN: ${{ secrets.FORMIO_TEST_JWT_TOKEN}}
7980

8081
runs-on: ubuntu-24.04
8182
strategy:

forms-flow-api/tests/unit/api/test_form_process_mapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ def test_form_flow_builder_update_invalid_payload(app, client, session, jwt, moc
11401140
# Test with empty payload
11411141
payload = {}
11421142
response = client.put(f"/form/form-flow-builder/{mapper_id}", headers=headers, json=payload)
1143-
assert response.status_code == 200 # Empty payload should still return success
1143+
assert response.status_code == 400
11441144

11451145
# Test with invalid form data (missing _id)
11461146
# Form data must include _id for update

forms-flow-bpm/forms-flow-bpm-camunda/src/main/java/org/camunda/bpm/extension/keycloak/sso/OAuth2LoginSecurityConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ public SecurityFilterChain httpSecurityFilterChain(HttpSecurity http, JwtDecoder
8888
return http
8989
.csrf(AbstractHttpConfigurer::disable)
9090
.securityMatcher(AntPathRequestMatcher.antMatcher("/engine-rest-ext/**"))
91-
.authorizeHttpRequests(auth -> auth
91+
.authorizeHttpRequests(auth -> auth
9292
.requestMatchers(
93-
antMatcher(HttpMethod.OPTIONS,"/engine-rest/**"),
94-
antMatcher(HttpMethod.OPTIONS,"/engine-rest-ext/**"),
93+
antMatcher(HttpMethod.OPTIONS,"/engine-rest-ext/v1/**"),
9594
antMatcher(HttpMethod.OPTIONS, "/forms-flow-bpm-socket/**"),
9695
antMatcher(HttpMethod.OPTIONS, "/engine-rest/**"),
97-
antMatcher("/engine-rest-ext/**"))
96+
antMatcher("/engine-rest-ext/v1/**"))
9897
.permitAll()
98+
.requestMatchers(antMatcher("/engine-rest-ext/**")).denyAll()
9999
.anyRequest().authenticated())
100100
.oauth2ResourceServer(oauth2ResourceServer -> oauth2ResourceServer
101101
.jwt(jwt -> jwt

forms-flow-documents/sample.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ FORMSFLOW_API_CORS_ORIGINS=*
3636
##Env For Unit Testing
3737
## JWT_OIDC_TEST_PRIVATE_KEY_PEM=
3838
## FLASK_ENV=testing
39+
## FORMIO_TEST_JWT_TOKEN=
3940

4041
#FORMIO configuration
4142
FORMIO_DEFAULT_PROJECT_URL=http://{your-ip-address}:3001

forms-flow-documents/tests/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Common setup and fixtures for the pytest suite used by this service."""
2+
import os
23
import time
34

45
import pytest
@@ -106,3 +107,13 @@ def get(self, key):
106107
return_value=mock_redis,
107108
) as _mock: # noqa
108109
yield mock_redis
110+
111+
112+
@pytest.fixture(autouse=True)
113+
def mock_formio_access_token():
114+
"""Mock formio access token."""
115+
with patch(
116+
"formsflow_api_utils.services.external.formio.FormioService.get_formio_access_token",
117+
return_value=os.getenv("FORMIO_TEST_JWT_TOKEN"),
118+
):
119+
yield

forms-flow-web/src/helper/routerHelper.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,30 @@ const navigateToResubmit = (dispatch, tenantId, formId, submissionId ) => {
6363
navigateTo(dispatch,`${getRoute(tenantId).FORM}/${formId}/submissions/${submissionId}/resubmit`);
6464
};
6565

66+
/* --------------------------- Process Creation Routes --------------------------- */
67+
const navigateToSubflowBuild = (dispatch, tenantId) => {
68+
navigateTo(dispatch, `${getRoute(tenantId).SUBFLOW}/build`);
69+
};
6670

71+
const navigateToDecisionTableBuild = (dispatch, tenantId) => {
72+
navigateTo(dispatch, `${getRoute(tenantId).DECISIONTABLE}/build`);
73+
};
6774

75+
const navigateToSubflowCreate = (dispatch, tenantId) => {
76+
navigateTo(dispatch, `${getRoute(tenantId).SUBFLOW}/create`);
77+
};
78+
79+
const navigateToDecisionTableCreate = (dispatch, tenantId) => {
80+
navigateTo(dispatch, `${getRoute(tenantId).DECISIONTABLE}/create`);
81+
};
82+
83+
const navigateToSubflowEdit = (dispatch, tenantId, processKey) => {
84+
navigateTo(dispatch, `${getRoute(tenantId).SUBFLOW}/edit/${processKey}`);
85+
};
86+
87+
const navigateToDecisionTableEdit = (dispatch, tenantId, processKey) => {
88+
navigateTo(dispatch, `${getRoute(tenantId).DECISIONTABLE}/edit/${processKey}`);
89+
};
6890

6991
export {
7092
navigateToDesignFormsListing,
@@ -79,4 +101,10 @@ export {
79101
navigateToDraftEdit,
80102
navigateToViewSubmission,
81103
navigateToResubmit,
104+
navigateToSubflowBuild,
105+
navigateToDecisionTableBuild,
106+
navigateToSubflowCreate,
107+
navigateToDecisionTableCreate,
108+
navigateToSubflowEdit,
109+
navigateToDecisionTableEdit,
82110
};

forms-flow-web/src/routes/Design/Forms/FlowEdit.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import React, {
77
} from "react";
88
import {
99
CustomButton,
10-
ConfirmModal,
10+
PromptModal,
1111
// HistoryModal,
1212
//CurlyBracketsIcon,
1313
VariableSelection,
@@ -343,19 +343,23 @@ const enableWorkflowChange = async () => {
343343
<>
344344
{/* <Card> */}
345345
<div>
346-
<ConfirmModal
346+
<PromptModal
347347
show={showDiscardModal}
348348
title={t(`Discard Flow Changes?`)}
349349
message={t(
350350
"Are you sure you want to discard all unsaved changes to the flow of the form?"
351351
)}
352-
messageSecondary={t("This action cannot be undone.")}
353352
primaryBtnAction={handleDiscardConfirm}
354353
onClose={handleDiscardModal}
355354
primaryBtnText={t("Yes, Discard All Unsaved Changes")}
356355
secondaryBtnText={t("No, Keep The Changes")}
357356
secondaryBtnAction={handleDiscardModal}
358-
size="sm"
357+
type="warning"
358+
size="md"
359+
primaryBtndataTestid="discard-confirm-button"
360+
secondoryBtndataTestid="discard-cancel-button"
361+
primaryBtnariaLabel={t("Yes, Discard All Unsaved Changes")}
362+
secondoryBtnariaLabel={t("No, Keep The Changes")}
359363
/>
360364
{/* <div className="head">
361365
{createDesigns && (
@@ -408,9 +412,10 @@ const enableWorkflowChange = async () => {
408412
{/* </Card> */}
409413
</div>
410414
{showMigrationModal && (
411-
<ConfirmModal
415+
<PromptModal
412416
show={showMigrationModal}
413417
title={t("***Migration Notice***")}
418+
size="lg"
414419
message={
415420
<div>
416421
<div className="message-primary mb-3">
@@ -457,7 +462,6 @@ const enableWorkflowChange = async () => {
457462
</div>
458463
}
459464
primaryBtnDisable={!isMigrationChecked}
460-
messageSecondary={null} // You can set this to `null` or remove it entirely if unused
461465
primaryBtnAction={handleMigration}
462466
onClose={handleCloseMigration}
463467
primaryBtnText={t(
@@ -466,7 +470,13 @@ const enableWorkflowChange = async () => {
466470
secondaryBtnText={t("Cancel")}
467471
secondaryBtnAction={handleCloseMigration}
468472
buttonLoading={isMigrationLoading}
469-
size="sm"
473+
type="info"
474+
primaryBtndataTestid="migration-confirm-button"
475+
secondoryBtndataTestid="migration-cancel-button"
476+
primaryBtnariaLabel={t(
477+
"Link this form that will keep the current flow and its history"
478+
)}
479+
secondoryBtnariaLabel={t("Cancel")}
470480
/>
471481
)}
472482

forms-flow-web/src/routes/Design/Process/ProcessCreateEdit.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ import {
2020
createNewDecision,
2121
} from "../../../components/Modeler/helpers/helper";
2222
import {
23-
ConfirmModal,
24-
ErrorModal,
23+
PromptModal,
2524
HistoryPage,
2625
V8CustomButton,
2726
FormStatusIcon,
@@ -660,17 +659,21 @@ const ProcessCreateEdit = ({ type }) => {
660659
return (
661660
<div>
662661
<NavigateBlocker isBlock={isWorkflowChanged} message={"You have made changes that are not saved yet"} />
663-
<ConfirmModal
662+
<PromptModal
664663
show={showConfirmModal}
665664
title={modalContent.title}
666665
message={modalContent.message}
667-
messageSecondary={modalContent.messageSecondary || ""}
668666
primaryBtnAction={modalContent.primaryBtnAction}
669667
onClose={closeModal}
670668
secondaryBtnAction={modalContent.secondaryBtnAction}
671669
primaryBtnText={modalContent.primaryBtnText}
672670
secondaryBtnText={modalContent.secondaryBtnText}
673-
size="md"
671+
type="warning"
672+
size={modalType === "unpublish" ? "lg" : "md"}
673+
primaryBtndataTestid="confirm-primary-button"
674+
secondoryBtndataTestid="confirm-secondary-button"
675+
primaryBtnariaLabel={modalContent.primaryBtnText}
676+
secondoryBtnariaLabel={modalContent.secondaryBtnText}
674677
/>
675678

676679
<BreadCrumbs
@@ -815,16 +818,20 @@ const ProcessCreateEdit = ({ type }) => {
815818
errorMessage={exportError}
816819
/>
817820
{showErrorModal && (
818-
<ErrorModal
821+
<PromptModal
819822
show={showErrorModal}
820823
onClose={handleCloseErrorModal}
821824
title={t("Error(s)")}
822825
message={errorMessage}
823826
primaryBtnAction={handleCloseErrorModal}
824827
primaryBtnText={t("Dismiss")}
828+
size="lg"
829+
type="error"
830+
primaryBtndataTestid="error-dismiss-button"
831+
primaryBtnariaLabel={t("Dismiss")}
825832
/>
826833
)}
827-
{/* Inline HistoryPage is rendered within the body based on activeTab */}
834+
828835
{selectedAction === IMPORT && <ImportProcess
829836
showModal={selectedAction === IMPORT}
830837
closeImport={() => setSelectedAction(null)}

0 commit comments

Comments
 (0)