Skip to content

Commit

Permalink
Introduced option 'enableManageMetadata'
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsboogaard-luminis committed Dec 10, 2019
1 parent 0abdc9d commit 13da493
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 50 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The following options can be provided:
```js
const pond = FilePond.create({
name: 'filepond',
enableManageMetadata: true, // by default true, can be used to disable this plugin for a particular FilePond instance
labelButtonManageMetadata: 'custom label', // by default 'Edit metadata'
onManageMetadata: (item) => console.log('onManageMetadata hook called', item) // callback method which will be called upon clicking the edit icon
});
Expand Down
2 changes: 1 addition & 1 deletion dist/filepond-plugin-manage-metadata.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* FilePondPluginmediaPreview 1.0.1
* FilePondPluginmediaPreview 1.0.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit undefined for details.
*/
Expand Down
8 changes: 7 additions & 1 deletion dist/filepond-plugin-manage-metadata.esm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* FilePondPluginManageMetadata 1.0.1
* FilePondPluginManageMetadata 1.0.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit undefined for details.
*/
Expand Down Expand Up @@ -58,6 +58,11 @@ const plugin = fpAPI => {
return;
}

const enableManageMetadata = root.query('GET_ENABLE_MANAGE_METADATA');
if (!enableManageMetadata) {
return; // not enabled, so hide this plugin
}

const labelButtonManageMetadata = root.query(
'GET_LABEL_BUTTON_MANAGE_METADATA'
);
Expand Down Expand Up @@ -97,6 +102,7 @@ const plugin = fpAPI => {
// expose plugin
return {
options: {
enableManageMetadata: [true, Type.BOOLEAN],
labelButtonManageMetadata: ['Edit metadata', Type.STRING],
onManageMetadata: [null, Type.FUNCTION]
}
Expand Down
4 changes: 2 additions & 2 deletions dist/filepond-plugin-manage-metadata.esm.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion dist/filepond-plugin-manage-metadata.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* FilePondPluginManageMetadata 1.0.1
* FilePondPluginManageMetadata 1.0.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit undefined for details.
*/
Expand Down Expand Up @@ -65,6 +65,12 @@
return;
}

const enableManageMetadata = root.query('GET_ENABLE_MANAGE_METADATA');

if (!enableManageMetadata) {
return; // not enabled, so hide this plugin
}

const labelButtonManageMetadata = root.query(
'GET_LABEL_BUTTON_MANAGE_METADATA'
);
Expand Down Expand Up @@ -101,6 +107,7 @@

return {
options: {
enableManageMetadata: [true, Type.BOOLEAN],
labelButtonManageMetadata: ['Edit metadata', Type.STRING],
onManageMetadata: [null, Type.FUNCTION]
}
Expand Down
2 changes: 1 addition & 1 deletion dist/filepond-plugin-manage-metadata.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/filepond-plugin-manage-metadata.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 13da493

Please sign in to comment.