Skip to content
Snippets Groups Projects
Commit 0ed55c80 authored by Jose Manuel Serrano Amaut's avatar Jose Manuel Serrano Amaut
Browse files

[WIP]: Refactor demo dropzone page. Finished upload demo page. Missing actions...

[WIP]: Refactor demo dropzone page. Finished upload demo page. Missing actions demo, ripple demo? or maybe just a prop, header demo, footer demo, action buttons demo
parent 776db266
No related branches found
No related tags found
No related merge requests found
...@@ -82,9 +82,9 @@ const DropzoneDemoPage = (props) => { ...@@ -82,9 +82,9 @@ const DropzoneDemoPage = (props) => {
<li> <li>
The file(s) must be validated or not. If validation is required, The file(s) must be validated or not. If validation is required,
it can be done by taking into account a predefined set of allowed{" "} it can be done by taking into account a predefined set of allowed{" "}
<a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept"> <AnchorToTab href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept">
Common MIME Types Common MIME Types
</a> </AnchorToTab>
; specifiying the max file size (in bytes) and/or the max amount ; specifiying the max file size (in bytes) and/or the max amount
of files. of files.
</li> </li>
...@@ -114,7 +114,10 @@ const DropzoneDemoPage = (props) => { ...@@ -114,7 +114,10 @@ const DropzoneDemoPage = (props) => {
<CodeHighlight>{`<FileMosaic/>`} </CodeHighlight> <CodeHighlight>{`<FileMosaic/>`} </CodeHighlight>
component for showing the files selected by the user with minimun component for showing the files selected by the user with minimun
props too. For further information of this component check out the{" "} props too. For further information of this component check out the{" "}
<a href="/components/filemosaic">FileMosaic</a> page. <AnchorToTab href="/components/filemosaic">
FileMosaic
</AnchorToTab>{" "}
page.
</Alert> </Alert>
<br /> <br />
<Alert severity="info"> <Alert severity="info">
...@@ -127,7 +130,7 @@ const DropzoneDemoPage = (props) => { ...@@ -127,7 +130,7 @@ const DropzoneDemoPage = (props) => {
<strong>Javascript</strong> example for handling the metadata that <strong>Javascript</strong> example for handling the metadata that
makes possible the information exchange between components. For makes possible the information exchange between components. For
further information about this data type check out the{" "} further information about this data type check out the{" "}
<a href="/types#ext-file">ExtFile-API. </a> <AnchorToTab href="/types#ext-file">ExtFile-API. </AnchorToTab>
</Alert> </Alert>
</section> </section>
...@@ -203,73 +206,76 @@ const DropzoneDemoPage = (props) => { ...@@ -203,73 +206,76 @@ const DropzoneDemoPage = (props) => {
<section id="uploading"> <section id="uploading">
<SubTitle content="Uploading" /> <SubTitle content="Uploading" />
<DescParagraph> <DescParagraph>
For uploading the prop{" "} For uploading , the prop <TypeHighlight>uploadConfig</TypeHighlight>{" "}
<AnchorToTab href="/types#UploadConfig">uploadConfig</AnchorToTab>{" "} must be given. This prop recieves an object in which you can specify
must be given. In this prop you can specify the method, the url, the HTTP method, the url, the headers and also extra data to be
headers and also extra upload data. The type definition for the prop uploaded. The type definition for the prop mentioned can be found{" "}
mmentioned can be found{" "}
<AnchorToTab href="/types#UploadConfig">here</AnchorToTab>. <AnchorToTab href="/types#UploadConfig">here</AnchorToTab>.
</DescParagraph> </DescParagraph>
<Paper variant="outlined" style={{ padding: "25px" }}> <Paper variant="outlined" style={{ padding: "25px" }}>
<DemoDropzoneUploading /> <DemoDropzoneUploading />
</Paper> </Paper>
<CodeDemoDropzoneUploading /> <CodeDemoDropzoneUploading />
<Alert severity="info"> <Alert severity="info">
<AlertTitle> Removing non valid Files </AlertTitle> <AlertTitle> Fake uploading </AlertTitle>
We call "clean" to the operation of removing non valid files. Apart By giving this prop, the {"<Dropzone/>"} component will simulate the
from deleting them individually, there are some other ways in which upload operation by randomly set the upload status and message in
you can remove all of them. You can try the following props in the{" "} ech uploadable <TypeHighlight>ExtFile</TypeHighlight>. It also will
{"<Dropzone/>"} component: set a fake progress.
</Alert>
<br />
<Alert severity="info">
<AlertTitle> Upload config properties </AlertTitle>
Apart from the properties you can see in the example above, there
are more of them that can make the upload process to behave
differently.
<ul> <ul>
<li> <li>
<TypeHighlight>cleanFiles</TypeHighlight> : This will make <TypeHighlight>autoUpload</TypeHighlight> : By setting this prop
dropzone header to dislay the "clean" icon which can trigger the to true, the upload process will start automatically just after
"clean" operation. the user drops or selects files.
</li>
<li>
<TypeHighlight>actionButtons</TypeHighlight> : By setting this
prop properly, a button will be visible and will trigger the
"clean" operation (This is the way used in this demo).
</li> </li>
<li> <li>
<TypeHighlight>autoClean</TypeHighlight> : By setting this prop, <TypeHighlight>cleanOnUpload</TypeHighlight> : By setting this
non valid files will be automatically discarted and will not be prop, you can control whether the upload process should "clean"
given in the <CodeHighlight>onChange</CodeHighlight> event. the non valid files before uploading or not By default this
value is true.
</li> </li>
</ul> </ul>
More information about the uploadConfig type structure can be found{" "}
<AnchorToTab href="/types#UploadConfig">here</AnchorToTab>.
</Alert> </Alert>
</section> </section>
{/*
<section id="dropzone-events">
<SubTitle content="Dropzone events" />
<DescParagraph>
You can handle the following events:
<ul>
<li>
Dropzone with the <code className="code">onDelete</code> prop
defined can delete all the files associated with the{" "}
<code className="code">value</code> prop.
</li>
<li>
{" "}
Dropzone with the <code className="code">onDelete</code> prop
defined can delete all the files associated with the{" "}
<code className="code">value</code> prop..
</li>
<li>Accept an specific size (in bytes) of files.</li>
</ul>
</DescParagraph>
<Paper variant="outlined" style={{ padding: "25px" }}> <section id="dropzone-events">
<BasicDemoDropzone /> <SubTitle content="Dropzone events" />
</Paper> <DescParagraph>
You can handle the following events:
<ul>
<li>
Dropzone with the <code className="code">onDelete</code> prop
defined can delete all the files associated with the{" "}
<code className="code">value</code> prop.
</li>
<li>
{" "}
Dropzone with the <code className="code">onDelete</code> prop
defined can delete all the files associated with the{" "}
<code className="code">value</code> prop..
</li>
<li>Accept an specific size (in bytes) of files.</li>
</ul>
</DescParagraph>
<Paper variant="outlined" style={{ padding: "25px" }}>
<BasicDemoDropzone />
</Paper>
<p></p> <p></p>
<BasicDropzoneCodeJS /> <BasicDropzoneCodeJS />
</section>*/} </section>
<section id="api"> <section id="api">
<SubTitle content="API" /> <SubTitle content="API" />
<DescParagraph> <DescParagraph>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment