Merge pull request #17 from bagisto-europe/master

Update branch
This commit is contained in:
Glenn Hermans 2021-06-26 04:05:57 +02:00 committed by GitHub
commit 7368743c16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 84 additions and 21 deletions

View File

@ -48,6 +48,11 @@ return [
'root' => storage_path('app'),
],
'private' => [
'driver' => 'local',
'root' => storage_path('app/private'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),

View File

@ -3,22 +3,24 @@
namespace Webkul\Product\Repositories;
use Illuminate\Support\Facades\Storage;
use Webkul\Core\Eloquent\Repository;
use Illuminate\Support\Str;
use Webkul\Core\Eloquent\Repository;
class ProductDownloadableLinkRepository extends Repository
{
/**
* Specify Model class name
* Specify model class name.
*
* @return string
*/
function model()
public function model()
{
return 'Webkul\Product\Contracts\ProductDownloadableLink';
}
/**
* Upload.
*
* @param array $data
* @param integer $productId
* @return array
@ -28,7 +30,7 @@ class ProductDownloadableLinkRepository extends Repository
foreach ($data as $type => $file) {
if (request()->hasFile($type)) {
return [
$type => $path = request()->file($type)->store('product_downloadable_links/' . $productId),
$type => $path = request()->file($type)->store('product_downloadable_links/' . $productId, 'private'),
$type . '_name' => $file->getClientOriginalName(),
$type . '_url' => Storage::url($path),
];
@ -39,8 +41,10 @@ class ProductDownloadableLinkRepository extends Repository
}
/**
* Save links.
*
* @param array $data
* @param \Webkul\Product\Contracts\Product $product
* @param \Webkul\Product\Models\Product $product
* @return void
*/
public function saveLinks(array $data, $product)
@ -67,4 +71,4 @@ class ProductDownloadableLinkRepository extends Repository
$this->delete($linkId);
}
}
}
}

View File

@ -89,7 +89,11 @@ class DownloadableProductController extends Controller
}
if ($downloadableLinkPurchased->type == 'file') {
return Storage::download($downloadableLinkPurchased->file);
$privateDisk = Storage::disk('private');
return $privateDisk->exists($downloadableLinkPurchased->file)
? $privateDisk->download($downloadableLinkPurchased->file)
: abort(404);
} else {
$fileName = $name = substr($downloadableLinkPurchased->url, strrpos($downloadableLinkPurchased->url, '/') + 1);;

View File

@ -96,7 +96,11 @@ class ProductController extends Controller
$productDownloadableLink = $this->productDownloadableLinkRepository->findOrFail(request('id'));
if ($productDownloadableLink->sample_type == 'file') {
return Storage::download($productDownloadableLink->sample_file);
$privateDisk = Storage::disk('private');
return $privateDisk->exists($productDownloadableLink->sample_file)
? $privateDisk->download($productDownloadableLink->sample_file)
: abort(404);
} else {
$fileName = $name = substr($productDownloadableLink->sample_url, strrpos($productDownloadableLink->sample_url, '/') + 1);

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=1a2a11fc54d0a5962a66",
"/js/ui.js": "/js/ui.js?id=3e481e3d97031123114f",
"/css/ui.css": "/css/ui.css?id=87c15a3e7af4ab272377"
}

View File

@ -121,6 +121,10 @@ trait ProvideDataGridPlus
'allLocales' => __('admin::app.admin.system.all-locales'),
'allCustomerGroups' => __('admin::app.admin.system.all-customer-groups'),
'search' => __('ui::app.datagrid.search'),
'searchTitle' => __('ui::app.datagrid.search-title'),
'channel' => __('ui::app.datagrid.channel'),
'locale' => __('ui::app.datagrid.locale'),
'customerGroup' => __('ui::app.datagrid.customer-group'),
'itemsPerPage' => __('ui::app.datagrid.items-per-page'),
'filter' => __('ui::app.datagrid.filter'),
'column' => __('ui::app.datagrid.column'),

View File

@ -987,7 +987,7 @@
},
searchCollection: function(searchValue) {
this.formURL("search", "all", searchValue, "Search");
this.formURL("search", "all", searchValue, this.translations.searchTitle);
},
setParamsAndUrl: function() {
@ -1289,10 +1289,10 @@
switch (obj.column) {
case "search":
obj.label = "Search";
obj.label = this.translations.searchTitle;
break;
case "channel":
obj.label = "Channel";
obj.label = this.translations.channel;
if ("channels" in this.extraFilters) {
obj.prettyValue = this.extraFilters[
"channels"
@ -1304,7 +1304,7 @@
}
break;
case "locale":
obj.label = "Locale";
obj.label = this.translations.locale;
if ("locales" in this.extraFilters) {
obj.prettyValue = this.extraFilters["locales"].find(
locale => locale.code === obj.val
@ -1316,7 +1316,7 @@
}
break;
case "customer_group":
obj.label = "Customer Group";
obj.label = this.translations.customerGroup;
if ("customer_groups" in this.extraFilters) {
obj.prettyValue = this.extraFilters[
"customer_groups"

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'بعض الحقل المطلوب هو لاغ ، رجاء تفقد عمود ، حالة و قيمة صحيح',
'click_on_action' => 'هل تريد حقا أن تؤدي هذا العمل؟',
'search' => '...ابحث هنا',
'search-title' => 'يبحث',
'channel' => 'قناة',
'locale' => 'لغة',
'customer-group' => 'مجموعة العملاء',
'filter' => 'منقي',
'column' => 'حدد العمود',
'condition' => 'حدد الشرط',

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'Einige der erforderlichen Felder sind null. Überprüfen Sie Spalte, Zustand und Wert ordnungsgemäß',
'click_on_action' => 'Möchten Sie diese Aktion wirklich ausführen?',
'search' => 'Suchen ...',
'search-title' => 'Suche',
'channel' => 'Kanal',
'locale' => 'Gebietsschema',
'customer-group' => 'Kundengruppe',
'filter' => 'Filter',
'column' => 'Wählen Sie eine Spalte',
'condition' => 'Wählen Sie eine Bedingung',

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'Some of the required field is null, please check column, condition and value properly',
'click_on_action' => 'Do you really want to perform this action?',
'search' => 'Search Here...',
'search-title' => 'Search',
'channel' => 'Channel',
'locale' => 'Locale',
'customer-group' => 'Customer Group',
'filter' => 'Filter',
'column' => 'Select Column',
'condition' => 'Select Condition',

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'Algunos de los campos obligatorios son nulos, verifique la columna, la condición y el valor correctamente',
'click_on_action' => '¿De verdad quieres realizar esta acción?',
'search' => 'Busque Aquí...',
'search-title' => 'Buscar',
'channel' => 'Canal',
'locale' => 'Lugar',
'customer-group' => 'grupo de clientes',
'filter' => 'Filtrar',
'column' => 'Seleccione la columna',
'condition' => 'Seleccionar condición',

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'برخی از زمینه های مورد نیاز خالی است ، لطفا ستون ، شرایط و ارزش را به درستی بررسی کنید',
'click_on_action' => 'آیا واقعاً می خواهید این عمل را انجام دهید؟',
'search' => 'جستجو در اینجا ...',
'search-title' => 'جستجو کردن',
'channel' => 'کانال',
'locale' => 'محلی',
'customer-group' => 'گروه مشتریان',
'filter' => 'فیلتر',
'column' => 'انتخاب ستون',
'condition' => 'انتخاب شرایط',

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'Alcuni dei campi obbligatori sono nulli, per favore verificare le colonne, le condizioni e i valori inseriti',
'click_on_action' => 'Vuoi davvero effettuare questa azione?',
'search' => 'Cerca qui...',
'search-title' => 'Gruppo di clienti',
'channel' => 'Canale',
'locale' => 'Locale',
'customer-group' => 'Gruppo di clienti',
'filter' => 'Filtro',
'column' => 'Seleziona Colonna',
'condition' => 'Seleziona Condizione',

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'Some of the required field is null, please check column, condition and value properly',
'click_on_action' => 'Wilt u deze actie echt uitvoeren?',
'search' => 'Zoek hier...',
'search-title' => 'Zoeken',
'channel' => 'Kanaal',
'locale' => 'Lokaal',
'customer-group' => 'Klantengroep',
'filter' => 'Filter',
'column' => 'Selecteer kolom',
'condition' => 'Selecteer voorwaarde',

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'Niektóre wymagane pola są puste, proszę sprawdzić kolumnę, warunek i wartość poprawnie',
'click_on_action' => 'Czy naprawdę chcesz wykonać tę akcję?',
'search' => 'Tutaj wyszukasz...',
'search-title' => 'Szukaj',
'channel' => 'Kanał',
'locale' => 'Widownia',
'customer-group' => 'Grupa klientów',
'filter' => 'Filtr',
'column' => 'Wybierz kolumnę',
'condition' => 'Wybierz warunek',

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'Alguns dos campos obrigatórios são nulos, por favor verifique coluna, condição e valor corretamente',
'click_on_action' => 'Você realmente quer realizar esta ação?',
'search' => 'Busque Aqui...',
'search-title' => 'Procurar',
'channel' => 'Canal',
'locale' => 'Localidade',
'customer-group' => 'Grupo de Clientes',
'filter' => 'Filtrar',
'column' => 'Selecione a coluna',
'condition' => 'Selecione Condição',

View File

@ -22,6 +22,10 @@ return [
'filter-fields-missing' => 'Zorunlu alanlardan bazıları boş, lütfen sütun, durum ve değeri doğru şekilde kontrol edin',
'click_on_action' => 'Bu işlemi gerçekleştirmek istediğinizden emin misiniz?',
'search' => 'Arama Yapın...',
'search-title' => 'Arama',
'channel' => 'Kanal',
'locale' => 'yerel',
'customer-group' => 'müşteri grubu',
'filter' => 'Filtrele',
'column' => 'Sütun Seç',
'condition' => 'Durum Seç',

View File

@ -460,7 +460,7 @@
},
searchCollection: function (searchValue) {
this.formURL("search", 'all', searchValue, 'Search');
this.formURL("search", 'all', searchValue, '{{ __('ui::app.datagrid.search-title') }}');
},
// function triggered to check whether the query exists or not and then call the make filters from the url
@ -725,10 +725,10 @@
switch (obj.column) {
case "search":
obj.label = "Search";
obj.label = "{{ __('ui::app.datagrid.search-title') }}";
break;
case "channel":
obj.label = "Channel";
obj.label = "{{ __('ui::app.datagrid.channel') }}";
if ('channels' in this.extraFilters) {
obj.prettyValue = this.extraFilters['channels'].find(channel => channel.code == obj.val);
@ -738,7 +738,7 @@
}
break;
case "locale":
obj.label = "Locale";
obj.label = "{{ __('ui::app.datagrid.locale') }}";
if ('locales' in this.extraFilters) {
obj.prettyValue = this.extraFilters['locales'].find(locale => locale.code === obj.val);
@ -748,7 +748,7 @@
}
break;
case "customer_group":
obj.label = "Customer Group";
obj.label = "{{ __('ui::app.datagrid.customer-group') }}";
if ('customer_groups' in this.extraFilters) {
obj.prettyValue = this.extraFilters['customer_groups'].find(customer_group => customer_group.id === parseInt(obj.val, 10));

View File

@ -1,3 +1,4 @@
*
!private/
!public/
!.gitignore

2
storage/app/private/.gitignore vendored Executable file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -1,3 +1,2 @@
*
!public/
!.gitignore