desktop toolbar refactoring

This commit is contained in:
Peter Papp
2021-08-31 15:14:55 +02:00
parent c916916a4d
commit d1cb1a378b
8 changed files with 124 additions and 103 deletions
+32 -3
View File
@@ -42,7 +42,7 @@
"/chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared~chunks/share~b068369d.js": "/chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared~chunks/share~b068369d.js?id=d10326c5b0801dff59a4", "/chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared~chunks/share~b068369d.js": "/chunks/files~chunks/my-shared-items~chunks/platform~chunks/recent-uploads~chunks/shared~chunks/share~b068369d.js?id=d10326c5b0801dff59a4",
"/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/settings-subscription~chunks/shared~ab58556a.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/settings-subscription~chunks/shared~ab58556a.js?id=7c0aae7820c3dcd29575", "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/settings-subscription~chunks/shared~ab58556a.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/settings-subscription~chunks/shared~ab58556a.js?id=7c0aae7820c3dcd29575",
"/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/shared/single-f~f04cfcbc.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/shared/single-f~f04cfcbc.js?id=c39ed6403a2c3c124338", "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/shared/single-f~f04cfcbc.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/shared/single-f~f04cfcbc.js?id=c39ed6403a2c3c124338",
"/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/team-folders~ch~ba7d6097.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/team-folders~ch~ba7d6097.js?id=302af22be3f5fe7aaf4d", "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/team-folders~ch~ba7d6097.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/team-folders~ch~ba7d6097.js?id=aaf09d7a6d6085fbe629",
"/chunks/files~chunks/shared/files~chunks/team-folders.js": "/chunks/files~chunks/shared/files~chunks/team-folders.js?id=ed4e72b9cb1946e582c8", "/chunks/files~chunks/shared/files~chunks/team-folders.js": "/chunks/files~chunks/shared/files~chunks/team-folders.js?id=ed4e72b9cb1946e582c8",
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=61fb98fd41324af9cfea", "/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=61fb98fd41324af9cfea",
"/chunks/homepage.js": "/chunks/homepage.js?id=db15518895b65833f7ec", "/chunks/homepage.js": "/chunks/homepage.js?id=db15518895b65833f7ec",
@@ -59,7 +59,7 @@
"/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=0dd0a5efe0e3cb511c48", "/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=0dd0a5efe0e3cb511c48",
"/chunks/plans.js": "/chunks/plans.js?id=e93cd9c42177eadc8825", "/chunks/plans.js": "/chunks/plans.js?id=e93cd9c42177eadc8825",
"/chunks/platform.js": "/chunks/platform.js?id=39e4ea880516add24c59", "/chunks/platform.js": "/chunks/platform.js?id=39e4ea880516add24c59",
"/chunks/platform~chunks/shared.js": "/chunks/platform~chunks/shared.js?id=6000d49dae81f57df3d0", "/chunks/platform~chunks/shared.js": "/chunks/platform~chunks/shared.js?id=e42c52a6ef90161fe16d",
"/chunks/profile.js": "/chunks/profile.js?id=658aa03af778cc2cc100", "/chunks/profile.js": "/chunks/profile.js?id=658aa03af778cc2cc100",
"/chunks/profile~chunks/settings-password.js": "/chunks/profile~chunks/settings-password.js?id=ddb7be518c092ed392ca", "/chunks/profile~chunks/settings-password.js": "/chunks/profile~chunks/settings-password.js?id=ddb7be518c092ed392ca",
"/chunks/purchase-code.js": "/chunks/purchase-code.js?id=e8597a21a38c153e3c88", "/chunks/purchase-code.js": "/chunks/purchase-code.js?id=e8597a21a38c153e3c88",
@@ -148,5 +148,34 @@
"/chunks/platform.add54d9080a4c72facb3.hot-update.js": "/chunks/platform.add54d9080a4c72facb3.hot-update.js", "/chunks/platform.add54d9080a4c72facb3.hot-update.js": "/chunks/platform.add54d9080a4c72facb3.hot-update.js",
"/chunks/platform.b270ed5302710d2d9b4d.hot-update.js": "/chunks/platform.b270ed5302710d2d9b4d.hot-update.js", "/chunks/platform.b270ed5302710d2d9b4d.hot-update.js": "/chunks/platform.b270ed5302710d2d9b4d.hot-update.js",
"/chunks/platform.a3857edeaf0f1b1262f2.hot-update.js": "/chunks/platform.a3857edeaf0f1b1262f2.hot-update.js", "/chunks/platform.a3857edeaf0f1b1262f2.hot-update.js": "/chunks/platform.a3857edeaf0f1b1262f2.hot-update.js",
"/chunks/platform.3f5a03ca3df53bb04c5e.hot-update.js": "/chunks/platform.3f5a03ca3df53bb04c5e.hot-update.js" "/chunks/platform.3f5a03ca3df53bb04c5e.hot-update.js": "/chunks/platform.3f5a03ca3df53bb04c5e.hot-update.js",
"/chunks/platform~chunks/shared.6d119b5a149bc3747ee9.hot-update.js": "/chunks/platform~chunks/shared.6d119b5a149bc3747ee9.hot-update.js",
"/chunks/platform~chunks/shared.1ad86cf3c13e081ccdf8.hot-update.js": "/chunks/platform~chunks/shared.1ad86cf3c13e081ccdf8.hot-update.js",
"/chunks/platform~chunks/shared.b199fddf3bcfd90a0fdb.hot-update.js": "/chunks/platform~chunks/shared.b199fddf3bcfd90a0fdb.hot-update.js",
"/chunks/platform~chunks/shared.6f429a0d945f557101d0.hot-update.js": "/chunks/platform~chunks/shared.6f429a0d945f557101d0.hot-update.js",
"/chunks/platform~chunks/shared.0ea477cbce4dd8b7be4c.hot-update.js": "/chunks/platform~chunks/shared.0ea477cbce4dd8b7be4c.hot-update.js",
"/chunks/platform~chunks/shared.cad45666cc9622969c7b.hot-update.js": "/chunks/platform~chunks/shared.cad45666cc9622969c7b.hot-update.js",
"/chunks/platform~chunks/shared.b137a969c816a1cad43d.hot-update.js": "/chunks/platform~chunks/shared.b137a969c816a1cad43d.hot-update.js",
"/js/main.337645602dfb303b5063.hot-update.js": "/js/main.337645602dfb303b5063.hot-update.js",
"/js/main.dbdb47fa3380d10ad1a7.hot-update.js": "/js/main.dbdb47fa3380d10ad1a7.hot-update.js",
"/js/main.f6be8818c22693269d52.hot-update.js": "/js/main.f6be8818c22693269d52.hot-update.js",
"/js/main.7d623b5fe30476007b92.hot-update.js": "/js/main.7d623b5fe30476007b92.hot-update.js",
"/js/main.12bd42d566ffa588b472.hot-update.js": "/js/main.12bd42d566ffa588b472.hot-update.js",
"/js/main.829b50a121226055e51b.hot-update.js": "/js/main.829b50a121226055e51b.hot-update.js",
"/chunks/platform~chunks/shared.9ada3852f380d9f74ce7.hot-update.js": "/chunks/platform~chunks/shared.9ada3852f380d9f74ce7.hot-update.js",
"/chunks/platform~chunks/shared.6a8291ebfd5839386a21.hot-update.js": "/chunks/platform~chunks/shared.6a8291ebfd5839386a21.hot-update.js",
"/chunks/platform~chunks/shared.b852c4a2397c404e234b.hot-update.js": "/chunks/platform~chunks/shared.b852c4a2397c404e234b.hot-update.js",
"/chunks/platform~chunks/shared.d6dfe8601ef247a82b22.hot-update.js": "/chunks/platform~chunks/shared.d6dfe8601ef247a82b22.hot-update.js",
"/chunks/platform~chunks/shared.de344c16232a4d60ee09.hot-update.js": "/chunks/platform~chunks/shared.de344c16232a4d60ee09.hot-update.js",
"/js/main.4a5b9ca68db27bdd7b34.hot-update.js": "/js/main.4a5b9ca68db27bdd7b34.hot-update.js",
"/chunks/platform~chunks/shared.32dfa8217e888b50e7eb.hot-update.js": "/chunks/platform~chunks/shared.32dfa8217e888b50e7eb.hot-update.js",
"/chunks/platform~chunks/shared.6ec281ab19e81571ab46.hot-update.js": "/chunks/platform~chunks/shared.6ec281ab19e81571ab46.hot-update.js",
"/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/team-folders~ch~ba7d6097.4a4114d15d030c03b668.hot-update.js": "/chunks/files~chunks/my-shared-items~chunks/recent-uploads~chunks/shared/files~chunks/team-folders~ch~ba7d6097.4a4114d15d030c03b668.hot-update.js",
"/chunks/platform~chunks/shared.e1c61f7a21fbdae0976f.hot-update.js": "/chunks/platform~chunks/shared.e1c61f7a21fbdae0976f.hot-update.js",
"/chunks/platform~chunks/shared.d4162d8629b712b01643.hot-update.js": "/chunks/platform~chunks/shared.d4162d8629b712b01643.hot-update.js",
"/chunks/platform~chunks/shared.43b8244da6ddfacbf6f3.hot-update.js": "/chunks/platform~chunks/shared.43b8244da6ddfacbf6f3.hot-update.js",
"/chunks/platform~chunks/shared.94508bf87547a5a69886.hot-update.js": "/chunks/platform~chunks/shared.94508bf87547a5a69886.hot-update.js",
"/chunks/platform~chunks/shared.0cac4a4efb13804f00f3.hot-update.js": "/chunks/platform~chunks/shared.0cac4a4efb13804f00f3.hot-update.js",
"/chunks/platform~chunks/shared.1cc958b33c5c1dc8fca4.hot-update.js": "/chunks/platform~chunks/shared.1cc958b33c5c1dc8fca4.hot-update.js",
"/chunks/platform~chunks/shared.adfde9155da98c78507d.hot-update.js": "/chunks/platform~chunks/shared.adfde9155da98c78507d.hot-update.js"
} }
@@ -2,13 +2,13 @@
<div id="desktop-toolbar"> <div id="desktop-toolbar">
<div class="toolbar-wrapper"> <div class="toolbar-wrapper">
<div @click="goBack" class="location"> <div @click="goBack" class="location">
<chevron-left-icon :class="{'is-active': isLoadedFolder }" class="icon-back" size="17" /> <chevron-left-icon :class="{'is-active': isNotHomepage }" class="icon-back" size="17" />
<span class="location-title"> <span class="location-title">
{{ directoryName }} {{ $getCurrentLocationName() }}
</span> </span>
<span v-show="isLoadedFolder" @click.stop="folderActions" class="location-more group" id="folder-actions"> <span v-show="currentFolder" @click.stop="folderActions" class="location-more group" id="folder-actions">
<more-horizontal-icon size="14" class="icon-more group-hover-text-theme" /> <more-horizontal-icon size="14" class="icon-more group-hover-text-theme" />
</span> </span>
</div> </div>
@@ -26,18 +26,18 @@
<ToolbarButton @click.stop.native="showCreateMenu" source="cloud-plus" :action="$t('actions.create')" /> <ToolbarButton @click.stop.native="showCreateMenu" source="cloud-plus" :action="$t('actions.create')" />
<PopoverItem name="desktop-create" side="left"> <PopoverItem name="desktop-create" side="left">
<OptionGroup> <OptionGroup>
<OptionUpload :class="{'is-inactive': canUploadInView || !hasCapacity }" :title="$t('actions.upload')" /> <OptionUpload :class="{'is-inactive': canUploadInView || isTeamFolderHomepage }" :title="$t('actions.upload')" />
</OptionGroup> </OptionGroup>
<OptionGroup> <OptionGroup>
<Option @click.stop.native="$createTeamFolder" :title="$t('Create Team Folder')" icon="users" /> <Option @click.stop.native="$createTeamFolder" :title="$t('Create Team Folder')" icon="users" />
<Option @click.stop.native="$createFolder" :class="{'is-inactive': canCreateFolderInView }" :title="$t('actions.create_folder')" icon="folder-plus" /> <Option @click.stop.native="$createFolder" :class="{'is-inactive': canCreateFolderInView || isTeamFolderHomepage }" :title="$t('actions.create_folder')" icon="folder-plus" />
</OptionGroup> </OptionGroup>
</PopoverItem> </PopoverItem>
</PopoverWrapper> </PopoverWrapper>
</ToolbarGroup> </ToolbarGroup>
<!--Share Controls--> <!--Share Controls-->
<ToolbarGroup v-if="$checkPermission(['master', 'editor']) && ! $isMobile() && !$isThisRoute($route, ['Public'])"> <ToolbarGroup v-if="! $isMobile() && ! $isThisRoute($route, ['Public'])">
<!--Team Folder Icon--> <!--Team Folder Icon-->
<PopoverWrapper v-if="$isThisRoute($route, ['TeamFolders'])"> <PopoverWrapper v-if="$isThisRoute($route, ['TeamFolders'])">
@@ -69,7 +69,7 @@
<FileSortingOptions /> <FileSortingOptions />
</PopoverItem> </PopoverItem>
</PopoverWrapper> </PopoverWrapper>
<ToolbarButton @click.native="$store.dispatch('fileInfoToggle')" :class="{'active': isVisibleSidebar }" :action="$t('actions.info_panel')" source="info" /> <ToolbarButton @click.native="$store.dispatch('fileInfoToggle')" :action="$t('actions.info_panel')" source="info" />
</ToolbarGroup> </ToolbarGroup>
</ToolbarWrapper> </ToolbarWrapper>
</div> </div>
@@ -93,9 +93,8 @@
import {ChevronLeftIcon, MoreHorizontalIcon} from 'vue-feather-icons' import {ChevronLeftIcon, MoreHorizontalIcon} from 'vue-feather-icons'
import SearchBar from '/resources/js/components/FilesView/SearchBar' import SearchBar from '/resources/js/components/FilesView/SearchBar'
import Option from '/resources/js/components/FilesView/Option' import Option from '/resources/js/components/FilesView/Option'
import {mapGetters} from 'vuex'
import {events} from '/resources/js/bus' import {events} from '/resources/js/bus'
import {last} from 'lodash' import {mapGetters} from 'vuex'
export default { export default {
name: 'DesktopToolbar', name: 'DesktopToolbar',
@@ -119,69 +118,46 @@
computed: { computed: {
...mapGetters([ ...mapGetters([
'currentTeamFolder', 'currentTeamFolder',
'isVisibleSidebar',
'FilePreviewType',
'currentFolder', 'currentFolder',
'sharedDetail', 'sharedDetail',
'clipboard', 'clipboard',
]), ]),
teamFolder() { teamFolder() {
return this.currentTeamFolder ? this.currentTeamFolder : this.clipboard[0] return this.currentTeamFolder
? this.currentTeamFolder
: this.clipboard[0]
}, },
isLoadedFolder() { isNotHomepage() {
if (this.$isThisRoute(this.$route, ['Public'])) { if (this.$isThisRoute(this.$route, ['Public'])) {
return this.sharedDetail && this.sharedDetail.data.attributes.item_id === this.$route.params.id return this.sharedDetail && this.sharedDetail.data.attributes.item_id === this.$route.params.id
} }
return this.$route.params.id return this.$route.params.id
}, },
hasCapacity() { isTeamFolderHomepage() {
// Check if storage limitation is set return this.$isThisRoute(this.$route, ['TeamFolders'])
if (!this.$store.getters.config.storageLimit) return true && ! this.$route.params.id
// Check if user is loaded
if (!this.$store.getters.user) return true
// Check if user has storage
return this.$store.getters.user.data.attributes.storage.used <= 100
},
directoryName() {
if (this.currentFolder) {
return this.currentFolder.data.attributes.name
} else {
return {
'RecentUploads': this.$t('Recent'),
'MySharedItems': this.$t('Shared'),
'Trash': this.$t('Trash'),
'Public': this.$t('Files'),
'Files': this.$t('Files'),
'TeamFolders': this.$t('Team Folders'),
}[this.$route.name]
}
},
preview() {
return this.FilePreviewType === 'list'
? 'th'
: 'th-list'
}, },
canCreateFolderInView() { canCreateFolderInView() {
return ! this.$isThisRoute(this.$route, ['Files', 'Public']) return ! this.$isThisRoute(this.$route, ['Files', 'Public', 'TeamFolders'])
},
canShowConvertToTeamFolder() {
return this.$isThisRoute(this.$route, ['Files', 'MySharedItems'])
},
canUploadInView() {
return ! this.$isThisRoute(this.$route, ['Files', 'Public', 'TeamFolders'])
}, },
canDeleteInView() { canDeleteInView() {
let routes = [ let routes = [
'TeamFolders',
'RecentUploads', 'RecentUploads',
'MySharedItems', 'MySharedItems',
'Trash', 'Trash',
'Public', 'Public',
'Files', 'Files',
] ]
return !this.$isThisRoute(this.$route, routes) || this.clipboard.length === 0 return !this.$isThisRoute(this.$route, routes)
}, || this.clipboard.length === 0
canShowConvertToTeamFolder() {
return this.$isThisRoute(this.$route, ['Files', 'MySharedItems'])
},
canUploadInView() {
return ! this.$isThisRoute(this.$route, ['Files', 'Public'])
}, },
canMoveInView() { canMoveInView() {
let routes = [ let routes = [
@@ -189,8 +165,10 @@
'MySharedItems', 'MySharedItems',
'Public', 'Public',
'Files', 'Files',
'TeamFolders',
] ]
return ! this.$isThisRoute(this.$route, routes) || this.clipboard.length === 0 return ! this.$isThisRoute(this.$route, routes)
|| this.clipboard.length === 0
}, },
canShareInView() { canShareInView() {
let routes = [ let routes = [
@@ -200,31 +178,27 @@
'Public', 'Public',
'Files', 'Files',
] ]
return ! this.$isThisRoute(this.$route, routes) || this.clipboard.length > 1 || this.clipboard.length === 0 return ! this.$isThisRoute(this.$route, routes)
|| this.clipboard.length > 1
|| this.clipboard.length === 0
}, },
canCreateTeamFolderInView() { canCreateTeamFolderInView() {
let routes = [ let routes = [
'MySharedItems', 'MySharedItems',
'Files', 'Files',
] ]
return this.$isThisRoute(this.$route, routes) && this.clipboard.length === 1 && this.clipboard[0].data.type === 'folder'
} return this.$isThisRoute(this.$route, routes)
}, && this.clipboard.length === 1
data() { && this.clipboard[0].data.type === 'folder'
return {
members: [
'/temp/avatar-01.png',
'/temp/avatar-02.png',
'/temp/avatar-03.png',
],
} }
}, },
methods: { methods: {
goBack() { goBack() {
if (this.isLoadedFolder) this.$router.back() if (this.isNotHomepage) this.$router.back()
}, },
showTeamFolderMenu() { showTeamFolderMenu() {
if (this.currentTeamFolder || this.clipboard[0]) if (this.teamFolder)
events.$emit('popover:open', 'team-folder') events.$emit('popover:open', 'team-folder')
}, },
showCreateMenu() { showCreateMenu() {
@@ -7,7 +7,7 @@
<!--Folder Title--> <!--Folder Title-->
<div class="directory-name"> <div class="directory-name">
{{ directoryName }} {{ $getCurrentLocationName() }}
</div> </div>
</div> </div>
@@ -41,19 +41,6 @@
'FilePreviewType', 'FilePreviewType',
'currentFolder', 'currentFolder',
]), ]),
directoryName() {
if (this.currentFolder) {
return this.currentFolder.data.attributes.name
} else {
return {
'RecentUploads': this.$t('Recent'),
'MySharedItems': this.$t('Shared'),
'Trash': this.$t('Trash'),
'Public': this.$t('Files'),
'Files': this.$t('Files'),
}[this.$route.name]
}
},
isLoadedFolder() { isLoadedFolder() {
return this.$route.params.id return this.$route.params.id
}, },
@@ -1,7 +1,7 @@
<template> <template>
<div class="team-folder-preview"> <div class="team-folder-preview">
<div class="info"> <div class="info">
<b class="title">The Team Project</b> <b class="title">{{ teamFolder.data.attributes.name }}</b>
<span class="subtitle">Last update a week ago</span> <span class="subtitle">Last update a week ago</span>
<TeamMembersPreview :folder="teamFolder" :avatar-size="32" class="members" /> <TeamMembersPreview :folder="teamFolder" :avatar-size="32" class="members" />
</div> </div>
+15
View File
@@ -201,6 +201,21 @@ const FunctionHelpers = {
anchor.click() anchor.click()
} }
Vue.prototype.$getCurrentLocationName = function () {
if (store.getters.currentFolder) {
return store.getters.currentFolder.data.attributes.name
} else {
return {
'RecentUploads': this.$t('Recent'),
'MySharedItems': this.$t('Shared'),
'Trash': this.$t('Trash'),
'Public': this.$t('Files'),
'Files': this.$t('Files'),
'TeamFolders': this.$t('Team Folders'),
}[this.$route.name]
}
}
Vue.prototype.$goToFileView = function (id) { Vue.prototype.$goToFileView = function (id) {
let locations = { let locations = {
+1 -1
View File
@@ -170,7 +170,7 @@ const mutations = {
}, },
INCREASE_FOLDER_ITEM(state, id) { INCREASE_FOLDER_ITEM(state, id) {
state.entries.map(el => { state.entries.map(el => {
if (el.data.id && el.data.id === id) el.items++ if (el.data.id && el.data.id === id) el.data.attributes.items++
}) })
}, },
REMOVE_ITEM_FROM_CLIPBOARD(state, item) { REMOVE_ITEM_FROM_CLIPBOARD(state, item) {
+1 -1
View File
@@ -73,7 +73,7 @@ const actions = {
.then(() => { .then(() => {
itemsToMove.forEach(item => { itemsToMove.forEach(item => {
commit('REMOVE_ITEM', item.id) commit('REMOVE_ITEM', item.id)
commit('INCREASE_FOLDER_ITEM', to_item.id) commit('INCREASE_FOLDER_ITEM', to_item.data.id)
if (item.type === 'folder') if (item.type === 'folder')
dispatch('getAppData') dispatch('getAppData')
@@ -1,4 +1,5 @@
<?php <?php
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Users\Models\User; use App\Users\Models\User;
@@ -37,7 +38,8 @@ class SetupDevEnvironment extends Command
private SeedDefaultSettingsAction $seedDefaultSettings, private SeedDefaultSettingsAction $seedDefaultSettings,
private SeedDefaultLanguageAction $seedDefaultLanguage, private SeedDefaultLanguageAction $seedDefaultLanguage,
private SeedDefaultPagesAction $seedDefaultPages, private SeedDefaultPagesAction $seedDefaultPages,
) { )
{
parent::__construct(); parent::__construct();
$this->setUpFaker(); $this->setUpFaker();
} }
@@ -729,6 +731,20 @@ class SetupDevEnvironment extends Command
'name' => 'Company Project', 'name' => 'Company Project',
]); ]);
Folder::factory()
->create([
'user_id' => $user->id,
'parent_id' => $companyProjectFolder->id,
'name' => 'Presentation Materials',
]);
Folder::factory()
->create([
'user_id' => $user->id,
'parent_id' => $companyProjectFolder->id,
'name' => 'Team Gallery',
]);
$financeDocumentsFolder = Folder::factory() $financeDocumentsFolder = Folder::factory()
->create([ ->create([
'user_id' => $user->id, 'user_id' => $user->id,
@@ -742,34 +758,34 @@ class SetupDevEnvironment extends Command
collect([$members[0]->id, $members[1]->id]) collect([$members[0]->id, $members[1]->id])
->each( ->each(
fn ($id) => DB::table('team_folder_members') fn($id) => DB::table('team_folder_members')
->insert([ ->insert([
'folder_id' => $companyProjectFolder->id, 'folder_id' => $companyProjectFolder->id,
'user_id' => $id, 'user_id' => $id,
'permission' => 'can-edit', 'permission' => 'can-edit',
]) ])
); );
collect([$members[2]->id, $members[3]->id]) collect([$members[2]->id, $members[3]->id])
->each( ->each(
fn ($id) => DB::table('team_folder_members') fn($id) => DB::table('team_folder_members')
->insert([ ->insert([
'folder_id' => $financeDocumentsFolder->id, 'folder_id' => $financeDocumentsFolder->id,
'user_id' => $id, 'user_id' => $id,
'permission' => 'can-edit', 'permission' => 'can-edit',
]) ])
); );
// Create invitations // Create invitations
collect([$members[4], $members[5]]) collect([$members[4], $members[5]])
->each( ->each(
fn ($user) => TeamFolderInvitation::factory() fn($user) => TeamFolderInvitation::factory()
->create([ ->create([
'email' => $user->email, 'email' => $user->email,
'folder_id' => $companyProjectFolder->id, 'folder_id' => $companyProjectFolder->id,
'status' => 'pending', 'status' => 'pending',
'permission' => 'can-edit', 'permission' => 'can-edit',
]) ])
); );
} }