mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-24 13:44:42 +00:00
- admin registration fixes
- alert popup refactoring
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
APP_NAME=Laravel
|
APP_NAME=Laravel
|
||||||
APP_ENV=local
|
APP_ENV=local
|
||||||
APP_KEY=base64:AVABDIuuiuExFcG2rzjNK4x8YuYTPZDwg5FuCbePbQI=
|
APP_KEY=base64:pmWS5U7+noTCU5suzjqHJ6JLy97iftEZhwvX+pEZKKs=
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_URL=http://localhost
|
APP_URL=http://localhost
|
||||||
APP_DEMO=false
|
APP_DEMO=false
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'version' => '2.0.0-Rc.8',
|
'version' => '2.0.0-Rc.9',
|
||||||
|
|
||||||
'is_demo' => env('APP_DEMO', false),
|
'is_demo' => env('APP_DEMO', false),
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+70
-70
@@ -1,75 +1,75 @@
|
|||||||
{
|
{
|
||||||
"/js/main.js": "/js/main.js",
|
"/js/main.js": "/js/main.js",
|
||||||
"/chunks/request.js": "/chunks/request.js?id=c2edd99d001665c2",
|
"/chunks/request.js": "/chunks/request.js?id=a3152137c8665d87",
|
||||||
"/chunks/request-upload.js": "/chunks/request-upload.js?id=35b65503f01ef52c",
|
"/chunks/request-upload.js": "/chunks/request-upload.js?id=5e83edadf289c2bc",
|
||||||
"/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=19a0784e59d768ec",
|
"/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=3c2fc454c3fce8d2",
|
||||||
"/chunks/status-check.js": "/chunks/status-check.js?id=336de73834cc9a29",
|
"/chunks/status-check.js": "/chunks/status-check.js?id=13a266918abf0cf8",
|
||||||
"/chunks/purchase-code.js": "/chunks/purchase-code.js?id=df5bd89528649783",
|
"/chunks/purchase-code.js": "/chunks/purchase-code.js?id=c1df85c34d7e9521",
|
||||||
"/chunks/database.js": "/chunks/database.js?id=ba3140027421b977",
|
"/chunks/database.js": "/chunks/database.js?id=aa0c55a4ea464e38",
|
||||||
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=fc3886e258b9a9b9",
|
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=e789154b7e7a051e",
|
||||||
"/chunks/app-setup.js": "/chunks/app-setup.js?id=7bae302e249c73a1",
|
"/chunks/app-setup.js": "/chunks/app-setup.js?id=19a9aefba0671fcc",
|
||||||
"/chunks/admin-account.js": "/chunks/admin-account.js?id=309dc20e668952e6",
|
"/chunks/admin-account.js": "/chunks/admin-account.js?id=4efb7c4e0b664b06",
|
||||||
"/chunks/shared.js": "/chunks/shared.js?id=e106df5c08e2ebb0",
|
"/chunks/shared.js": "/chunks/shared.js?id=fb39d822581697d8",
|
||||||
"/chunks/shared/browser.js": "/chunks/shared/browser.js?id=7d78c21314593e88",
|
"/chunks/shared/browser.js": "/chunks/shared/browser.js?id=6e798ab50bb24650",
|
||||||
"/chunks/shared/single-file.js": "/chunks/shared/single-file.js?id=af632a9bdc82be95",
|
"/chunks/shared/single-file.js": "/chunks/shared/single-file.js?id=c9f4bd8ab4bbc551",
|
||||||
"/chunks/shared/authenticate.js": "/chunks/shared/authenticate.js?id=c303bb3ce8a22918",
|
"/chunks/shared/authenticate.js": "/chunks/shared/authenticate.js?id=2d2ccd3ef9765d65",
|
||||||
"/chunks/not-found.js": "/chunks/not-found.js?id=5fbc874846003a91",
|
"/chunks/not-found.js": "/chunks/not-found.js?id=3ff463727211228e",
|
||||||
"/chunks/temporary-unavailable.js": "/chunks/temporary-unavailable.js?id=9c283755ffea5e90",
|
"/chunks/temporary-unavailable.js": "/chunks/temporary-unavailable.js?id=ba49ed84eaeb6e76",
|
||||||
"/chunks/admin.js": "/chunks/admin.js?id=a4511f8b0f8f5d6c",
|
"/chunks/admin.js": "/chunks/admin.js?id=62d1ff3a51bff5e1",
|
||||||
"/chunks/dashboard.js": "/chunks/dashboard.js?id=3cb0b23a8ab78cbb",
|
"/chunks/dashboard.js": "/chunks/dashboard.js?id=da6cc2ad31b3185a",
|
||||||
"/chunks/invoices.js": "/chunks/invoices.js?id=f89964a5a55ace45",
|
"/chunks/invoices.js": "/chunks/invoices.js?id=da62e39ad5ef9bd7",
|
||||||
"/chunks/subscriptions.js": "/chunks/subscriptions.js?id=62582c26b6288d7d",
|
"/chunks/subscriptions.js": "/chunks/subscriptions.js?id=d0c8277ed5e2b48c",
|
||||||
"/chunks/pages.js": "/chunks/pages.js?id=d7219aff1586ef7a",
|
"/chunks/pages.js": "/chunks/pages.js?id=979ca7c16b74efce",
|
||||||
"/chunks/page-edit.js": "/chunks/page-edit.js?id=8a6b001219a08faf",
|
"/chunks/page-edit.js": "/chunks/page-edit.js?id=2af8302e98e5ec3f",
|
||||||
"/chunks/plans.js": "/chunks/plans.js?id=704f996bd6e6c651",
|
"/chunks/plans.js": "/chunks/plans.js?id=f4533ad79d4560a5",
|
||||||
"/chunks/users.js": "/chunks/users.js?id=f3c592b251f7d183",
|
"/chunks/users.js": "/chunks/users.js?id=320784137a3aa296",
|
||||||
"/chunks/user-create.js": "/chunks/user-create.js?id=617e9bf3df1739b2",
|
"/chunks/user-create.js": "/chunks/user-create.js?id=fe8858d333289d49",
|
||||||
"/chunks/plan-create/fixed.js": "/chunks/plan-create/fixed.js?id=b557039c3b07913a",
|
"/chunks/plan-create/fixed.js": "/chunks/plan-create/fixed.js?id=17e80e7c9eb00953",
|
||||||
"/chunks/plan-create/metered.js": "/chunks/plan-create/metered.js?id=8db8eabf6b39775b",
|
"/chunks/plan-create/metered.js": "/chunks/plan-create/metered.js?id=f5064e50ce6ba1b5",
|
||||||
"/chunks/user.js": "/chunks/user.js?id=7e567c0cb7f641d6",
|
"/chunks/user.js": "/chunks/user.js?id=77e59bd628da3cb4",
|
||||||
"/chunks/user-detail.js": "/chunks/user-detail.js?id=6c169888720ad92a",
|
"/chunks/user-detail.js": "/chunks/user-detail.js?id=ebbbd514e30630e0",
|
||||||
"/chunks/user-storage.js": "/chunks/user-storage.js?id=f66071eb1b65c082",
|
"/chunks/user-storage.js": "/chunks/user-storage.js?id=57856a54644a24d3",
|
||||||
"/chunks/user-subscription.js": "/chunks/user-subscription.js?id=f033931911b07f5c",
|
"/chunks/user-subscription.js": "/chunks/user-subscription.js?id=0be0c55ddd5d358e",
|
||||||
"/chunks/user-password.js": "/chunks/user-password.js?id=6d23f552e9d52c49",
|
"/chunks/user-password.js": "/chunks/user-password.js?id=d24f0c4afc9b2220",
|
||||||
"/chunks/user-delete.js": "/chunks/user-delete.js?id=82b5180a1d9e1217",
|
"/chunks/user-delete.js": "/chunks/user-delete.js?id=47d44b2f8e4e620c",
|
||||||
"/chunks/plan.js": "/chunks/plan.js?id=37a04161ac1973ad",
|
"/chunks/plan.js": "/chunks/plan.js?id=2444730c1a0a42fc",
|
||||||
"/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=2cc70b67d00bbda1",
|
"/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=a9f9d70e279b7dcc",
|
||||||
"/chunks/plan-settings.js": "/chunks/plan-settings.js?id=1679d4320a70fc13",
|
"/chunks/plan-settings.js": "/chunks/plan-settings.js?id=626f93c13e875893",
|
||||||
"/chunks/plan-delete.js": "/chunks/plan-delete.js?id=1a03842f88224cbd",
|
"/chunks/plan-delete.js": "/chunks/plan-delete.js?id=ff79a849a0b950dd",
|
||||||
"/chunks/payments.js": "/chunks/payments.js?id=2a6dba57de536b0d",
|
"/chunks/payments.js": "/chunks/payments.js?id=5ea275fedd8d638a",
|
||||||
"/chunks/payments/billings.js": "/chunks/payments/billings.js?id=a434d9363a14beab",
|
"/chunks/payments/billings.js": "/chunks/payments/billings.js?id=8b5846c43c3b335c",
|
||||||
"/chunks/payments/settings.js": "/chunks/payments/settings.js?id=59925e82d06e59fe",
|
"/chunks/payments/settings.js": "/chunks/payments/settings.js?id=42dbd4f33e89606b",
|
||||||
"/chunks/app-settings.js": "/chunks/app-settings.js?id=ac94675bfea2ac48",
|
"/chunks/app-settings.js": "/chunks/app-settings.js?id=b0ca7cdad56e46fd",
|
||||||
"/chunks/app-appearance.js": "/chunks/app-appearance.js?id=e388c80adec307d7",
|
"/chunks/app-appearance.js": "/chunks/app-appearance.js?id=79521524b58b6120",
|
||||||
"/chunks/app-index.js": "/chunks/app-index.js?id=6befbefd7ebeb16a",
|
"/chunks/app-index.js": "/chunks/app-index.js?id=cd54d602a5122a40",
|
||||||
"/chunks/app-environment.js": "/chunks/app-environment.js?id=d5ebc63ff754aa33",
|
"/chunks/app-environment.js": "/chunks/app-environment.js?id=059db5c5ff25f7a5",
|
||||||
"/chunks/app-others.js": "/chunks/app-others.js?id=ecec96c73341ba8a",
|
"/chunks/app-others.js": "/chunks/app-others.js?id=d9632f3cdbcf0d0e",
|
||||||
"/chunks/app-sign-in-out.js": "/chunks/app-sign-in-out.js?id=d3ed0a81743ac3ba",
|
"/chunks/app-sign-in-out.js": "/chunks/app-sign-in-out.js?id=9e94b765b03347ca",
|
||||||
"/chunks/app-adsense.js": "/chunks/app-adsense.js?id=4ee8de4ac0dae19e",
|
"/chunks/app-adsense.js": "/chunks/app-adsense.js?id=c4c4cda03202a49a",
|
||||||
"/chunks/app-server.js": "/chunks/app-server.js?id=b07d804fe4dd8132",
|
"/chunks/app-server.js": "/chunks/app-server.js?id=4a099ee9d6979096",
|
||||||
"/chunks/app-language.js": "/chunks/app-language.js?id=83a53ba4d233ae46",
|
"/chunks/app-language.js": "/chunks/app-language.js?id=4c84c957ec474ca5",
|
||||||
"/chunks/homepage.js": "/chunks/homepage.js?id=3a8a009996ff94d0",
|
"/chunks/homepage.js": "/chunks/homepage.js?id=20e686e79d1f827a",
|
||||||
"/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=0585ee757e04fe8d",
|
"/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=bbd1a3b0be7dbeee",
|
||||||
"/chunks/contact-us.js": "/chunks/contact-us.js?id=1b8ef1d52ded4eff",
|
"/chunks/contact-us.js": "/chunks/contact-us.js?id=f8634b03752500fb",
|
||||||
"/chunks/successfully-email-verified.js": "/chunks/successfully-email-verified.js?id=887ca001d1542b96",
|
"/chunks/successfully-email-verified.js": "/chunks/successfully-email-verified.js?id=6649e9fb4a8a8f43",
|
||||||
"/chunks/successfully-email-send.js": "/chunks/successfully-email-send.js?id=f4562229776d9f56",
|
"/chunks/successfully-email-send.js": "/chunks/successfully-email-send.js?id=d630ed9f6f558509",
|
||||||
"/chunks/sign-in.js": "/chunks/sign-in.js?id=bbed1e72f0086331",
|
"/chunks/sign-in.js": "/chunks/sign-in.js?id=027bfbe1ae255c4b",
|
||||||
"/chunks/sign-up.js": "/chunks/sign-up.js?id=8c86dc0636211584",
|
"/chunks/sign-up.js": "/chunks/sign-up.js?id=69bac1ec45dd8203",
|
||||||
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=63bc2a81117cee2f",
|
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=8aaf784d9a8538b7",
|
||||||
"/chunks/create-new-password.js": "/chunks/create-new-password.js?id=b7d1b17596c771c3",
|
"/chunks/create-new-password.js": "/chunks/create-new-password.js?id=e9482fe3bc2e589e",
|
||||||
"/chunks/settings.js": "/chunks/settings.js?id=1852612f04dd5286",
|
"/chunks/settings.js": "/chunks/settings.js?id=a1212a2b9937874f",
|
||||||
"/chunks/profile.js": "/chunks/profile.js?id=baa99177b1a788a2",
|
"/chunks/profile.js": "/chunks/profile.js?id=8049a20459b22971",
|
||||||
"/chunks/settings-password.js": "/chunks/settings-password.js?id=29034c929a287e2a",
|
"/chunks/settings-password.js": "/chunks/settings-password.js?id=637e68d26ba0a89f",
|
||||||
"/chunks/settings-storage.js": "/chunks/settings-storage.js?id=80bca2eb75da275d",
|
"/chunks/settings-storage.js": "/chunks/settings-storage.js?id=5ce9b4c17ee3033d",
|
||||||
"/chunks/billing.js": "/chunks/billing.js?id=9008d99558ed20a5",
|
"/chunks/billing.js": "/chunks/billing.js?id=dee7f139e8a0c7b2",
|
||||||
"/chunks/platform.js": "/chunks/platform.js?id=db669d1ba1538743",
|
"/chunks/platform.js": "/chunks/platform.js?id=860a4f62aa886f23",
|
||||||
"/chunks/files.js": "/chunks/files.js?id=535a172eef59e2f4",
|
"/chunks/files.js": "/chunks/files.js?id=b773dfc084b77089",
|
||||||
"/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=a6d8378911b23390",
|
"/chunks/recent-uploads.js": "/chunks/recent-uploads.js?id=5aa1b271ac4a6792",
|
||||||
"/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=ebfebefef781b070",
|
"/chunks/my-shared-items.js": "/chunks/my-shared-items.js?id=916ea69c45024978",
|
||||||
"/chunks/trash.js": "/chunks/trash.js?id=1db4e081774b005b",
|
"/chunks/trash.js": "/chunks/trash.js?id=4aced09523efe363",
|
||||||
"/chunks/team-folders.js": "/chunks/team-folders.js?id=28717f216f507f4b",
|
"/chunks/team-folders.js": "/chunks/team-folders.js?id=81ad169492a6b18e",
|
||||||
"/chunks/shared-with-me.js": "/chunks/shared-with-me.js?id=c34c03304d94f7eb",
|
"/chunks/shared-with-me.js": "/chunks/shared-with-me.js?id=2cffb6203b9c3321",
|
||||||
"/chunks/invitation.js": "/chunks/invitation.js?id=21d172e77f12dbbb",
|
"/chunks/invitation.js": "/chunks/invitation.js?id=4064848e25bec2a7",
|
||||||
"/css/tailwind.css": "/css/tailwind.css",
|
"/css/tailwind.css": "/css/tailwind.css",
|
||||||
"/css/app.css": "/css/app.css"
|
"/css/app.css": "/css/app.css"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<transition name="popup">
|
<transition name="popup">
|
||||||
<div @click.self="closePopup" class="popup" v-if="isVisibleWrapper">
|
<div
|
||||||
<div class="popup-wrapper">
|
v-if="isVisibleWrapper"
|
||||||
<div class="popup-image">
|
@click.self="closePopup"
|
||||||
<span class="emoji">{{ emoji }}</span>
|
class="fixed top-0 left-0 right-0 bottom-0 z-50 grid h-full overflow-y-auto p-10"
|
||||||
</div>
|
>
|
||||||
<div class="popup-content">
|
<div class="fixed top-0 bottom-0 left-0 right-0 z-10 m-auto w-full bg-white shadow-xl dark:bg-dark-foreground md:relative md:w-[490px] md:rounded-xl">
|
||||||
<h1 v-if="title" class="title">{{ title }}</h1>
|
<div class="flex h-full -translate-y-7 transform items-center justify-center px-8 text-center md:translate-y-0">
|
||||||
<p v-if="message" class="message">{{ message }}</p>
|
<div>
|
||||||
</div>
|
<img src="https://twemoji.maxcdn.com/v/13.1.0/svg/1f627.svg" alt="" class="mx-auto mb-4 w-20 md:mt-6 min-h-[80px]" />
|
||||||
<div class="popup-actions">
|
|
||||||
<ButtonBase @click.native="closePopup" :button-style="buttonStyle" class="action-confirm"
|
<h1 v-if="title" class="mb-2 text-2xl font-bold">
|
||||||
>{{ button }}
|
{{ title }}
|
||||||
|
</h1>
|
||||||
|
<p v-if="message" class="mb-4 text-sm">
|
||||||
|
{{ message }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<PopupActions>
|
||||||
|
<ButtonBase @click.native="closePopup" :button-style="buttonStyle" class="w-full">
|
||||||
|
{{ button }}
|
||||||
</ButtonBase>
|
</ButtonBase>
|
||||||
</div>
|
</PopupActions>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -22,10 +31,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import ButtonBase from './ButtonBase'
|
import ButtonBase from './ButtonBase'
|
||||||
import { events } from '../../bus'
|
import { events } from '../../bus'
|
||||||
|
import PopupActions from "../Others/Popup/PopupActions";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AlertPopup',
|
name: 'AlertPopup',
|
||||||
components: {
|
components: {
|
||||||
|
PopupActions,
|
||||||
ButtonBase,
|
ButtonBase,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -48,12 +59,12 @@ export default {
|
|||||||
events.$on('alert:open', (args) => {
|
events.$on('alert:open', (args) => {
|
||||||
this.isVisibleWrapper = true
|
this.isVisibleWrapper = true
|
||||||
|
|
||||||
this.title = args.title
|
this.title = args.title || undefined
|
||||||
this.message = args.message
|
this.message = args.message || undefined
|
||||||
|
|
||||||
this.button = this.$t('alerts.error_confirm')
|
this.button = this.$t('alerts.error_confirm')
|
||||||
this.emoji = '😢😢😢'
|
this.emoji = '😢😢😢'
|
||||||
this.buttonStyle = 'danger-solid'
|
this.buttonStyle = 'danger'
|
||||||
|
|
||||||
if (args.emoji) {
|
if (args.emoji) {
|
||||||
this.emoji = args.emoji
|
this.emoji = args.emoji
|
||||||
@@ -93,90 +104,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import '../../../sass/vuefilemanager/variables';
|
|
||||||
@import '../../../sass/vuefilemanager/mixins';
|
|
||||||
|
|
||||||
.popup {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 45;
|
|
||||||
overflow: auto;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-wrapper {
|
|
||||||
z-index: 12;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
max-width: 480px;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%) scale(1);
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: $light_mode_popup_shadow;
|
|
||||||
border-radius: 8px;
|
|
||||||
text-align: center;
|
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-image {
|
|
||||||
margin-bottom: 30px;
|
|
||||||
|
|
||||||
.emoji {
|
|
||||||
@include font-size(56);
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-content {
|
|
||||||
.title {
|
|
||||||
@include font-size(22);
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-weight: 800;
|
|
||||||
color: $text;
|
|
||||||
}
|
|
||||||
|
|
||||||
.message {
|
|
||||||
@include font-size(16);
|
|
||||||
color: #333;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-actions {
|
|
||||||
margin-top: 30px;
|
|
||||||
|
|
||||||
.action-confirm {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 690px) {
|
|
||||||
.popup-wrapper {
|
|
||||||
padding: 40px 20px 20px;
|
|
||||||
left: 15px;
|
|
||||||
right: 15px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.dark {
|
|
||||||
.popup-wrapper {
|
|
||||||
background: $dark_mode_foreground;
|
|
||||||
}
|
|
||||||
.popup-content {
|
|
||||||
.title {
|
|
||||||
color: $dark_mode_text_primary;
|
|
||||||
}
|
|
||||||
|
|
||||||
.message {
|
|
||||||
color: $dark_mode_text_secondary;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Animations
|
// Animations
|
||||||
.popup-enter-active {
|
.popup-enter-active {
|
||||||
|
|||||||
@@ -88,6 +88,14 @@ export default {
|
|||||||
_method: 'delete',
|
_method: 'delete',
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
// If metered subscription, then set isEmptyPlans to true
|
||||||
|
if (this.$store.getters.config.subscriptionType === 'metered') {
|
||||||
|
this.$store.commit('REPLACE_CONFIG_VALUE', {
|
||||||
|
key: 'isEmptyPlans',
|
||||||
|
value: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
events.$emit('toaster', {
|
events.$emit('toaster', {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$t('popup_deleted_plan.title'),
|
message: this.$t('popup_deleted_plan.title'),
|
||||||
|
|||||||
@@ -201,7 +201,13 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
// Validation errors
|
// Validation errors
|
||||||
if (error.response.status == 422) {
|
if (error.response.status === 409) {
|
||||||
|
|
||||||
|
events.$emit('alert:open', {
|
||||||
|
title: error.response.data.message,
|
||||||
|
})
|
||||||
|
|
||||||
|
} else if (error.response.status === 422) {
|
||||||
// Email validation error
|
// Email validation error
|
||||||
if (error.response.data.errors['email']) {
|
if (error.response.data.errors['email']) {
|
||||||
this.$refs.createUser.setErrors({
|
this.$refs.createUser.setErrors({
|
||||||
|
|||||||
@@ -218,9 +218,6 @@ export default {
|
|||||||
axios
|
axios
|
||||||
.post('/api/register', this.register)
|
.post('/api/register', this.register)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// End loading
|
|
||||||
this.isLoading = false
|
|
||||||
|
|
||||||
if (!this.config.userVerification) {
|
if (!this.config.userVerification) {
|
||||||
// Set login state
|
// Set login state
|
||||||
this.$store.commit('SET_AUTHORIZED', true)
|
this.$store.commit('SET_AUTHORIZED', true)
|
||||||
@@ -240,6 +237,13 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error.response.status === 409) {
|
||||||
|
|
||||||
|
events.$emit('alert:open', {
|
||||||
|
title: error.response.data.message,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (error.response.status === 422) {
|
if (error.response.status === 422) {
|
||||||
if (error.response.data.errors['email']) {
|
if (error.response.data.errors['email']) {
|
||||||
this.$refs.sign_up.setErrors({
|
this.$refs.sign_up.setErrors({
|
||||||
@@ -253,10 +257,11 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
// End loading
|
// End loading
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
@if(! $metadata['is_protected'])
|
@if(! $metadata['is_protected'])
|
||||||
|
|
||||||
@if($metadata['thumbnail'])
|
@if($metadata['thumbnail'])
|
||||||
<meta property="og:image" content="{{ $metadata['thumbnail']['md'] }}">
|
<meta property="og:image" content="{{ $metadata['thumbnail']['lg'] }}">
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<meta property="og:title" content="{{ $metadata['name'] }} ({{ $metadata['size'] }}) | {{ $settings->app_title ?? 'VueFileManager' }}">
|
<meta property="og:title" content="{{ $metadata['name'] }} ({{ $metadata['size'] }}) | {{ $settings->app_title ?? 'VueFileManager' }}">
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Socialite\Controllers;
|
namespace App\Socialite\Controllers;
|
||||||
|
|
||||||
use App\Users\Models\User;
|
use App\Users\Models\User;
|
||||||
@@ -7,15 +8,19 @@ use App\Http\Controllers\Controller;
|
|||||||
use Laravel\Socialite\Facades\Socialite;
|
use Laravel\Socialite\Facades\Socialite;
|
||||||
use App\Users\Actions\CreateNewUserAction;
|
use App\Users\Actions\CreateNewUserAction;
|
||||||
use Illuminate\Contracts\Auth\StatefulGuard;
|
use Illuminate\Contracts\Auth\StatefulGuard;
|
||||||
|
use VueFileManager\Subscription\Domain\Plans\Exceptions\MeteredBillingPlanDoesntExist;
|
||||||
|
use VueFileManager\Subscription\Domain\Plans\Models\Plan;
|
||||||
|
|
||||||
class SocialiteCallbackController extends Controller
|
class SocialiteCallbackController extends Controller
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected StatefulGuard $guard,
|
protected StatefulGuard $guard,
|
||||||
public CreateNewUserAction $createNewUser,
|
public CreateNewUserAction $createNewUser,
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* @throws MeteredBillingPlanDoesntExist
|
||||||
|
*/
|
||||||
public function __invoke($provider)
|
public function __invoke($provider)
|
||||||
{
|
{
|
||||||
$isAllowedRegistration = intval(get_settings('registration'));
|
$isAllowedRegistration = intval(get_settings('registration'));
|
||||||
@@ -39,8 +44,23 @@ class SocialiteCallbackController extends Controller
|
|||||||
return redirect()->to('/platform/files');
|
return redirect()->to('/platform/files');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for metered billing plan
|
||||||
|
if (get_settings('subscription_type') === 'metered') {
|
||||||
|
// Get metered plan
|
||||||
|
$plan = Plan::where('status', 'active')
|
||||||
|
->where('type', 'metered');
|
||||||
|
|
||||||
|
// TODO: redirect to the error page
|
||||||
|
if ($plan->doesntExist()) {
|
||||||
|
return response([
|
||||||
|
'type' => 'error',
|
||||||
|
'message' => 'User registrations are temporarily disabled',
|
||||||
|
], 409);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if account registration is enabled
|
// Check if account registration is enabled
|
||||||
if (! $isAllowedRegistration) {
|
if (!$isAllowedRegistration) {
|
||||||
return response([
|
return response([
|
||||||
'type' => 'error',
|
'type' => 'error',
|
||||||
'message' => 'User registration is not allowed',
|
'message' => 'User registration is not allowed',
|
||||||
@@ -49,6 +69,7 @@ class SocialiteCallbackController extends Controller
|
|||||||
|
|
||||||
// Create data user data object
|
// Create data user data object
|
||||||
$data = CreateUserData::fromArray([
|
$data = CreateUserData::fromArray([
|
||||||
|
'role' => 'user',
|
||||||
'name' => $socialite->getName(),
|
'name' => $socialite->getName(),
|
||||||
'email' => $socialite->getEmail(),
|
'email' => $socialite->getEmail(),
|
||||||
'avatar' => store_socialite_avatar($socialite->getAvatar()),
|
'avatar' => store_socialite_avatar($socialite->getAvatar()),
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class AutoSubscribeForMeteredBillingAction
|
|||||||
// Create balance with 0 amount
|
// Create balance with 0 amount
|
||||||
$user->balance()->create([
|
$user->balance()->create([
|
||||||
'amount' => 0,
|
'amount' => 0,
|
||||||
'currency' => $plan->currency, // todo: issue where plan is not created yet
|
'currency' => $plan->currency,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ use App\Http\Controllers\Controller;
|
|||||||
use Illuminate\Auth\Events\Registered;
|
use Illuminate\Auth\Events\Registered;
|
||||||
use Domain\Teams\Models\TeamFolderMember;
|
use Domain\Teams\Models\TeamFolderMember;
|
||||||
use Domain\Teams\Models\TeamFolderInvitation;
|
use Domain\Teams\Models\TeamFolderInvitation;
|
||||||
|
use VueFileManager\Subscription\Domain\Plans\Models\Plan;
|
||||||
|
use VueFileManager\Subscription\Domain\Plans\Exceptions\MeteredBillingPlanDoesntExist;
|
||||||
|
|
||||||
class CreateNewUserAction extends Controller
|
class CreateNewUserAction extends Controller
|
||||||
{
|
{
|
||||||
@@ -17,14 +19,69 @@ class CreateNewUserAction extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate and create a new user.
|
* Validate and create a new user.
|
||||||
|
*
|
||||||
|
* @throws MeteredBillingPlanDoesntExist
|
||||||
*/
|
*/
|
||||||
public function __invoke(CreateUserData $data): User
|
public function __invoke(CreateUserData $data): User
|
||||||
{
|
{
|
||||||
$settings = get_settings([
|
// Check if subscription metered billing plan exist
|
||||||
'user_verification', 'subscription_type',
|
$this->checkMeteredBillingPlan($data);
|
||||||
]);
|
|
||||||
|
|
||||||
// Create user
|
// Create user
|
||||||
|
$user = $this->createUser($data);
|
||||||
|
|
||||||
|
// Join to previously accepted team folder invitations
|
||||||
|
$this->applyExistingTeamInvitations($user);
|
||||||
|
|
||||||
|
// Subscribe user for metered billing
|
||||||
|
if (get_settings('subscription_type') === 'metered' && $data->role !== 'admin') {
|
||||||
|
($this->autoSubscribeForMeteredBilling)($user);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mark as verified if verification is disabled
|
||||||
|
if (! $data->password || ! intval(get_settings('user_verification'))) {
|
||||||
|
$user->markEmailAsVerified();
|
||||||
|
}
|
||||||
|
|
||||||
|
event(new Registered($user));
|
||||||
|
|
||||||
|
return $user;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws MeteredBillingPlanDoesntExist
|
||||||
|
*/
|
||||||
|
private function checkMeteredBillingPlan(CreateUserData $data): void
|
||||||
|
{
|
||||||
|
if (get_settings('subscription_type') === 'metered' && $data->role !== 'admin') {
|
||||||
|
// Get metered plan
|
||||||
|
$plan = Plan::where('status', 'active')
|
||||||
|
->where('type', 'metered');
|
||||||
|
|
||||||
|
if ($plan->doesntExist()) {
|
||||||
|
throw new MeteredBillingPlanDoesntExist();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function applyExistingTeamInvitations(User $user): void
|
||||||
|
{
|
||||||
|
TeamFolderInvitation::where('email', $user->email)
|
||||||
|
->where('status', 'waiting-for-registration')
|
||||||
|
->cursor()
|
||||||
|
->each(function ($invitation) use ($user) {
|
||||||
|
TeamFolderMember::create([
|
||||||
|
'user_id' => $user->id,
|
||||||
|
'parent_id' => $invitation->parent_id,
|
||||||
|
'permission' => $invitation->permission,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$invitation->accept();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private function createUser(CreateUserData $data): User
|
||||||
|
{
|
||||||
$user = User::create([
|
$user = User::create([
|
||||||
'password' => $data->password ? bcrypt($data->password) : null,
|
'password' => $data->password ? bcrypt($data->password) : null,
|
||||||
'oauth_provider' => $data->oauth_provider,
|
'oauth_provider' => $data->oauth_provider,
|
||||||
@@ -41,32 +98,6 @@ class CreateNewUserAction extends Controller
|
|||||||
'avatar' => $data->avatar,
|
'avatar' => $data->avatar,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Join to previously accepted team folder invitations
|
|
||||||
TeamFolderInvitation::where('email', $user->email)
|
|
||||||
->where('status', 'waiting-for-registration')
|
|
||||||
->cursor()
|
|
||||||
->each(function ($invitation) use ($user) {
|
|
||||||
TeamFolderMember::create([
|
|
||||||
'user_id' => $user->id,
|
|
||||||
'parent_id' => $invitation->parent_id,
|
|
||||||
'permission' => $invitation->permission,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$invitation->accept();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Subscribe user for metered billing
|
|
||||||
if ($settings['subscription_type'] === 'metered') {
|
|
||||||
($this->autoSubscribeForMeteredBilling)($user);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mark as verified if verification is disabled
|
|
||||||
if (! $data->password || ! intval($settings['user_verification'])) {
|
|
||||||
$user->markEmailAsVerified();
|
|
||||||
}
|
|
||||||
|
|
||||||
event(new Registered($user));
|
|
||||||
|
|
||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
|
|||||||
use App\Users\Actions\CreateNewUserAction;
|
use App\Users\Actions\CreateNewUserAction;
|
||||||
use App\Users\Requests\RegisterUserRequest;
|
use App\Users\Requests\RegisterUserRequest;
|
||||||
use Illuminate\Contracts\Auth\StatefulGuard;
|
use Illuminate\Contracts\Auth\StatefulGuard;
|
||||||
|
use VueFileManager\Subscription\Domain\Plans\Exceptions\MeteredBillingPlanDoesntExist;
|
||||||
|
|
||||||
class RegisterUserController extends Controller
|
class RegisterUserController extends Controller
|
||||||
{
|
{
|
||||||
@@ -26,10 +27,21 @@ class RegisterUserController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Map registration data
|
// Map registration data
|
||||||
$data = CreateUserData::fromRequest($request);
|
$data = CreateUserData::fromArray([
|
||||||
|
'name' => $request->input('name'),
|
||||||
|
'email' => $request->input('email'),
|
||||||
|
'password' => $request->input('password'),
|
||||||
|
]);
|
||||||
|
|
||||||
// Register user
|
// Register user
|
||||||
$user = ($this->createNewUser)($data);
|
try {
|
||||||
|
$user = ($this->createNewUser)($data);
|
||||||
|
} catch (MeteredBillingPlanDoesntExist $e) {
|
||||||
|
return response([
|
||||||
|
'type' => 'error',
|
||||||
|
'message' => 'User registrations are temporarily disabled',
|
||||||
|
], 409);
|
||||||
|
}
|
||||||
|
|
||||||
// Log in if verification is disabled
|
// Log in if verification is disabled
|
||||||
if (! $user->password || ! intval(get_settings('user_verification'))) {
|
if (! $user->password || ! intval(get_settings('user_verification'))) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ use Spatie\DataTransferObject\DataTransferObject;
|
|||||||
|
|
||||||
class CreateUserData extends DataTransferObject
|
class CreateUserData extends DataTransferObject
|
||||||
{
|
{
|
||||||
|
public string $role;
|
||||||
public string $name;
|
public string $name;
|
||||||
public string $email;
|
public string $email;
|
||||||
public ?string $password;
|
public ?string $password;
|
||||||
@@ -14,6 +15,7 @@ class CreateUserData extends DataTransferObject
|
|||||||
public static function fromRequest($request): self
|
public static function fromRequest($request): self
|
||||||
{
|
{
|
||||||
return new self([
|
return new self([
|
||||||
|
'role' => $request->has('role') ? $request->input('role') : 'user',
|
||||||
'name' => $request->input('name'),
|
'name' => $request->input('name'),
|
||||||
'email' => $request->input('email'),
|
'email' => $request->input('email'),
|
||||||
'avatar' => $request->input('avatar') ?? null,
|
'avatar' => $request->input('avatar') ?? null,
|
||||||
@@ -25,9 +27,10 @@ class CreateUserData extends DataTransferObject
|
|||||||
public static function fromArray(array $array): self
|
public static function fromArray(array $array): self
|
||||||
{
|
{
|
||||||
return new self([
|
return new self([
|
||||||
|
'role' => $array['role'] ?? 'user',
|
||||||
'name' => $array['name'] ?? null,
|
'name' => $array['name'] ?? null,
|
||||||
'email' => $array['email'],
|
'email' => $array['email'],
|
||||||
'avatar' => $array['avatar'],
|
'avatar' => $array['avatar'] ?? null,
|
||||||
'password' => $array['password'] ?? null,
|
'password' => $array['password'] ?? null,
|
||||||
'oauth_provider' => $array['oauth_provider'] ?? null,
|
'oauth_provider' => $array['oauth_provider'] ?? null,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use App\Users\Resources\UserResource;
|
|||||||
use App\Users\Resources\UsersCollection;
|
use App\Users\Resources\UsersCollection;
|
||||||
use App\Users\Actions\CreateNewUserAction;
|
use App\Users\Actions\CreateNewUserAction;
|
||||||
use Domain\Admin\Requests\CreateUserByAdmin;
|
use Domain\Admin\Requests\CreateUserByAdmin;
|
||||||
|
use VueFileManager\Subscription\Domain\Plans\Exceptions\MeteredBillingPlanDoesntExist;
|
||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
@@ -43,6 +44,7 @@ class UserController extends Controller
|
|||||||
{
|
{
|
||||||
// Map user data
|
// Map user data
|
||||||
$data = CreateUserData::fromArray([
|
$data = CreateUserData::fromArray([
|
||||||
|
'role' => $request->input('role'),
|
||||||
'name' => $request->input('name'),
|
'name' => $request->input('name'),
|
||||||
'email' => $request->input('email'),
|
'email' => $request->input('email'),
|
||||||
'password' => $request->input('password'),
|
'password' => $request->input('password'),
|
||||||
@@ -50,11 +52,17 @@ class UserController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// Register user
|
// Register user
|
||||||
$user = ($this->createNewUser)($data);
|
try {
|
||||||
|
$user = ($this->createNewUser)($data);
|
||||||
|
} catch (MeteredBillingPlanDoesntExist $e) {
|
||||||
|
return response([
|
||||||
|
'type' => 'error',
|
||||||
|
'message' => 'User registrations are temporarily disabled',
|
||||||
|
], 409);
|
||||||
|
}
|
||||||
|
|
||||||
// Update user data
|
// Update user data
|
||||||
$user->email_verified_at = now();
|
$user->email_verified_at = now();
|
||||||
$user->role = $request->input('role');
|
|
||||||
|
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
|
|||||||
@@ -11,16 +11,19 @@ class GenerateImageThumbnailAction
|
|||||||
|
|
||||||
public function __invoke($fileName, $userId, $execution): void
|
public function __invoke($fileName, $userId, $execution): void
|
||||||
{
|
{
|
||||||
$localDisk = Storage::disk('local');
|
|
||||||
|
|
||||||
// Get image width
|
// Get image width
|
||||||
$imageWidth = getimagesize($localDisk->path("temp/$userId/$fileName"))[0];
|
$imageWidth = getimagesize(
|
||||||
|
Storage::disk('local')->path("temp/$userId/$fileName")
|
||||||
|
)[0];
|
||||||
|
|
||||||
collect(config("vuefilemanager.image_sizes.$execution"))
|
collect(config("vuefilemanager.image_sizes.$execution"))
|
||||||
->each(function ($size) use ($userId, $fileName, $imageWidth) {
|
->each(function ($size) use ($userId, $fileName, $imageWidth) {
|
||||||
if ($imageWidth > $size['size']) {
|
if ($imageWidth > $size['size']) {
|
||||||
|
|
||||||
// Create intervention image
|
// Create intervention image
|
||||||
$intervention = Image::make(config('filesystems.disks.local.root') . "/temp/$userId/$fileName")
|
$intervention = Image::make(
|
||||||
|
Storage::disk('local')->path("temp/$userId/$fileName")
|
||||||
|
)
|
||||||
->orientate();
|
->orientate();
|
||||||
|
|
||||||
// Generate thumbnail
|
// Generate thumbnail
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Tests\App\Users;
|
namespace Tests\App\Users;
|
||||||
|
|
||||||
use Storage;
|
use Storage;
|
||||||
@@ -38,6 +39,7 @@ class SignFlowTest extends TestCase
|
|||||||
});
|
});
|
||||||
|
|
||||||
$this->postJson('api/register', [
|
$this->postJson('api/register', [
|
||||||
|
'role' => 'admin',
|
||||||
'email' => 'john@doe.com',
|
'email' => 'john@doe.com',
|
||||||
'password' => 'SecretPassword',
|
'password' => 'SecretPassword',
|
||||||
'password_confirmation' => 'SecretPassword',
|
'password_confirmation' => 'SecretPassword',
|
||||||
@@ -48,6 +50,7 @@ class SignFlowTest extends TestCase
|
|||||||
->assertDatabaseHas('users', [
|
->assertDatabaseHas('users', [
|
||||||
'email' => 'john@doe.com',
|
'email' => 'john@doe.com',
|
||||||
'email_verified_at' => null,
|
'email_verified_at' => null,
|
||||||
|
'role' => 'user',
|
||||||
])
|
])
|
||||||
->assertDatabaseHas('user_settings', [
|
->assertDatabaseHas('user_settings', [
|
||||||
'first_name' => 'John',
|
'first_name' => 'John',
|
||||||
@@ -99,6 +102,7 @@ class SignFlowTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$this->postJson('api/register', [
|
$this->postJson('api/register', [
|
||||||
|
'role' => 'admin',
|
||||||
'email' => 'john@doe.com',
|
'email' => 'john@doe.com',
|
||||||
'password' => 'SecretPassword',
|
'password' => 'SecretPassword',
|
||||||
'password_confirmation' => 'SecretPassword',
|
'password_confirmation' => 'SecretPassword',
|
||||||
@@ -108,6 +112,7 @@ class SignFlowTest extends TestCase
|
|||||||
$this
|
$this
|
||||||
->assertDatabaseCount('transactions', 0)
|
->assertDatabaseCount('transactions', 0)
|
||||||
->assertDatabaseHas('users', [
|
->assertDatabaseHas('users', [
|
||||||
|
'role' => 'user',
|
||||||
'email' => 'john@doe.com',
|
'email' => 'john@doe.com',
|
||||||
])
|
])
|
||||||
->assertDatabaseHas('subscriptions', [
|
->assertDatabaseHas('subscriptions', [
|
||||||
@@ -162,6 +167,7 @@ class SignFlowTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$this->postJson('api/register', [
|
$this->postJson('api/register', [
|
||||||
|
'role' => 'admin',
|
||||||
'email' => 'john@doe.com',
|
'email' => 'john@doe.com',
|
||||||
'password' => 'SecretPassword',
|
'password' => 'SecretPassword',
|
||||||
'password_confirmation' => 'SecretPassword',
|
'password_confirmation' => 'SecretPassword',
|
||||||
@@ -172,6 +178,7 @@ class SignFlowTest extends TestCase
|
|||||||
|
|
||||||
$this
|
$this
|
||||||
->assertDatabaseHas('users', [
|
->assertDatabaseHas('users', [
|
||||||
|
'role' => 'user',
|
||||||
'email' => 'john@doe.com',
|
'email' => 'john@doe.com',
|
||||||
])
|
])
|
||||||
->assertDatabaseHas('subscriptions', [
|
->assertDatabaseHas('subscriptions', [
|
||||||
@@ -206,7 +213,7 @@ class SignFlowTest extends TestCase
|
|||||||
public function it_try_register_when_registration_is_disabled()
|
public function it_try_register_when_registration_is_disabled()
|
||||||
{
|
{
|
||||||
Setting::updateOrCreate([
|
Setting::updateOrCreate([
|
||||||
'name' => 'registration',
|
'name' => 'registration',
|
||||||
], [
|
], [
|
||||||
'value' => 0,
|
'value' => 0,
|
||||||
]);
|
]);
|
||||||
@@ -333,6 +340,7 @@ class SignFlowTest extends TestCase
|
|||||||
'email' => $user->email,
|
'email' => $user->email,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
*/
|
*/
|
||||||
@@ -358,7 +366,7 @@ class SignFlowTest extends TestCase
|
|||||||
|
|
||||||
$this
|
$this
|
||||||
->assertDatabaseHas('users', [
|
->assertDatabaseHas('users', [
|
||||||
'email' => 'john@doe.com',
|
'email' => 'john@doe.com',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,46 +121,10 @@ class AdminTest extends TestCase
|
|||||||
->actingAs($admin)
|
->actingAs($admin)
|
||||||
->getJson("/api/admin/users/$user->id/storage")
|
->getJson("/api/admin/users/$user->id/storage")
|
||||||
->assertStatus(200)
|
->assertStatus(200)
|
||||||
->assertExactJson([
|
->assertJsonFragment([
|
||||||
'data' => [
|
'used' => '5.00MB',
|
||||||
'id' => $user->id,
|
'capacity' => '1GB',
|
||||||
'type' => 'storage',
|
'percentage' => 0.5,
|
||||||
'attributes' => [
|
|
||||||
'used' => '5.00MB',
|
|
||||||
'capacity' => '1GB',
|
|
||||||
'percentage' => 0.5,
|
|
||||||
],
|
|
||||||
'meta' => [
|
|
||||||
'images' => [
|
|
||||||
'used' => '1.00MB',
|
|
||||||
'percentage' => 0.1,
|
|
||||||
],
|
|
||||||
'audios' => [
|
|
||||||
'used' => '1.00MB',
|
|
||||||
'percentage' => 0.1,
|
|
||||||
],
|
|
||||||
'videos' => [
|
|
||||||
'used' => '1.00MB',
|
|
||||||
'percentage' => 0.1,
|
|
||||||
],
|
|
||||||
'documents' => [
|
|
||||||
'used' => '1.00MB',
|
|
||||||
'percentage' => 0.1,
|
|
||||||
],
|
|
||||||
'others' => [
|
|
||||||
'used' => '1.00MB',
|
|
||||||
'percentage' => 0.1,
|
|
||||||
],
|
|
||||||
'traffic' => [
|
|
||||||
'chart' => [
|
|
||||||
'download' => [],
|
|
||||||
'upload' => [],
|
|
||||||
],
|
|
||||||
'download' => '0B',
|
|
||||||
'upload' => '0B',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,28 +23,18 @@ class DashboardTest extends TestCase
|
|||||||
->actingAs($user)
|
->actingAs($user)
|
||||||
->getJson('/api/admin/dashboard')
|
->getJson('/api/admin/dashboard')
|
||||||
->assertStatus(200)
|
->assertStatus(200)
|
||||||
->assertExactJson([
|
->assertJsonFragment([
|
||||||
'app' => [
|
'app' => [
|
||||||
'earnings' => '$0.00',
|
'earnings' => '$0.00',
|
||||||
'isRunningCron' => false,
|
'isRunningCron' => false,
|
||||||
'license' => 'extended',
|
'license' => 'extended',
|
||||||
'version' => config('vuefilemanager.version'),
|
'version' => config('vuefilemanager.version'),
|
||||||
],
|
],
|
||||||
'disk' => [
|
|
||||||
'download' => [
|
|
||||||
'records' => [],
|
|
||||||
'total' => '0B',
|
|
||||||
],
|
|
||||||
'upload' => [
|
|
||||||
'records' => [],
|
|
||||||
'total' => '0B',
|
|
||||||
],
|
|
||||||
'used' => '2.00MB',
|
|
||||||
],
|
|
||||||
'users' => [
|
'users' => [
|
||||||
'total' => 1,
|
'total' => 1,
|
||||||
'usersPremiumTotal' => 0,
|
'usersPremiumTotal' => 0,
|
||||||
],
|
],
|
||||||
|
'used' => '2.00MB',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class HomepageTest extends TestCase
|
|||||||
->get("/api/og-site/$share->token")
|
->get("/api/og-site/$share->token")
|
||||||
->assertStatus(200)
|
->assertStatus(200)
|
||||||
->assertSee('Fake Image')
|
->assertSee('Fake Image')
|
||||||
->assertSee('md-fake-image.jpg');
|
->assertSee('lg-fake-image.jpg');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -72,7 +72,9 @@ class SetupWizardTest extends TestCase
|
|||||||
'storageLimitation' => 1,
|
'storageLimitation' => 1,
|
||||||
'defaultStorage' => 10,
|
'defaultStorage' => 10,
|
||||||
'logo' => UploadedFile::fake()->image('fake-logo.jpg'),
|
'logo' => UploadedFile::fake()->image('fake-logo.jpg'),
|
||||||
|
'logo_dark' => UploadedFile::fake()->image('fake-logo-dark.jpg'),
|
||||||
'logo_horizontal' => UploadedFile::fake()->image('fake-logo-horizontal.jpg'),
|
'logo_horizontal' => UploadedFile::fake()->image('fake-logo-horizontal.jpg'),
|
||||||
|
'logo_horizontal_dark' => UploadedFile::fake()->image('fake-logo-horizontal-dark.jpg'),
|
||||||
'favicon' => UploadedFile::fake()->image('fake-favicon.jpg'),
|
'favicon' => UploadedFile::fake()->image('fake-favicon.jpg'),
|
||||||
])->assertStatus(204);
|
])->assertStatus(204);
|
||||||
|
|
||||||
@@ -168,7 +170,7 @@ class SetupWizardTest extends TestCase
|
|||||||
|
|
||||||
$this->assertDatabaseHas('settings', [
|
$this->assertDatabaseHas('settings', [
|
||||||
'name' => 'license',
|
'name' => 'license',
|
||||||
'value' => 'Regular',
|
'value' => 'regular',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertDatabaseHas('settings', [
|
$this->assertDatabaseHas('settings', [
|
||||||
|
|||||||
Reference in New Issue
Block a user