From 9efbc233b1484ad33e2805e316ce1c1d0730120b Mon Sep 17 00:00:00 2001 From: midhun-aot Date: Thu, 29 Feb 2024 13:56:30 -0800 Subject: [PATCH 1/2] fixed folder name issue --- .../application-file-upload/AppFileUpload.js | 95 ------------------- .../application-file-upload/README.md | 0 .../appFileUpload.settingsForm.js | 38 -------- .../AppFileUpload.js | 0 .../README.md | 0 .../appFileUpload.settingsForm.js | 0 .../src/custom-components/index.js | 2 +- 7 files changed, 1 insertion(+), 134 deletions(-) delete mode 100644 forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/AppFileUpload.js delete mode 100644 forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/README.md delete mode 100644 forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/appFileUpload.settingsForm.js rename forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/{Application-file-upload => custom-application-file-upload}/AppFileUpload.js (100%) rename forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/{Application-file-upload => custom-application-file-upload}/README.md (100%) rename forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/{Application-file-upload => custom-application-file-upload}/appFileUpload.settingsForm.js (100%) diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/AppFileUpload.js b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/AppFileUpload.js deleted file mode 100644 index 2fe28432..00000000 --- a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/AppFileUpload.js +++ /dev/null @@ -1,95 +0,0 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import { ReactComponent } from "react-formio"; -import settingsForm from "./appFileUpload.settingsForm"; - - -export default class AppFileUpload extends ReactComponent { - /** - * This function tells the form builder about your component. It's name, icon and what group it should be in. - * - * @returns {{title: string, icon: string, group: string, documentation: string, weight: number, schema: *}} - */ - static get builderInfo() { - return { - title: "Application File Upload", - icon: "map-marker", - group: "basic", - documentation: "", //TODO - weight: 120, - schema: AppFileUpload.schema(), - }; - } - - /** - * This function is the default settings for the component. At a minimum you want to set the type to the registered - * type of your component (i.e. when you call Components.setComponent('type', MyComponent) these types should match. - * - * @param sources - * @returns {*} - */ - static schema() { - return ReactComponent.schema({ - type: "AppFileUpload", - label: "File Upload", - }); - } - - /* - * Defines the settingsForm when editing a component in the builder. - */ - static editForm = settingsForm; - - static eventRegistered = false; - - /** - * This function is called when the DIV has been rendered and added to the DOM. You can now instantiate the react component. - * - * @param DOMElement - * #returns ReactInstance - * - * - */ - attachReact(element) { - let instance; - - ReactDOM.render( - { - console.log('file upload'); - var customeApplicationId = this.data.applicationId; - - - let mapURL = - process.env.REACT_APP_CUSTOM_FILE_UPLOAD || window._env_.REACT_APP_CUSTOM_FILE_UPLOAD; - - window.open( - mapURL + "?appId=" + customeApplicationId , - "_blank", - "popup=yes,width=500px,heigth=500px" - ); - - console.log("adding listner end"); - - return false; - }} - > - View / Upload Documents - , - element, - () => (this.reactInstance = instance) - ); - } - - /** - * Automatically detach any react components. - * - * @param element - */ - detachReact(element) { - if (element) { - ReactDOM.unmountComponentAtNode(element); - } - } -} diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/README.md b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/appFileUpload.settingsForm.js b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/appFileUpload.settingsForm.js deleted file mode 100644 index 9122dee9..00000000 --- a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/application-file-upload/appFileUpload.settingsForm.js +++ /dev/null @@ -1,38 +0,0 @@ -import baseEditForm from 'formiojs/components/_classes/component/Component.form'; - -const settingsForm = (...extend) => { - return baseEditForm([ - { - key: 'display', - components: [ - { - key: 'placeholder', - ignore: true, - }, - ] - }, - { - key: 'data', - components: [], - }, - { - key: 'validation', - components: [], - }, - { - key: 'api', - components: [], - }, - { - key: 'conditional', - components: [], - }, - { - key: 'logic', - components: [], - }, - ], ...extend); -}; - -export default settingsForm; - diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/Application-file-upload/AppFileUpload.js b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/AppFileUpload.js similarity index 100% rename from forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/Application-file-upload/AppFileUpload.js rename to forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/AppFileUpload.js diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/Application-file-upload/README.md b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/README.md similarity index 100% rename from forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/Application-file-upload/README.md rename to forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/README.md diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/Application-file-upload/appFileUpload.settingsForm.js b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/appFileUpload.settingsForm.js similarity index 100% rename from forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/Application-file-upload/appFileUpload.settingsForm.js rename to forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/appFileUpload.settingsForm.js diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/index.js b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/index.js index a152f294..86d64ddf 100644 --- a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/index.js +++ b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/index.js @@ -1,6 +1,6 @@ import fileUpload from "./custom-file-upload/fileUpload"; import Maps from './map-component/Mapservice'; -import AppFileUpload from "./application-file-upload/AppFileUpload"; +import AppFileUpload from "./custom-application-file-upload/AppFileUpload"; const components = { fileUpload: fileUpload, From 7a02c7f540050df2d655b039befb67282fc17309 Mon Sep 17 00:00:00 2001 From: midhun-aot Date: Thu, 29 Feb 2024 16:10:59 -0800 Subject: [PATCH 2/2] updated file name as well --- .../{AppFileUpload.js => userFileUpload.js} | 0 .../forms-flow-web/src/custom-components/index.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/{AppFileUpload.js => userFileUpload.js} (100%) diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/AppFileUpload.js b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/userFileUpload.js similarity index 100% rename from forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/AppFileUpload.js rename to forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/custom-application-file-upload/userFileUpload.js diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/index.js b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/index.js index 86d64ddf..0eb75c52 100644 --- a/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/index.js +++ b/forms-flow-ai/forms-flow-ai-ee/forms-flow-web/src/custom-components/index.js @@ -1,6 +1,6 @@ import fileUpload from "./custom-file-upload/fileUpload"; import Maps from './map-component/Mapservice'; -import AppFileUpload from "./custom-application-file-upload/AppFileUpload"; +import AppFileUpload from "./custom-application-file-upload/userFileUpload"; const components = { fileUpload: fileUpload,