Skip to content

Commit

Permalink
Merge pull request #45 from BBS-Lab/develop
Browse files Browse the repository at this point in the history
v0.3.0
  • Loading branch information
crezra authored Sep 2, 2022
2 parents 006cfac + 0fa4f69 commit 951ed29
Show file tree
Hide file tree
Showing 86 changed files with 20,664 additions and 19,965 deletions.
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/.editorconfig export-ignore
/docs export-ignore
/.github export-ignore
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
![PHP](https://img.shields.io/badge/PHP-8-blue.svg)
![Laravel Nova](https://img.shields.io/badge/laravel%2Fnova-4-cyan.svg)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/bbs-lab/nova-file-manager.svg?style=flat-square)](https://packagist.org/packages/bbs-lab/nova-file-manager)
[![Total Downloads](https://img.shields.io/packagist/dt/bbs-lab/nova-file-manager.svg?style=flat-square)](https://packagist.org/packages/bbs-lab/nova-file-manager)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/bbs-lab/nova-file-manager.svg)](https://packagist.org/packages/bbs-lab/nova-file-manager)
[![Total Downloads](https://img.shields.io/packagist/dt/bbs-lab/nova-file-manager.svg)](https://packagist.org/packages/bbs-lab/nova-file-manager)
[![Run tests](https://github.com/BBS-Lab/nova-file-manager/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/BBS-Lab/nova-file-manager/actions/workflows/tests.yml)
</div>

Expand All @@ -29,10 +29,11 @@ A file manager tool and field for Laravel Nova. Beautifully designed, and custom
🤹‍ Allows to save multiple assets on the same field
</p>

**Documentation** is available here : https://bbs-lab.github.io/nova-file-manager/


<img src="./docs/preview.png"/>
<a href="https://bbs-lab.github.io/nova-file-manager/"><img src="./docs/images/documentation_banner.png"/></a>

<img src="./docs/subbanner.png"/>

## Table of Contents

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"config": {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
"pestphp/pest-plugin": true,
"infection/extension-installer": false
}
},
"minimum-stability": "dev",
Expand Down
25 changes: 2 additions & 23 deletions config/nova-file-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
'available_disks' => [
'public',
// 's3',
// 'ftp',
// 'ftp',
// ... more disks
],

Expand Down Expand Up @@ -83,7 +83,7 @@
*/

'file_analysis' => [
'enable' => env('NOVA_FILE_MANAGER_ENABLE_FILE_ANALYSIS', true),
'enabled' => env('NOVA_FILE_MANAGER_ENABLE_FILE_ANALYSIS', true),
'cache' => [
'enable' => env('NOVA_FILE_MANAGER_FILE_ANALYSIS_CACHE_ENABLE', true),
'ttl_in_seconds' => env('NOVA_FILE_MANAGER_FILE_ANALYSIS_CACHE_TTL_IN_SECONDS', 60 * 60 * 24),
Expand Down Expand Up @@ -123,25 +123,4 @@
'unit' => 'minutes',
'value' => 10,
],

/*
|--------------------------------------------------------------------------
| Allowed mime types
|--------------------------------------------------------------------------
|
| Here you can specify the mime types that are allowed to be uploaded
| through the tool.
|
| Uses: Laravel `mimes` validation rule
*/
'allowed_mimes' => [
'jpg',
'jpeg',
'png',
'gif',
'mp4',
'zip',
'pdf',
// ... more mimes
],
];
2 changes: 1 addition & 1 deletion dist/css/tool.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/tool.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ let sidebar = [
text: 'Field',
link: '/field',
},
{
text: 'Events',
link: '/events',
}
],
},
{
Expand All @@ -51,6 +55,10 @@ let sidebar = [
text: 'Screenshots',
link: '/screenshots',
},
{
text: 'Contributing',
link: '/contributing',
}
],
},
{
Expand Down
52 changes: 52 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Contributing

## Running the package on a local Laravel Nova instance

If you are looking to contribute to this package and run the tool on your local Laravel Nova installation, you may start
by forking the repository and configure your `composer.json` repositories section.

It may look like this :

```json
{
"repositories": [
{
"type": "git",
"url": "<your-fork-repository-git-url>"
}
]
}
```

## Building locally

When building locally, the following requirements are to be met :

- NodeJS `18.3.0`
- PHP `^8.0`

You may use [nvm](https://github.com/nvm-sh/nvm) to automatically set your node version.

Next step is running the following command

```bash
nvm use
```

You are also required to meet the requirements of the `package-lock.json`.

You may run the following command to install the dependencies :

```bash
npm ci
npm run nova:install:dependency
```

And then to build the package :

```bash
npm run build
```

## Reference
If you are encountering any issues, please refer to the [Laravel Nova Documentation](https://nova.laravel.com/docs/4.0/customization/frontend.html#using-nova-mixins). Or you may open a new issue/discussion at https://github.com/BBS-Lab/nova-file-manager
48 changes: 48 additions & 0 deletions docs/events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Events

The file manager dispatches events when certain actions are performed.
You may subscribe to these events by adding a listener to the event bus.

## FileUploaded

| Parameter | Type |
|-----------|----------|
| `disk` | `string` |
| `path` | `string` |

## FileRenamed

| Parameter | Type |
|-----------|----------|
| `disk` | `string` |
| `oldPath` | `string` |
| `newPath` | `string` |

## FileDeleted

| Parameter | Type |
|-----------|----------|
| `disk` | `string` |
| `path` | `string` |

## FolderCreated

| Parameter | Type |
|-----------|----------|
| `disk` | `string` |
| `path` | `string` |

## FolderRenamed

| Parameter | Type |
|-----------|----------|
| `disk` | `string` |
| `oldPath` | `string` |
| `newPath` | `string` |

## FolderDeleted

| Parameter | Type |
|-----------|----------|
| `disk` | `string` |
| `path` | `string` |
Binary file added docs/images/documentation_banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ play solution for your file management needs.
- 🔧 Various customization and configuration options
- 🔍 A performant local search feature
- 🤹‍ Allows to save multiple assets on the same field

<img src="./subbanner.png"/>
Binary file added docs/subbanner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 28 additions & 13 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
{
"NovaFileManager.meta.size": "Size",
"NovaFileManager.meta.mime": "Mime type",
"NovaFileManager.actions.delete": "Delete",
"NovaFileManager.actions.deselect": "Deselect",
"NovaFileManager.actions.close": "Close",
"NovaFileManager.actions.copy": "Copy",
"NovaFileManager.actions.copy.success": "Copied path to clipboard !",
"NovaFileManager.actions.createFolder": "Create folder",
"NovaFileManager.actions.download": "Download",
"NovaFileManager.actions.rename": "Rename",
"NovaFileManager.actions.submit": "Submit",
"NovaFileManager.actions.upload": "Upload",
"NovaFileManager.createFolderTitle": "Create a new folder",
"NovaFileManager.deleteFileContent": "This will will delete the file from the storage. This action cannot be undone.",
"NovaFileManager.deleteFileTitle": "Are you sure you want to delete this file?",
"NovaFileManager.deleteFolderContent": "This will will delete the folder from the storage. This action cannot be undone.",
"NovaFileManager.deleteFolderTitle": "Are you sure you want to delete this folder?",
"NovaFileManager.drag": "or drag and drop",
"NovaFileManager.dropzone.prompt": "Drop your files here to start uploading",
"NovaFileManager.meta.aspectRatio": "Aspect ratio",
"NovaFileManager.meta.height": "Height",
"NovaFileManager.meta.lastModifiedAt": "Last modified",
"NovaFileManager.meta.mime": "Mime type",
"NovaFileManager.meta.size": "Size",
"NovaFileManager.meta.type": "Type",
"NovaFileManager.meta.width": "Width",
"NovaFileManager.meta.height": "Height",
"NovaFileManager.meta.aspectRatio": "Aspect ratio",
"NovaFileManager.title": "File Manager",
"NovaFileManager.openBrowser": "Open File Manager",
"NovaFileManager.totalFilesCount": ":count files",
"NovaFileManager.selectionCount": ":count selected",
"NovaFileManager.deleteFileContent": "This will will delete the file from the storage. This action cannot be undone.",
"NovaFileManager.deleteFolderContent": "This will will delete the folder from the storage. This action cannot be undone.",
"NovaFileManager.deleteFileTitle": "Are you sure you want to delete this file?",
"NovaFileManager.deleteFolderTitle": "Are you sure you want to delete this folder?",
"NovaFileManager.createFolderTitle": "Create a new folder",
"NovaFileManager.preview.information": "Information",
"NovaFileManager.renameFileTitle": "Rename file",
"NovaFileManager.renameFolderTitle": "Rename folder",
"NovaFileManager.selectionCount": ":count selected",
"NovaFileManager.title": "File Manager",
"NovaFileManager.toolbar.selection": "selected",
"NovaFileManager.toolbar.clear": "clear",
"NovaFileManager.totalFilesCount": ":count files",
"NovaFileManager.upload": "Upload a file",
"NovaFileManager.drag": "or drag and drop"
"NovaFileManager.fileMissing": "File missing at path :path."
}
Loading

0 comments on commit 951ed29

Please sign in to comment.