fix: remove uploadedFileUrls ppty from FilePicker

This commit is contained in:
Tolulope Adetula 2021-05-11 16:53:02 +01:00
parent 3b61af395e
commit f6c7036d5c
3 changed files with 2 additions and 36 deletions

View File

@ -135,7 +135,6 @@ const FIELD_VALUES: Record<
allowedFileTypes: "Array<string>",
isRequired: "boolean",
isVisible: "boolean",
uploadedFileUrls: "string",
// onFilesSelected: "Function Call",
},
CHECKBOX_WIDGET: {

View File

@ -221,7 +221,6 @@ export const entityDefinitions = {
isVisible: isVisible,
files: "[file]",
isDisabled: "bool",
uploadedFileUrls: "string",
},
LIST_WIDGET: (widget: any) => ({
"!doc":

View File

@ -8,10 +8,7 @@ import Webcam from "@uppy/webcam";
import Url from "@uppy/url";
import OneDrive from "@uppy/onedrive";
import { VALIDATION_TYPES } from "constants/WidgetValidation";
import {
EventType,
ExecutionResult,
} from "constants/AppsmithActionConstants/ActionConstants";
import { EventType } from "constants/AppsmithActionConstants/ActionConstants";
import { DerivedPropertiesMap } from "utils/WidgetFactory";
import Dashboard from "@uppy/dashboard";
import shallowequal from "shallowequal";
@ -157,17 +154,6 @@ class FilePickerWidget extends BaseWidget<
isTriggerProperty: false,
validation: VALIDATION_TYPES.BOOLEAN,
},
{
propertyName: "uploadedFileUrlPaths",
helpText:
"Stores the url of the uploaded file so that it can be referenced in an action later",
label: "Uploaded File URLs",
controlType: "INPUT_TEXT",
placeholderText: 'Enter [ "url1", "url2" ]',
inputType: "TEXT",
isBindProperty: true,
isTriggerProperty: false,
},
{
propertyName: "isDisabled",
label: "Disable",
@ -185,7 +171,7 @@ class FilePickerWidget extends BaseWidget<
children: [
{
helpText:
"Triggers an action when the user selects a file. Upload files to a CDN here and store their urls in uploadedFileUrls",
"Triggers an action when the user selects a file. Upload files to a CDN here and store their urls in",
propertyName: "onFilesSelected",
label: "onFilesSelected",
controlType: "ACTION_SELECTOR",
@ -385,7 +371,6 @@ class FilePickerWidget extends BaseWidget<
dynamicString: this.props.onFilesSelected,
event: {
type: EventType.ON_FILES_SELECTED,
callback: this.handleFileUploaded,
},
});
@ -393,22 +378,6 @@ class FilePickerWidget extends BaseWidget<
}
};
/**
* sets uploadFilesUrl in meta propety and sets isLoading to false
*
* @param result
*/
handleFileUploaded = (result: ExecutionResult) => {
if (result.success) {
this.props.updateWidgetMetaProperty(
"uploadedFileUrls",
this.props.uploadedFileUrlPaths,
);
this.setState({ isLoading: false });
}
};
componentDidUpdate(prevProps: FilePickerWidgetProps) {
super.componentDidUpdate(prevProps);
if (
@ -469,7 +438,6 @@ export interface FilePickerWidgetProps extends WidgetProps, WithMeta {
onFilesSelected?: string;
fileDataType: FileDataTypes;
isRequired?: boolean;
uploadedFileUrlPaths?: string;
}
export default FilePickerWidget;