Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Design/system upload image in dropZone #1702

Open
Villva-vinoth opened this issue Aug 17, 2024 · 0 comments
Open

[Bug]: Design/system upload image in dropZone #1702

Villva-vinoth opened this issue Aug 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Villva-vinoth
Copy link

Contact Details

vinoth_22942 Discard id

What happened?

List what you are trying to do?

Screenshot from 2024-08-16 12-56-42

so I doing is from design/system for Upload concepts

import { Box, DropZone, Label } from '@adminjs/design-system';
import React from 'react';

const FileUpload = (props) => {

const { property, onChange } = props

const handleDropZoneChange = (files) => {
    if (files.length > 0) {
        onChange(property.name, files[0]);
    }

};



return (

    <Box marginBottom="xxl">
        <Label>{'Upload Image *'}</Label>
        <DropZone
            onChange={handleDropZoneChange} />
    </Box>
);

};

export default FileUpload;

from this DropZone, I selected a image in my dir and then i cancel what i selected from my gallery... and then Again i selected same image from my dir , It is not showing what i am selecting and it is always empty . In my model i didnt accept empty values of those fields there i saw this is has an empty value but i selected a image...

so that i try usual method which solves this issue

Bug prevalence

2

AdminJS dependencies version

{
"name": "admin",
"version": "1.0.0",
"main": "app.js",
"type": "module",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"start": "nodemon src/app.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"@adminjs/custom-components": "^2.0.1",
"@adminjs/design-system": "^4.1.1",
"@adminjs/express": "^6.1.0",
"@adminjs/sequelize": "^4.1.1",
"@adminjs/upload": "^4.0.2",
"@babel/core": "^7.25.2",
"@babel/node": "^7.25.0",
"@babel/preset-env": "^7.25.3",
"@babel/preset-react": "^7.24.7",
"adminjs": "^7.8.8",
"babel-register": "^6.26.0",
"bcrypt": "^5.1.1",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"express-formidable": "^1.2.0",
"express-session": "^1.18.0",
"flatted": "^3.3.1",
"nodemon": "^3.1.4",
"pg": "^8.12.0",
"pg-hstore": "^2.3.4",
"sequelize": "^6.37.3",
"tslib": "^2.6.3"
}
}

What browsers do you see the problem on?

No response

Relevant log output

import { Box, DropZone, Label } from '@adminjs/design-system';
import React from 'react';

const FileUpload = (props) => {


    const { property, onChange } = props

    const handleDropZoneChange = (files) => {
        if (files.length > 0) {
            onChange(property.name, files[0]);
        }

    };



    return (

        <Box marginBottom="xxl">
            <Label>{'Upload Image *'}</Label>
            <DropZone
                onChange={handleDropZoneChange} />
        </Box>
    );
};

export default FileUpload;

Relevant code that's giving you issues

No response

@Villva-vinoth Villva-vinoth added the bug Something isn't working label Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant