UI improvements

This commit is contained in:
Čarodej
2022-02-03 11:58:52 +01:00
parent bb9280d050
commit 78f69ca816
11 changed files with 27 additions and 28 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ import CookieDisclaimer from './components/Others/CookieDisclaimer'
import Spinner from './components/FilesView/Spinner' import Spinner from './components/FilesView/Spinner'
import Vignette from './components/Others/Vignette' import Vignette from './components/Others/Vignette'
import Alert from './components/FilesView/Alert' import Alert from './components/FilesView/Alert'
import RestrictionWarningBar from './RestrictionWarningBar' import RestrictionWarningBar from './components/Subscription/RestrictionWarningBar'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { events } from './bus' import { events } from './bus'
@@ -34,17 +34,9 @@
<!--Location--> <!--Location-->
<ListInfoItem v-if="$checkPermission(['master'])" :title="$t('file_detail.where')"> <ListInfoItem v-if="$checkPermission(['master'])" :title="$t('file_detail.where')">
<div @click="$moveFileOrFolder(singleFile)" class="flex cursor-pointer items-center"> <div @click="$moveFileOrFolder(singleFile)" class="flex cursor-pointer items-center">
<span class="inline-block text-sm font-bold"> <b class="inline-block text-sm font-bold">
{{ singleFile.data.relationships.parent ? singleFile.data.relationships.parent.data.attributes.name : $t('locations.home') }} {{ singleFile.data.relationships.parent ? singleFile.data.relationships.parent.data.attributes.name : $getCurrentLocationName() }}
</span> </b>
<Edit2Icon size="10" class="ml-2" />
</div>
</ListInfoItem>
<!--Team-->
<ListInfoItem v-if="singleFile.data.attributes.isTeamFolder" :title="$t('Shared with the Team')">
<div class="flex cursor-pointer items-center z-0 relative" @click="$updateTeamFolder(singleFile)">
<TeamMembersPreview :folder="singleFile" :avatar-size="32" />
<Edit2Icon size="10" class="ml-2" /> <Edit2Icon size="10" class="ml-2" />
</div> </div>
</ListInfoItem> </ListInfoItem>
@@ -179,12 +179,14 @@ export default {
this.itemName = this.entry.data.attributes.name this.itemName = this.entry.data.attributes.name
// Change item name // Change item name
events.$on('change:name', (item) => { events.$on('change:name', item => {
if (this.entry.data.id === item.id) this.itemName = item.name if (this.entry.data.id === item.id) {
this.itemName = item.name
}
}) })
// Autofocus after newly created folder // Autofocus after newly created folder
events.$on('newFolder:focus', (id) => { events.$on('newFolder:focus', id => {
if (!this.$isMobile() && this.entry.data.id === id) { if (!this.$isMobile() && this.entry.data.id === id) {
this.$refs.name.focus() this.$refs.name.focus()
document.execCommand('selectAll') document.execCommand('selectAll')
+1 -1
View File
@@ -1,6 +1,6 @@
<template> <template>
<li <li
class="flex items-center justify-between py-4 px-5 lg:py-2.5 xl:py-3 2xl:py-4" class="flex items-center justify-between py-4 px-5 lg:py-3 2xl:py-4"
:class="{ :class="{
'group cursor-pointer hover:bg-light-background dark:hover:bg-4x-dark-foreground': !isHoverDisabled, 'group cursor-pointer hover:bg-light-background dark:hover:bg-4x-dark-foreground': !isHoverDisabled,
}" }"
@@ -8,7 +8,7 @@
<file-icon v-if="icon === 'file'" class="text-theme vue-feather" size="19" /> <file-icon v-if="icon === 'file'" class="text-theme vue-feather" size="19" />
</div> </div>
<div> <div>
<b class="inline-block w-52 overflow-hidden text-ellipsis whitespace-nowrap text-base font-bold leading-3 2xl:w-72"> <b class="inline-block w-52 overflow-hidden text-ellipsis whitespace-nowrap text-base font-bold 2xl:w-72">
{{ title }} {{ title }}
</b> </b>
<small class="block text-xs font-bold text-gray-400"> <small class="block text-xs font-bold text-gray-400">
+2 -2
View File
@@ -32,7 +32,7 @@
<!--Item label--> <!--Item label-->
<b <b
@click="getFolder" @click="getFolder"
class="ml-3 inline-block overflow-x-hidden text-ellipsis whitespace-nowrap text-sm font-bold transition-all duration-150" class="ml-3 inline-block overflow-x-hidden text-ellipsis whitespace-nowrap text-xs font-bold transition-all duration-150"
:class="{ 'text-theme': isSelectedItem }" :class="{ 'text-theme': isSelectedItem }"
> >
{{ nodes.name }} {{ nodes.name }}
@@ -59,7 +59,7 @@ export default {
UserPlusIcon, UserPlusIcon,
FolderIcon, FolderIcon,
UsersIcon, UsersIcon,
'tree-node': () => import('./TreeMenuNavigator'), 'tree-node': () => import('./TreeMenu'),
}, },
computed: { computed: {
...mapGetters(['clipboard']), ...mapGetters(['clipboard']),
+6 -6
View File
@@ -143,12 +143,12 @@ const mutations = {
if (item.data.id === id) item.data.relationships.shared = undefined if (item.data.id === id) item.data.relationships.shared = undefined
}) })
}, },
CHANGE_ITEM_NAME(state, updatedFile) { CHANGE_ITEM_NAME(state, file) {
state.entries.find((item) => { state.entries.find(item => {
if (item.data.id === updatedFile.data.id) { if (item.data.id === file.data.id) {
item.data.attributes.name = updatedFile.data.attributes.name item.data.attributes.name = file.data.attributes.name
item.data.attributes.color = updatedFile.data.attributes.color ? updatedFile.data.attributes.color : null item.data.attributes.color = file.data.attributes.color ? file.data.attributes.color : null
item.data.attributes.emoji = updatedFile.data.attributes.emoji ? updatedFile.data.attributes.emoji : null item.data.attributes.emoji = file.data.attributes.emoji ? file.data.attributes.emoji : null
} }
}) })
}, },
@@ -57,7 +57,7 @@
<Option @click.native="$deleteFileOrFolder(item)" :title="$t('context_menu.delete')" icon="trash" /> <Option @click.native="$deleteFileOrFolder(item)" :title="$t('context_menu.delete')" icon="trash" />
</OptionGroup> </OptionGroup>
<OptionGroup> <OptionGroup>
<Option @click.native="$shareFileOrFolder(item)" :title="item && item.shared ? $t('context_menu.share_edit') : $t('context_menu.share')" icon="share" /> <Option @click.native="$shareFileOrFolder(item)" :title="item && item.data.relationships.shared ? $t('context_menu.share_edit') : $t('context_menu.share')" icon="share" />
</OptionGroup> </OptionGroup>
<OptionGroup> <OptionGroup>
<Option @click.native="$downloadSelection(item)" :title="$t('context_menu.download')" icon="download" /> <Option @click.native="$downloadSelection(item)" :title="$t('context_menu.download')" icon="download" />
@@ -36,7 +36,7 @@
<Option @click.native="$renameFileOrFolder(item)" :title="$t('context_menu.rename')" icon="rename" /> <Option @click.native="$renameFileOrFolder(item)" :title="$t('context_menu.rename')" icon="rename" />
<Option @click.native="$moveFileOrFolder(item)" :title="$t('context_menu.move')" icon="move-item" /> <Option @click.native="$moveFileOrFolder(item)" :title="$t('context_menu.move')" icon="move-item" />
<Option @click.native="$deleteFileOrFolder(item)" :title="$t('context_menu.delete')" icon="trash" /> <Option @click.native="$deleteFileOrFolder(item)" :title="$t('context_menu.delete')" icon="trash" />
<Option @click.native="$shareFileOrFolder(item)" :title="item && item.shared ? $t('context_menu.share_edit') : $t('context_menu.share')" icon="share" /> <Option @click.native="$shareFileOrFolder(item)" :title="item && item.data.relationships.shared ? $t('context_menu.share_edit') : $t('context_menu.share')" icon="share" />
</OptionGroup> </OptionGroup>
<OptionGroup> <OptionGroup>
<Option @click.native="$downloadSelection(item)" :title="$t('context_menu.download')" icon="download" /> <Option @click.native="$downloadSelection(item)" :title="$t('context_menu.download')" icon="download" />
@@ -7,6 +7,7 @@ use Domain\Folders\Resources\FolderResource;
use Domain\Items\Requests\RenameItemRequest; use Domain\Items\Requests\RenameItemRequest;
use Domain\Items\Actions\RenameFileOrFolderAction; use Domain\Items\Actions\RenameFileOrFolderAction;
use Domain\Folders\Actions\UpdateFolderPropertyAction; use Domain\Folders\Actions\UpdateFolderPropertyAction;
use Illuminate\Auth\Access\AuthorizationException;
use Support\Demo\Actions\FakeRenameFileOrFolderAction; use Support\Demo\Actions\FakeRenameFileOrFolderAction;
class RenameFileOrFolderController extends Controller class RenameFileOrFolderController extends Controller
@@ -20,6 +21,8 @@ class RenameFileOrFolderController extends Controller
/** /**
* Rename item for authenticated master|editor user * Rename item for authenticated master|editor user
*
* @throws AuthorizationException
*/ */
public function __invoke( public function __invoke(
RenameItemRequest $request, RenameItemRequest $request,
@@ -30,13 +33,15 @@ class RenameFileOrFolderController extends Controller
} }
// If request contain icon or color, then change it // If request contain icon or color, then change it
if ($request->has('emoji') || $request->has('color')) { if ($request->input('type') === 'folder' && $request->hasAny(['emoji', 'color'])) {
($this->updateFolderProperty)($request, $id); ($this->updateFolderProperty)($request, $id);
} }
// Rename item
$item = ($this->renameFileOrFolder)($request, $id); $item = ($this->renameFileOrFolder)($request, $id);
if ($request->input('type') === 'folder') { if ($request->input('type') === 'folder') {
return new FolderResource($item); return new FolderResource($item);
} }