Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

chore(frontend): adjust sidebar and user profile layout and other minor fixes

johavenc7d1054721d0
diff --git a/frontend/src/app/applications/files/services/files-tasks.service.ts b/frontend/src/app/applications/files/services/files-tasks.service.ts
index d83d134a..c703e7f2 100644
--- a/frontend/src/app/applications/files/services/files-tasks.service.ts
+++ b/frontend/src/app/applications/files/services/files-tasks.service.ts
@@ -132,7 +132,7 @@ export class FilesTasksService {
private stopWatch() {
if (this.watcher || !this.watcher.closed) {
- setTimeout(() => this.layout.hideRSideBarTab(TAB_MENU.TASKS), 3000)
+ this.layout.hideRSideBarTab(TAB_MENU.TASKS, 3000)
this.watcher.unsubscribe()
}
}
diff --git a/frontend/src/app/applications/links/components/dialogs/link-dialog.component.ts b/frontend/src/app/applications/links/components/dialogs/link-dialog.component.ts
index d409581c..4e5cea15 100644
--- a/frontend/src/app/applications/links/components/dialogs/link-dialog.component.ts
+++ b/frontend/src/app/applications/links/components/dialogs/link-dialog.component.ts
@@ -31,7 +31,7 @@ import { originalOrderKeyValue } from '../../../../common/utils/functions'
import { LayoutService } from '../../../../layout/layout.service'
import { FileModel } from '../../../files/models/file.model'
import { ShareRepositoryComponent } from '../../../shares/components/utils/share-repository.component'
-import { ShareModel } from '../../../shares/models/share.model'
+import type { ShareModel } from '../../../shares/models/share.model'
import { SharesService } from '../../../shares/services/shares.service'
import { SpacesService } from '../../../spaces/services/spaces.service'
import { SPACES_ICON, SPACES_PERMISSIONS_TEXT } from '../../../spaces/spaces.constants'
@@ -39,7 +39,7 @@ import { setAllowedBooleanPermissions, setStringPermission } from '../../../spac
import { MemberModel } from '../../../users/models/member.model'
import { USER_PASSWORD_CHANGE_TEXT } from '../../../users/user.constants'
import { UserService } from '../../../users/user.service'
-import { ShareLinkModel } from '../../models/share-link.model'
+import type { ShareLinkModel } from '../../models/share-link.model'
import { LinksService } from '../../services/links.service'
@Component({
diff --git a/frontend/src/app/applications/links/services/links.service.ts b/frontend/src/app/applications/links/services/links.service.ts
index c2e810e7..9fff5ca5 100644
--- a/frontend/src/app/applications/links/services/links.service.ts
+++ b/frontend/src/app/applications/links/services/links.service.ts
@@ -33,8 +33,8 @@ import { take } from 'rxjs/operators'
import { AuthService } from '../../../auth/auth.service'
import { downloadWithAnchor } from '../../../common/utils/functions'
import { LayoutService } from '../../../layout/layout.service'
-import { ShareModel } from '../../shares/models/share.model'
-import { SpaceModel } from '../../spaces/models/space.model'
+import type { ShareModel } from '../../shares/models/share.model'
+import type { SpaceModel } from '../../spaces/models/space.model'
import { SPACES_PATH } from '../../spaces/spaces.constants'
import { MemberModel } from '../../users/models/member.model'
import { LinkDialogComponent } from '../components/dialogs/link-dialog.component'
diff --git a/frontend/src/app/applications/shares/models/share-child.model.ts b/frontend/src/app/applications/shares/models/share-child.model.ts
index a959141f..84832d2e 100644
--- a/frontend/src/app/applications/shares/models/share-child.model.ts
+++ b/frontend/src/app/applications/shares/models/share-child.model.ts
@@ -7,7 +7,7 @@
import { SHARE_TYPE } from '@sync-in-server/backend/src/applications/shares/constants/shares'
import type { ShareChild } from '@sync-in-server/backend/src/applications/shares/models/share-child.model'
import { defaultMimeUrl, getAssetsMimeUrl, mimeDirectory, mimeDirectoryShare } from '../../files/files.constants'
-import { OwnerType } from '../../users/interfaces/owner.interface'
+import type { OwnerType } from '../../users/interfaces/owner.interface'
import { userAvatarUrl } from '../../users/user.functions'
export class ShareChildModel implements ShareChild {
diff --git a/frontend/src/app/applications/shares/shares.functions.ts b/frontend/src/app/applications/shares/shares.functions.ts
index 99852a08..c97f6262 100644
--- a/frontend/src/app/applications/shares/shares.functions.ts
+++ b/frontend/src/app/applications/shares/shares.functions.ts
@@ -5,10 +5,10 @@
*/
import { getAssetsMimeUrl, mimeDirectory, mimeDirectoryShare } from '../files/files.constants'
-import { ShareLinkModel } from '../links/models/share-link.model'
+import type { ShareLinkModel } from '../links/models/share-link.model'
import { SPACES_PATH } from '../spaces/spaces.constants'
-import { ShareFileModel } from './models/share-file.model'
-import { ShareModel } from './models/share.model'
+import type { ShareFileModel } from './models/share-file.model'
+import type { ShareModel } from './models/share.model'
export function setMimeUrl(share: ShareModel | ShareFileModel | ShareLinkModel | any) {
if (!share.file?.id) {
diff --git a/frontend/src/app/applications/users/components/sidebar/user-profile.component.html b/frontend/src/app/applications/users/components/sidebar/user-profile.component.html
index 82322071..b9cd6aee 100755
--- a/frontend/src/app/applications/users/components/sidebar/user-profile.component.html
+++ b/frontend/src/app/applications/users/components/sidebar/user-profile.component.html
@@ -5,7 +5,7 @@
-->
<!-- The user image in the menu -->
-<div class="d-flex flex-column 100vh">
+<div class="d-flex flex-column">
<div class="sidebar-component-title">
<div class="d-flex flex-fill justify-content-between">
@if (!user?.isLink) {
@@ -28,43 +28,46 @@
}
</div>
</div>
- <div class="user-header">
- <div class="d-flex flex-column justify-content-center me-2">
- <div class="avatar-lg">
- <img class="avatar-img" [src]="userAvatar" alt="">
- <span class="avatar-{{allOnlineStatus[user?.onlineStatus]}}"></span>
+ <div appAutoResize [useMaxHeight]="false" class="d-flex flex-column">
+ <div class="user-header py-3">
+ <div class="d-flex flex-column justify-content-center me-2">
+ <div class="avatar-lg">
+ <img class="avatar-img" [src]="userAvatar" alt="">
+ <span class="avatar-{{allOnlineStatus[user?.onlineStatus]}}"></span>
+ </div>
</div>
- </div>
- <div class="user-details">
- @if (user?.isLink) {
- <div l10nTranslate>Guest Link</div>
- } @else {
- <div>{{ user?.fullName }}</div>
- <div class="small">{{ user?.email }}</div>
- }
- <select [ngModel]="user?.onlineStatus"
- (ngModelChange)="setOnlineStatus($event)"
- class="form-select form-select-sm mt-1">
- @for (s of allOnlineStatus; track $index) {
- <option [ngValue]="allOnlineStatus.indexOf(s)">{{ s | translate:locale.language | capitalize }}</option>
+ <div class="user-details">
+ @if (user?.isLink) {
+ <div l10nTranslate>Guest Link</div>
+ } @else {
+ <div>{{ user?.fullName }}</div>
+ <div class="small">{{ user?.email }}</div>
}
- </select>
- </div>
- </div>
- <div class="d-none d-md-block hide-on-small-height position-absolute w-100 fs-xs" style="bottom: 46px">
- <hr />
- <div class="d-flex flex-column mx-3">
- <div class="mb-1">
- <img alt="" height="30" [src]="this.layout.switchTheme.getValue() === themeLight ? logoUrl: logoDarkUrl">
+ <select [ngModel]="user?.onlineStatus"
+ (ngModelChange)="setOnlineStatus($event)"
+ class="form-select form-select-sm mt-1">
+ @for (s of allOnlineStatus; track $index) {
+ <option [ngValue]="allOnlineStatus.indexOf(s)">{{ s | translate:locale.language | capitalize }}</option>
+ }
+ </select>
</div>
- <div>
- <a class="link-primary cursor-pointer" (click)="openLink('website')" l10nTranslate>Website</a>
- <span>&nbsp;|&nbsp;</span>
- <a class="link-primary cursor-pointer" (click)="openLink('docs')" l10nTranslate>Documentation</a>
- <span>&nbsp;|&nbsp;</span>
- <a class="link-primary cursor-pointer" (click)="openLink('versions')" l10nTranslate>Versions</a>
- <span>&nbsp;|&nbsp;</span>
- <a class="link-primary cursor-pointer" (click)="openLink('support')"> 💛</a>
+ </div>
+ <hr class="my-0 w-100" />
+ <div class="mt-auto">
+ <hr class="my-0 w-100" />
+ <div class="profile-sync-in-footer">
+ <div class="mb-1">
+ <img alt="" height="30" [src]="this.layout.switchTheme.getValue() === themeLight ? logoUrl: logoDarkUrl">
+ </div>
+ <div>
+ <a class="link-primary cursor-pointer" (click)="openLink('website')" l10nTranslate>Website</a>
+ <span>&nbsp;|&nbsp;</span>
+ <a class="link-primary cursor-pointer" (click)="openLink('docs')" l10nTranslate>Documentation</a>
+ <span>&nbsp;|&nbsp;</span>
+ <a class="link-primary cursor-pointer" (click)="openLink('versions')" l10nTranslate>Versions</a>
+ <span>&nbsp;|&nbsp;</span>
+ <a class="link-primary cursor-pointer" (click)="openLink('support')"> 💛</a>
+ </div>
</div>
</div>
</div>
diff --git a/frontend/src/app/applications/users/components/sidebar/user-profile.component.ts b/frontend/src/app/applications/users/components/sidebar/user-profile.component.ts
index aee2b271..318e76d8 100644
--- a/frontend/src/app/applications/users/components/sidebar/user-profile.component.ts
+++ b/frontend/src/app/applications/users/components/sidebar/user-profile.component.ts
@@ -13,6 +13,7 @@ import { APP_URL } from '@sync-in-server/backend/src/common/shared'
import { L10N_LOCALE, L10nLocale, L10nTranslateDirective, L10nTranslatePipe } from 'angular-l10n'
import { Subscription } from 'rxjs'
import { AuthService } from '../../../../auth/auth.service'
+import { AutoResizeDirective } from '../../../../common/directives/auto-resize.directive'
import { CapitalizePipe } from '../../../../common/pipes/capitalize.pipe'
import { themeLight } from '../../../../layout/layout.interfaces'
import { LayoutService } from '../../../../layout/layout.service'
@@ -25,14 +26,7 @@ import { UserService } from '../../user.service'
@Component({
selector: 'app-user-profile',
templateUrl: 'user-profile.component.html',
- styles: `
- @media (max-height: 300px) {
- .hide-on-small-height {
- display: none !important;
- }
- }
- `,
- imports: [FormsModule, RouterLink, CapitalizePipe, FaIconComponent, L10nTranslateDirective, L10nTranslatePipe]
+ imports: [FormsModule, RouterLink, CapitalizePipe, FaIconComponent, L10nTranslateDirective, L10nTranslatePipe, AutoResizeDirective]
})
export class UserProfileComponent implements OnDestroy {
protected readonly logoDarkUrl = logoDarkUrl
diff --git a/frontend/src/app/layout/layout.service.ts b/frontend/src/app/layout/layout.service.ts
index 3797adbd..e3ab51e4 100644
--- a/frontend/src/app/layout/layout.service.ts
+++ b/frontend/src/app/layout/layout.service.ts
@@ -102,14 +102,16 @@ export class LayoutService {
this.rightSideBarOpenAndShowTab.next(tabName)
}
if (delay > 0) {
- setTimeout(() => this.hideRSideBarTab(tabName), delay)
+ this.hideRSideBarTab(tabName, delay)
}
}
- hideRSideBarTab(tabName: string) {
- if (this.currentRightSideBarTab === tabName) {
- this.toggleRSideBar(false)
- }
+ hideRSideBarTab(tabName: string, delay: number = 0) {
+ setTimeout(() => {
+ if (this.currentRightSideBarTab === tabName) {
+ this.toggleRSideBar(false)
+ }
+ }, delay)
}
toggleRSideBar(show: boolean) {
diff --git a/frontend/src/app/layout/sidebar/components/windows.component.ts b/frontend/src/app/layout/sidebar/components/windows.component.ts
index e82777a0..f47df8a6 100755
--- a/frontend/src/app/layout/sidebar/components/windows.component.ts
+++ b/frontend/src/app/layout/sidebar/components/windows.component.ts
@@ -44,9 +44,7 @@ export class WindowsComponent implements OnDestroy {
if (modal) {
modal.content.onClose()
}
- if (!this.layout.windows.getValue().length) {
- this.layout.toggleRSideBar(false)
- }
+ this.hideIfNoWindows(this.layout.windows.getValue())
}
onCloseAll() {
@@ -56,15 +54,17 @@ export class WindowsComponent implements OnDestroy {
modal.content.onClose()
}
}
- if (!this.layout.windows.getValue().length) {
- this.layout.toggleRSideBar(false)
- }
+ this.hideIfNoWindows(this.layout.windows.getValue())
}
private setWindows(windows: AppWindow[]) {
+ this.hideIfNoWindows(windows)
+ this.windows = windows
+ }
+
+ private hideIfNoWindows(windows: AppWindow[]) {
if (!windows.length) {
- this.layout.hideRSideBarTab(TAB_MENU.WINDOWS)
+ this.layout.hideRSideBarTab(TAB_MENU.WINDOWS, 1000)
}
- this.windows = windows
}
}
diff --git a/frontend/src/app/layout/sidebar/sidebar.left.component.html b/frontend/src/app/layout/sidebar/sidebar.left.component.html
index 26e4fa34..0bd58c54 100644
--- a/frontend/src/app/layout/sidebar/sidebar.left.component.html
+++ b/frontend/src/app/layout/sidebar/sidebar.left.component.html
@@ -36,20 +36,22 @@
<fa-icon (click)="navigateTo('next')" [icon]="icons.faAngleRight" class="sidebar-btn" role="button"></fa-icon>
</a>
</div>
- <div class="menus-group">
- @for (menu of currentMenu.submenus; track menu.title) {
- @if (!menu.hide) {
- <ng-container [ngTemplateOutlet]="MenuApps" [ngTemplateOutletContext]="{menu: menu}"></ng-container>
+ <div class="menus-content">
+ <div class="menus-group">
+ @for (menu of currentMenu.submenus; track menu.title) {
+ @if (!menu.hide) {
+ <ng-container [ngTemplateOutlet]="MenuApps" [ngTemplateOutletContext]="{menu: menu}"></ng-container>
+ }
}
- }
- @if (leftSideBarIsOpen && currentMenu.component) {
- <div (click)="checkComponentRoute()" appAutoResize [resizeOffset]="40">
- <ng-container *ngComponentOutlet="currentMenu.component"></ng-container>
- </div>
- }
- </div>
- <div class="sidebar-apps-footer">
- <span>{{ appVersion }}</span>
+ @if (leftSideBarIsOpen && currentMenu.component) {
+ <div (click)="checkComponentRoute()" appAutoResize [resizeOffset]="40">
+ <ng-container *ngComponentOutlet="currentMenu.component"></ng-container>
+ </div>
+ }
+ </div>
+ <div class="sidebar-apps-footer">
+ <span>{{ appVersion }}</span>
+ </div>
</div>
</div>
</aside>
diff --git a/frontend/src/styles/components/_profile.scss b/frontend/src/styles/components/_profile.scss
index 9770385f..e5cef7b0 100644
--- a/frontend/src/styles/components/_profile.scss
+++ b/frontend/src/styles/components/_profile.scss
@@ -21,7 +21,7 @@
.user-header {
display: flex;
justify-content: space-between;
- padding: 0 .8rem .8rem .8rem;
+ padding: 0 .8rem .8rem .8rem;
text-align: end;
.user-details {
@@ -54,6 +54,14 @@
}
}
+.profile-sync-in-footer {
+ display: flex;
+ flex-direction: column;
+ margin: 0.4rem 0.6rem 0.2rem;
+ flex: 1 1 auto !important;
+ font-size: $font-size-xs;
+}
+
.profile-user-img {
margin: 0 auto;
width: 100px;
diff --git a/frontend/src/styles/components/_sidebar_left.scss b/frontend/src/styles/components/_sidebar_left.scss
index f45956cd..28e42bb6 100755
--- a/frontend/src/styles/components/_sidebar_left.scss
+++ b/frontend/src/styles/components/_sidebar_left.scss
@@ -188,6 +188,12 @@
}
}
+ .menus-content {
+ display: flex;
+ flex-direction: column;
+ flex: 1 1 auto;
+ }
+
.menus-group {
overflow-y: auto;
overflow-x: hidden;
diff --git a/frontend/src/styles/components/_sidebar_right.scss b/frontend/src/styles/components/_sidebar_right.scss
index f2f7be8b..fef867d8 100755
--- a/frontend/src/styles/components/_sidebar_right.scss
+++ b/frontend/src/styles/components/_sidebar_right.scss
@@ -23,10 +23,6 @@
@include media-breakpoint-down(sm) {
right: -$control-sidebar-small-width;
width: $control-sidebar-small-width;
-
- &.control-sidebar-open {
- border-left: none !important;
- }
}
.sidebar-title, .sidebar-component-title {
diff --git a/frontend/src/styles/components/_theme_dark.scss b/frontend/src/styles/components/_theme_dark.scss
index 1167ffb2..f87fd92f 100755
--- a/frontend/src/styles/components/_theme_dark.scss
+++ b/frontend/src/styles/components/_theme_dark.scss
@@ -56,10 +56,13 @@
background-color: darken($sidebar-dark-mini-menu-bg, 5%);
}
}
-
}
.sidebar-apps-menus {
+ .menus-content {
+ border-right: .5px solid $sidebar-dark-icons-menu-border-color;
+ }
+
.menu {
border-bottom: .5px solid $sidebar-dark-apps-menu-bg;
@@ -404,9 +407,9 @@
color: $gray-light;
}
- .content-container {
- border-left: .5px solid $sidebar-dark-icons-menu-border-color;
- }
+ //.content-container {
+ // border-left: .5px solid $sidebar-dark-icons-menu-border-color;
+ //}
.ngx-contextmenu {
background-color: $sidebar-dark-icons-menu-border-color !important;
diff --git a/frontend/src/styles/components/_theme_light.scss b/frontend/src/styles/components/_theme_light.scss
index 08336851..ac4ea6e4 100755
--- a/frontend/src/styles/components/_theme_light.scss
+++ b/frontend/src/styles/components/_theme_light.scss
@@ -67,6 +67,10 @@
}
.sidebar-apps-menus {
+ .menus-content {
+ border-right: .5px solid $sidebar-light-apps-menu-border-color;
+ }
+
.menu {
border-bottom: .5px solid $sidebar-light-apps-menu-bg;
@@ -420,9 +424,9 @@
color: $body-color;
}
- .content-container {
- border-left: .5px solid $sidebar-light-apps-menu-border-color;
- }
+ //.content-container {
+ // border-left: .5px solid $sidebar-light-apps-menu-border-color;
+ //}
.ngx-contextmenu {
background-color: $gray-light !important;