Skip to content

Commit

Permalink
Merge pull request AOT-Technologies#2520 from Bonymol-aot/FWF-4224-no…
Browse files Browse the repository at this point in the history
…te-fix

FWF-4248: [Bugfix] Updated publish and migration note, Enabled duplicate if publshed, resolved primary color issue
  • Loading branch information
arun-s-aot authored Jan 15, 2025
2 parents d6be5bb + 12b2f7e commit 04a19ad
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion forms-flow-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@
"not ie <= 11",
"not op_mini all"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const RoleSelector = ({
setSelectedRoles,
openByDefault = false,
}) => {
const primaryColor = StyleServices.getCSSVariable('primary');
const primaryColor = StyleServices.getCSSVariable('--ff-primary');
const [roleInput, setRoleInput] = useState("");
const [filteredRoles, setFilteredRoles] = useState([]);
const [isDropdownOpen, setIsDropdownOpen] = useState(false); // To control dropdown visibility
Expand Down
20 changes: 15 additions & 5 deletions forms-flow-web/src/components/Modals/ActionModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,31 @@ const ActionModal = React.memo(
onAction,
published,
isCreate,
isMigrated
isMigrated,
diagramType
}) => {
const primaryColor = StyleServices.getCSSVariable('primary');
const primaryColor = StyleServices.getCSSVariable('--ff-primary');
const handleAction = (actionType) => {
onAction(actionType);
onClose();
};
let customInfo = null;

if (published || !isMigrated) {
if (CategoryType === "FORM" && (published || !isMigrated)) {
customInfo = {
heading: "Note",
content: `
${published ? "Importing and deleting is not available when the form is published. You must unpublish the form first if you wish to make any changes." : ""}
${published ? `Importing and deleting is not available when the form is published. You must unpublish the form first if you wish to make any changes.` : ""}
${!isMigrated ? "\nSome actions are disabled as this form has not been migrated to the new 1 to 1 relationship structure. To migrate this form exit this popup and click \"Save layout\" or \"Save flow\"." : ""}
`.trim(),
};
} else if (CategoryType === "WORKFLOW" && published) {
customInfo = {
heading: "Note",
content: `Importing and deleting is not available when the ${diagramType} is published.` +
`You must unpublish the ${diagramType} first if you wish to make any changes.`.trim(),


};
}

Expand All @@ -59,7 +68,7 @@ const ActionModal = React.memo(
variant="secondary"
size="sm"
label="Duplicate"
disabled={published || !isMigrated}
disabled={!isMigrated}
icon={<DuplicateIcon color={primaryColor} />}
className=""
dataTestid="duplicate-form-button"
Expand Down Expand Up @@ -156,6 +165,7 @@ ActionModal.propTypes = {
published: PropTypes.bool.isRequired,
isCreate: PropTypes.bool,
isMigrated: PropTypes.bool, // Adding validation for isMigrated
diagramType: PropTypes.string,
};

export default ActionModal;
4 changes: 2 additions & 2 deletions forms-flow-web/src/components/Modals/TaskVariableModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import { StyleServices } from "@formsflow/service";
//TBD in case of Bundle form display
const PillList = React.memo(({ alternativeLabels, onRemove }) => {
const { t } = useTranslation();
const primaryColor = StyleServices.getCSSVariable('primary');
const secondaryColor = StyleServices.getCSSVariable('secondary');
const primaryColor = StyleServices.getCSSVariable('--ff-primary');
const secondaryColor = StyleServices.getCSSVariable('--ff-secondary');

const filteredVariablePills = Object.values(alternativeLabels).filter(
({ key }) => !ignoreKeywords.has(key)
Expand Down
2 changes: 2 additions & 0 deletions forms-flow-web/src/components/Modeler/ProcessCreateEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,8 @@ const ProcessCreateEdit = ({ type }) => {
setSelectedAction(action);
}}
isCreate={isCreate}
published={isPublished}
diagramType={diagramType}
/>

<ExportDiagram
Expand Down

0 comments on commit 04a19ad

Please sign in to comment.