Skip to content

Commit 6dee82d

Browse files
committed
Add support for directory type plugins
1 parent 4016f2a commit 6dee82d

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/views/Base/PluginsHandler/PluginsHandler.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ function PluginsHandler(props) {
3838

3939

4040
const openPlugin = () => {
41-
const {MimeType} = item;
42-
41+
let {MimeType} = item;
42+
console.log("Plugin Item", item)
43+
if (item.IsDir) {
44+
// Directory mimetype to be searched
45+
MimeType = "rclone/dir";
46+
}
47+
console.log("loaded Plugins", loadedPlugins);
4348
// const availableTestPlugins = [];
4449
let availableTestPlugins = getPluginsArray(loadedTestPlugins);
4550
availableTestPlugins = filterPluginsByMimeType(availableTestPlugins, MimeType);

src/views/StoreDashboard/PluginPlaceHolderCard.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ PluginPlaceHolderCard.propTypes = {
7373
icon: PropTypes.string,
7474
repo: PropTypes.string.isRequired,
7575
bugs: PropTypes.string,
76-
})
76+
}),
77+
getPlugins: PropTypes.func.isRequired
7778
}
7879

7980
export default PluginPlaceHolderCard

src/views/StoreDashboard/StoreDashboard.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class StoreDashboard extends React.Component {
3636

3737
render() {
3838
const {pluginsList, searchQuery} = this.state;
39+
const {getPlugins} = this.props;
3940
if (pluginsList.length <= 0) {
4041
return (<p>Loading</p>)
4142
}
@@ -68,7 +69,7 @@ class StoreDashboard extends React.Component {
6869
{
6970
filteredList.map((e) =>
7071
<Col lg={6} key={e.name}>
71-
<PluginPlaceHolderCard plugin={e}/>
72+
<PluginPlaceHolderCard plugin={e} getPlugins={getPlugins}/>
7273
</Col>
7374
)
7475
}

0 commit comments

Comments
 (0)