Merged network view with chat sidenav and updated the look of the category/channel list to a threaded one
This commit is contained in:
@@ -24,6 +24,11 @@
|
|||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "public"
|
"input": "public"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"glob": "**/*",
|
||||||
|
"input": "node_modules/@taiga-ui/icons/src",
|
||||||
|
"output": "assets/taiga-ui/icons"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"glob": "**/*",
|
"glob": "**/*",
|
||||||
"input": "node_modules/@taiga-ui/icons/src",
|
"input": "node_modules/@taiga-ui/icons/src",
|
||||||
|
|||||||
3305
package-lock.json
generated
3305
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -25,15 +25,17 @@
|
|||||||
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
"@fortawesome/free-solid-svg-icons": "^7.1.0",
|
||||||
"@ngx-translate/core": "^17.0.0",
|
"@ngx-translate/core": "^17.0.0",
|
||||||
"@ngx-translate/http-loader": "^17.0.0",
|
"@ngx-translate/http-loader": "^17.0.0",
|
||||||
"@taiga-ui/addon-charts": "^5.1.0",
|
"@taiga-ui/addon-charts": "^5.25.0",
|
||||||
"@taiga-ui/addon-mobile": "^5.1.0",
|
"@taiga-ui/addon-commerce": "^5.25.0",
|
||||||
"@taiga-ui/addon-table": "^5.1.0",
|
"@taiga-ui/addon-doc": "^5.25.0",
|
||||||
"@taiga-ui/cdk": "^5.1.0",
|
"@taiga-ui/addon-mobile": "^5.25.0",
|
||||||
"@taiga-ui/core": "^5.1.0",
|
"@taiga-ui/addon-table": "^5.25.0",
|
||||||
|
"@taiga-ui/cdk": "^5.25.0",
|
||||||
|
"@taiga-ui/core": "^5.25.0",
|
||||||
"@taiga-ui/i18n": "^5.2.0",
|
"@taiga-ui/i18n": "^5.2.0",
|
||||||
"@taiga-ui/icons": "^5.1.0",
|
"@taiga-ui/icons": "^5.25.0",
|
||||||
"@taiga-ui/kit": "^5.1.0",
|
"@taiga-ui/kit": "^5.25.0",
|
||||||
"@taiga-ui/layout": "^5.1.0",
|
"@taiga-ui/layout": "^5.25.0",
|
||||||
"libphonenumber-js": "^1.12.41",
|
"libphonenumber-js": "^1.12.41",
|
||||||
"ngx-cookie-service": "^21.3.1",
|
"ngx-cookie-service": "^21.3.1",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "Chatenium Nexum 3.0 Beta 10 (April 27, 2026)",
|
"version": "Chatenium Nexum 3.0 Beta 11 (October 4, 2026)",
|
||||||
"ok": "Ok",
|
"ok": "Ok",
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
"aChatProgram": "A messaging platform that you can trust.",
|
"aChatProgram": "A messaging platform that you can trust.",
|
||||||
@@ -218,7 +218,8 @@
|
|||||||
"changeLogDialog": {
|
"changeLogDialog": {
|
||||||
"label": "Chatenium has been updated",
|
"label": "Chatenium has been updated",
|
||||||
"changeLog": {
|
"changeLog": {
|
||||||
"1": "Fixed scrolling issues when sending or receiving new messages."
|
"1": "The network UI have been merged with the left side navigation panel.",
|
||||||
|
"2": "Categories and channels now have a threaded UI to align with recent changes"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"chatnav": {
|
"chatnav": {
|
||||||
|
|||||||
@@ -12,26 +12,28 @@ import {defer} from 'rxjs';
|
|||||||
export const appConfig: ApplicationConfig = {
|
export const appConfig: ApplicationConfig = {
|
||||||
providers: [
|
providers: [
|
||||||
provideBrowserGlobalErrorListeners(),
|
provideBrowserGlobalErrorListeners(),
|
||||||
provideRouter(routes, withRouterConfig({
|
provideRouter(
|
||||||
paramsInheritanceStrategy: "always"
|
routes,
|
||||||
})),
|
withRouterConfig({
|
||||||
|
paramsInheritanceStrategy: 'always',
|
||||||
|
}),
|
||||||
|
),
|
||||||
provideTaiga(),
|
provideTaiga(),
|
||||||
provideTranslateService({
|
provideTranslateService({
|
||||||
fallbackLang: "en",
|
fallbackLang: 'en',
|
||||||
lang: "hu",
|
lang: 'hu',
|
||||||
loader: provideTranslateHttpLoader({
|
loader: provideTranslateHttpLoader({
|
||||||
prefix: "/i18n/",
|
prefix: '/i18n/',
|
||||||
suffix: ".json"
|
suffix: '.json',
|
||||||
})
|
}),
|
||||||
}),
|
}),
|
||||||
provideServiceWorker('ngsw-worker.js', {
|
provideServiceWorker('ngsw-worker.js', {
|
||||||
enabled: !isDevMode(),
|
enabled: !isDevMode(),
|
||||||
registrationStrategy: 'registerWhenStable:30000'
|
registrationStrategy: 'registerWhenStable:30000',
|
||||||
}),
|
}),
|
||||||
tuiInputPhoneInternationalOptionsProvider({
|
tuiInputPhoneInternationalOptionsProvider({
|
||||||
metadata: defer(async () =>
|
metadata: defer(async () => import('libphonenumber-js/max/metadata').then((m) => m.default)),
|
||||||
import('libphonenumber-js/max/metadata').then((m) => m.default),
|
|
||||||
),
|
|
||||||
}),
|
}),
|
||||||
|
provideTaiga(),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -17,14 +17,13 @@ export const routes: Routes = [
|
|||||||
{ path: 'tos', component: TOS },
|
{ path: 'tos', component: TOS },
|
||||||
{ path: 'signin', component: SignIn, canActivate: [noAuthGuard] },
|
{ path: 'signin', component: SignIn, canActivate: [noAuthGuard] },
|
||||||
{
|
{
|
||||||
path: 'chat', component: Chat, canActivate: [authNeededGuard], children: [
|
path: 'chat',
|
||||||
|
component: Chat,
|
||||||
|
canActivate: [authNeededGuard],
|
||||||
|
children: [
|
||||||
{ path: 'dm/:chatid', component: Dm },
|
{ path: 'dm/:chatid', component: Dm },
|
||||||
{ path: 'picture/:uploaderId', component: See },
|
{ path: 'picture/:uploaderId', component: See },
|
||||||
{
|
{ path: 'network/:networkId/:categoryId/:channelId', component: Text },
|
||||||
path: 'network/:networkId', component: Network, children: [
|
],
|
||||||
{path: ":categoryId/:channelId", component: Text}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ import {IndexedDB} from './storage/indexed-db';
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
imports: [RouterOutlet, TuiRoot],
|
imports: [RouterOutlet, TuiRoot, TuiRoot],
|
||||||
templateUrl: './app.html',
|
templateUrl: './app.html',
|
||||||
styleUrl: './app.scss',
|
styleUrl: './app.scss',
|
||||||
})
|
})
|
||||||
export class App implements OnInit {
|
export class App implements OnInit {
|
||||||
indexedDb = inject(IndexedDB)
|
indexedDb = inject(IndexedDB);
|
||||||
|
|
||||||
protected readonly title = signal('Chatenium-On-Web');
|
protected readonly title = signal('Chatenium-On-Web');
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<h3>{{ "version"|translate }}</h3>
|
<h3>{{ "version"|translate }}</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>{{ "chat.changeLogDialog.changeLog.1"|translate }}</li>
|
<li>{{ "chat.changeLogDialog.changeLog.1"|translate }}</li>
|
||||||
|
<li>{{ "chat.changeLogDialog.changeLog.2"|translate }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<button tuiButton iconStart="@tui.check"
|
<button tuiButton iconStart="@tui.check"
|
||||||
@@ -10,7 +11,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template [(tuiDialog)]="userSettingsOpen" [tuiDialogOptions]="{closable: false, appearance: 'taiga big'}" class="user-settings">
|
<ng-template [(tuiDialog)]="userSettingsOpen" [tuiDialogOptions]="{closable: false, appearance: 'taiga big'}"
|
||||||
|
class="user-settings">
|
||||||
<user-settings (close)="userSettingsOpen.set(false)" />
|
<user-settings (close)="userSettingsOpen.set(false)" />
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
@@ -20,22 +22,23 @@
|
|||||||
</main>
|
</main>
|
||||||
} @else {
|
} @else {
|
||||||
@if (breakpoint() != "mobile") {
|
@if (breakpoint() != "mobile") {
|
||||||
<main id="layout" tuiGroup [collapsed]="true">
|
<main id="layout" tuiGroup [collapsed]="true" [class.expanded]="expandedSidenav()">
|
||||||
<aside id="chatnav">
|
<aside id="chatnav">
|
||||||
<aside>
|
<aside>
|
||||||
<tui-segmented id="mode_switcher" [(activeItemIndex)]="navigationActiveIndex">
|
<tui-segmented id="mode_switcher" [(activeItemIndex)]="navigationActiveIndex">
|
||||||
<button>
|
<button (click)="expandedSidenav.set(false)">
|
||||||
<tui-icon icon="@tui.message-circle" />
|
<tui-icon icon="@tui.message-circle" />
|
||||||
</button>
|
</button>
|
||||||
<button>
|
<button>
|
||||||
<tui-icon icon="@tui.network" />
|
<tui-icon icon="@tui.network" />
|
||||||
</button>
|
</button>
|
||||||
<button>
|
<button (click)="expandedSidenav.set(false)">
|
||||||
<tui-icon icon="@tui.image" />
|
<tui-icon icon="@tui.image" />
|
||||||
</button>
|
</button>
|
||||||
</tui-segmented>
|
</tui-segmented>
|
||||||
|
|
||||||
<button id="bottom_btn" tuiButton [appearance]="userSettingsOpen() ? 'primary' : 'flat'" (click)="userSettingsOpen.set(true)">
|
<button id="bottom_btn" tuiButton [appearance]="userSettingsOpen() ? 'primary' : 'flat'"
|
||||||
|
(click)="userSettingsOpen.set(true)">
|
||||||
<tui-icon icon="@tui.cog" />
|
<tui-icon icon="@tui.cog" />
|
||||||
</button>
|
</button>
|
||||||
</aside>
|
</aside>
|
||||||
@@ -47,7 +50,9 @@
|
|||||||
[userid]="serviceManager.currentSession()!.userData.userid"></app-dm-list>
|
[userid]="serviceManager.currentSession()!.userData.userid"></app-dm-list>
|
||||||
}
|
}
|
||||||
@case (1) {
|
@case (1) {
|
||||||
<network-list [token]="serviceManager.currentSession()!.token"
|
<network-list
|
||||||
|
[(expandedSidenav)]="expandedSidenav"
|
||||||
|
[token]="serviceManager.currentSession()!.token"
|
||||||
[userid]="serviceManager.currentSession()!.userData.userid"></network-list>
|
[userid]="serviceManager.currentSession()!.userData.userid"></network-list>
|
||||||
}
|
}
|
||||||
@case (2) {
|
@case (2) {
|
||||||
@@ -86,7 +91,9 @@
|
|||||||
[userid]="serviceManager.currentSession()!.userData.userid"></app-dm-list>
|
[userid]="serviceManager.currentSession()!.userData.userid"></app-dm-list>
|
||||||
}
|
}
|
||||||
@case (1) {
|
@case (1) {
|
||||||
<network-list [token]="serviceManager.currentSession()!.token"
|
<network-list
|
||||||
|
[(expandedSidenav)]="expandedSidenav"
|
||||||
|
[token]="serviceManager.currentSession()!.token"
|
||||||
[userid]="serviceManager.currentSession()!.userData.userid"></network-list>
|
[userid]="serviceManager.currentSession()!.userData.userid"></network-list>
|
||||||
}
|
}
|
||||||
@case (2) {
|
@case (2) {
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
#layout {
|
#layout {
|
||||||
|
transition: 0.3s ease;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 350px minmax(0, 1fr);
|
grid-template-columns: 350px minmax(0, 1fr);
|
||||||
height: 100svh;
|
height: 100svh;
|
||||||
overflow: hidden;
|
|
||||||
|
&.expanded {
|
||||||
|
grid-template-columns: 450px minmax(0, 1fr) !important;
|
||||||
|
}
|
||||||
|
|
||||||
#chatnav {
|
#chatnav {
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -44,11 +48,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden;
|
||||||
background: var(--tui-background-base-alt);
|
background: var(--tui-background-base-alt);
|
||||||
border-radius: 20px 0 0 20px;
|
border-radius: 20px 0 0 20px;
|
||||||
margin: 10px 0 10px 10px;
|
margin: 10px 0 10px 10px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ export class Chat implements OnInit {
|
|||||||
breakpoint = inject(TUI_BREAKPOINT)
|
breakpoint = inject(TUI_BREAKPOINT)
|
||||||
router = inject(Router)
|
router = inject(Router)
|
||||||
|
|
||||||
|
expandedSidenav = signal(false)
|
||||||
|
|
||||||
routerOutletActive = signal(false)
|
routerOutletActive = signal(false)
|
||||||
userSettingsOpen = signal(false)
|
userSettingsOpen = signal(false)
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<div id="holder" [class.networkActive]="selectedNetwork() != null">
|
||||||
|
<div id="networks">
|
||||||
<button disabled tuiButton appearance="secondary" iconStart="@tui.plus">
|
<button disabled tuiButton appearance="secondary" iconStart="@tui.plus">
|
||||||
{{ "chat.chatnav.networkList.newNetwork"|translate }}
|
{{ "chat.chatnav.networkList.newNetwork"|translate }}
|
||||||
</button>
|
</button>
|
||||||
@@ -7,13 +9,27 @@
|
|||||||
{{"updating"|translate}}
|
{{"updating"|translate}}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@for (network of serviceManager.networks(); track network.networkId) {
|
@for (network of serviceManager.networks(); track network.networkId) {
|
||||||
<button [class.enlarge]="breakpoint() == 'mobile'" tuiButton
|
<button [class.enlarge]="breakpoint() == 'mobile'" tuiButton
|
||||||
[appearance]="router.url.startsWith('/chat/network/' + network.networkId) ? 'primary' : 'flat'"
|
appearance="flat"
|
||||||
[routerLink]="'/chat/network/' + network.networkId">
|
(click)="selectNetwork(network)">
|
||||||
<oimg [src]="network.picture" height="35px" width="35px" [radius]="10"></oimg>
|
<oimg [src]="network.picture" height="35px" width="35px" [radius]="10"></oimg>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<span>{{ network.name }}</span>
|
<span>{{ network.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="network">
|
||||||
|
<div style="display: flex; align-items: center; gap: 1rem;">
|
||||||
|
<button tuiButton appearance="secondary" iconStart="@tui.arrow-left" (click)="selectNetwork(null)"></button>
|
||||||
|
@if (selectedNetwork() != null) {
|
||||||
|
<oimg [src]="selectedNetwork()!.picture" height="35px" width="35px" [radius]="15"></oimg>
|
||||||
|
<h3>{{ selectedNetwork()!.name }}</h3>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<network [network]="selectedNetwork()!"></network>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,31 @@
|
|||||||
:host {
|
#holder {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&.networkActive {
|
||||||
|
#networks {
|
||||||
|
transform: translateX(100px);
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#network {
|
||||||
|
pointer-events: all;
|
||||||
|
transform: translateX(0);
|
||||||
|
opacity: 1;
|
||||||
|
|
||||||
|
network {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#networks {
|
||||||
|
transition: 0.3s;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
@@ -26,3 +53,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#network {
|
||||||
|
pointer-events: none;
|
||||||
|
transform: translateX(-100px);
|
||||||
|
opacity: 0;
|
||||||
|
transition: 0.2s;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {Component, inject, input, OnInit} from '@angular/core';
|
import { Component, inject, input, model, OnInit, signal } from '@angular/core';
|
||||||
import {IndexedDB} from '../../storage/indexed-db';
|
import {IndexedDB} from '../../storage/indexed-db';
|
||||||
import {Router, RouterLink} from '@angular/router';
|
import {Router, RouterLink} from '@angular/router';
|
||||||
import {LoadStatus, ServiceManager} from '../../service-manager';
|
import {LoadStatus, ServiceManager} from '../../service-manager';
|
||||||
@@ -6,43 +6,53 @@ import {TUI_BREAKPOINT, TuiButton, TuiLoader} from '@taiga-ui/core';
|
|||||||
import {NetworkService} from '@chatenium/chatenium-sdk/services/networkService';
|
import {NetworkService} from '@chatenium/chatenium-sdk/services/networkService';
|
||||||
import {Oimg} from '../elements/oimg/oimg';
|
import {Oimg} from '../elements/oimg/oimg';
|
||||||
import {TranslatePipe} from '@ngx-translate/core';
|
import {TranslatePipe} from '@ngx-translate/core';
|
||||||
|
import { Network as NetworkData } from '@chatenium/chatenium-sdk/domain/networkService.schema';
|
||||||
|
import { Network } from '../network/network';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'network-list',
|
selector: 'network-list',
|
||||||
imports: [
|
imports: [Oimg, TranslatePipe, TuiButton, TuiLoader, Network],
|
||||||
Oimg,
|
|
||||||
TranslatePipe,
|
|
||||||
TuiButton,
|
|
||||||
RouterLink,
|
|
||||||
TuiLoader
|
|
||||||
],
|
|
||||||
templateUrl: './network-list.html',
|
templateUrl: './network-list.html',
|
||||||
styleUrl: './network-list.scss',
|
styleUrl: './network-list.scss',
|
||||||
})
|
})
|
||||||
export class NetworkList implements OnInit {
|
export class NetworkList implements OnInit {
|
||||||
userid = input<string>("")
|
userid = input<string>('');
|
||||||
token = input<string>("")
|
token = input<string>('');
|
||||||
|
expandedSidenav = model.required<boolean>();
|
||||||
|
|
||||||
indexedDb = inject(IndexedDB)
|
selectedNetwork = signal<NetworkData | null>(null);
|
||||||
router = inject(Router)
|
|
||||||
serviceManager = inject(ServiceManager)
|
indexedDb = inject(IndexedDB);
|
||||||
breakpoint = inject(TUI_BREAKPOINT)
|
router = inject(Router);
|
||||||
|
serviceManager = inject(ServiceManager);
|
||||||
|
breakpoint = inject(TUI_BREAKPOINT);
|
||||||
|
|
||||||
|
selectNetwork(network: NetworkData | null) {
|
||||||
|
this.selectedNetwork.set(network);
|
||||||
|
this.expandedSidenav.set(network !== null);
|
||||||
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.serviceManager.networkService = new NetworkService(this.userid(), this.token(), "", this.indexedDb.getApi(), () => {})
|
this.serviceManager.networkService = new NetworkService(
|
||||||
|
this.userid(),
|
||||||
|
this.token(),
|
||||||
|
'',
|
||||||
|
this.indexedDb.getApi(),
|
||||||
|
() => {},
|
||||||
|
);
|
||||||
if (this.serviceManager.networksStatus() != LoadStatus.loaded) {
|
if (this.serviceManager.networksStatus() != LoadStatus.loaded) {
|
||||||
try {
|
try {
|
||||||
this.serviceManager.networks.set(await this.serviceManager.networkService.getQuick())
|
this.serviceManager.networks.set(await this.serviceManager.networkService.getQuick());
|
||||||
this.serviceManager.networksStatus.set(LoadStatus.updating)
|
this.serviceManager.networksStatus.set(LoadStatus.updating);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(`Cache load failed: ${e}. Skipping cache load...`)
|
console.warn(`Cache load failed: ${e}. Skipping cache load...`);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.serviceManager.networks.set(await this.serviceManager.networkService.get())
|
this.serviceManager.networks.set(await this.serviceManager.networkService.get());
|
||||||
this.serviceManager.networksStatus.set(LoadStatus.loaded)
|
this.serviceManager.networksStatus.set(LoadStatus.loaded);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e);
|
||||||
this.serviceManager.networksStatus.set(LoadStatus.error)
|
this.serviceManager.networksStatus.set(LoadStatus.error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,57 +1,19 @@
|
|||||||
@defer (when store) {
|
@defer (when store) {
|
||||||
<div id="layout" [class.routerOutletActive]="routerOutletActive()" [class.hideNetworkNav]="routerOutletActive() && breakpoint() == 'desktopSmall'">
|
<div id="layout" [class.routerOutletActive]="routerOutletActive()"
|
||||||
<div id="router">
|
[class.hideNetworkNav]="routerOutletActive() && breakpoint() == 'desktopSmall'">
|
||||||
<router-outlet (activate)="routerOutletActive.set(true)" (deactivate)="routerOutletActive.set(false)"></router-outlet>
|
|
||||||
</div>
|
|
||||||
<div id="network-data">
|
<div id="network-data">
|
||||||
<navbar backButtonDest="/chat" dataAlignment="center">
|
<main tuiGroup orientation="vertical" style="width: 100%; height: 80svh">
|
||||||
<div class="data">
|
|
||||||
<oimg [src]="store.networkData().picture" height="50px" width="50px" [radius]="15"></oimg>
|
|
||||||
<h2>{{store.networkData().name}}</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="items-right"></div>
|
|
||||||
</navbar>
|
|
||||||
|
|
||||||
<tui-tabs [(activeItemIndex)]="tabActiveIndex">
|
|
||||||
<button
|
|
||||||
iconStart="@tui.hash"
|
|
||||||
tuiTab
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
{{"chat.network.tabs.channels"|translate}}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
disabled
|
|
||||||
iconStart="@tui.users"
|
|
||||||
tuiTab
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
{{"chat.network.tabs.members"|translate}}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button
|
|
||||||
iconStart="@tui.cog"
|
|
||||||
tuiTab
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
{{"chat.network.tabs.settings"|translate}}
|
|
||||||
</button>
|
|
||||||
</tui-tabs>
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
@switch (tabActiveIndex) {
|
|
||||||
@case (0) {
|
|
||||||
<main tuiGroup orientation="vertical" style="width: 100%">
|
|
||||||
@for (category of store.networkData().categories; track category) {
|
@for (category of store.networkData().categories; track category) {
|
||||||
<div class="category">
|
<div class="category">
|
||||||
<h2>{{ category.name }}</h2>
|
<h2>{{ category.name }}</h2>
|
||||||
|
|
||||||
<div tuiGroup orientation="vertical" style="width: 100%">
|
<div class="channels">
|
||||||
@for (channel of category.channels; track channel) {
|
@for (channel of category.channels; track channel) {
|
||||||
<button tuiButton class="channel" [appearance]="router.url.endsWith(channel.channelId) ? 'primary' : 'secondary'" [disabled]="channel.type != 'message'" [routerLink]="'/chat/network/'+store.networkData().networkId+'/'+category.categoryId+'/'+channel.channelId">
|
<div class="channel">
|
||||||
|
<button tuiButton
|
||||||
|
[appearance]="router.url.endsWith(channel.channelId) ? 'secondary' : 'flat'"
|
||||||
|
[disabled]="channel.type != 'message'"
|
||||||
|
[routerLink]="'/chat/network/'+store.networkData().networkId+'/'+category.categoryId+'/'+channel.channelId">
|
||||||
@switch (channel.type) {
|
@switch (channel.type) {
|
||||||
@case ("message") {
|
@case ("message") {
|
||||||
<tui-icon icon="@tui.hash"></tui-icon>
|
<tui-icon icon="@tui.hash"></tui-icon>
|
||||||
@@ -65,18 +27,17 @@
|
|||||||
}
|
}
|
||||||
<span>{{ channel.name }}</span>
|
<span>{{ channel.name }}</span>
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</main>
|
</main>
|
||||||
}
|
<!-- @case (2) {
|
||||||
@case (2) {
|
|
||||||
<main id="settings">
|
<main id="settings">
|
||||||
<network-settings [networkStore]="this.store"></network-settings>
|
<network-settings [networkStore]="this.store"></network-settings>
|
||||||
</main>
|
</main>
|
||||||
}
|
}-->
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 0 100%;
|
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
transition: 0.2s;
|
transition: 0.2s;
|
||||||
@@ -13,20 +11,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.routerOutletActive {
|
|
||||||
overflow-y: hidden;
|
|
||||||
padding: 0;
|
|
||||||
grid-template-columns: 1fr 300px;
|
|
||||||
|
|
||||||
#router {
|
|
||||||
background: var(--tui-background-neutral-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
main {
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.hideNetworkNav {
|
&.hideNetworkNav {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
|
|
||||||
@@ -38,7 +22,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.category {
|
.category {
|
||||||
background: var(--tui-background-base-alt);
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
|
||||||
@@ -46,6 +29,31 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: start;
|
justify-content: start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.channels {
|
||||||
|
position: relative;
|
||||||
|
padding-left: 24px; /* Space for the line and spacing */
|
||||||
|
border-left: 2px solid var(--tui-background-neutral-1-hover); /* Main vertical track */
|
||||||
|
margin-left: 8px; /* Shifts child tracks slightly right */
|
||||||
|
|
||||||
|
.channel {
|
||||||
|
height: 50px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.channel::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: -26px; /* Reaches backward to snap to the parent track */
|
||||||
|
top: 10px; /* Aligns horizontally with the center of the user header */
|
||||||
|
width: 22px; /* Defines width of the horizontal curve */
|
||||||
|
height: 14px; /* Defines height of the vertical curve drop */
|
||||||
|
|
||||||
|
border-left: 2px solid var(--tui-background-neutral-1-hover);
|
||||||
|
border-bottom: 2px solid var(--tui-background-neutral-1-hover);
|
||||||
|
border-bottom-left-radius: 8px; /* Creates the smooth curved bend */
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#settings {
|
#settings {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {Component, inject, OnInit, signal} from '@angular/core';
|
import { Component, effect, inject, input, OnInit, signal } from '@angular/core';
|
||||||
import {ActivatedRoute, Router, RouterLink, RouterOutlet} from '@angular/router';
|
import {ActivatedRoute, Router, RouterLink, RouterOutlet} from '@angular/router';
|
||||||
import {Chat} from '@chatenium/chatenium-sdk/domain/chatService.schema';
|
import {Chat} from '@chatenium/chatenium-sdk/domain/chatService.schema';
|
||||||
import {Message} from '@chatenium/chatenium-sdk/domain/dmService.schema';
|
import {Message} from '@chatenium/chatenium-sdk/domain/dmService.schema';
|
||||||
@@ -15,9 +15,10 @@ import {TuiTab, TuiTabsHorizontal, TuiTabsWithMore} from '@taiga-ui/kit';
|
|||||||
import {TuiItem} from '@taiga-ui/cdk';
|
import {TuiItem} from '@taiga-ui/cdk';
|
||||||
import {TranslatePipe} from '@ngx-translate/core';
|
import {TranslatePipe} from '@ngx-translate/core';
|
||||||
import {Settings} from './settings/settings';
|
import {Settings} from './settings/settings';
|
||||||
|
import { toObservable } from '@angular/core/rxjs-interop';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-network',
|
selector: 'network',
|
||||||
imports: [
|
imports: [
|
||||||
RouterOutlet,
|
RouterOutlet,
|
||||||
Navbar,
|
Navbar,
|
||||||
@@ -31,59 +32,61 @@ import {Settings} from './settings/settings';
|
|||||||
TuiTab,
|
TuiTab,
|
||||||
TranslatePipe,
|
TranslatePipe,
|
||||||
TuiTabsHorizontal,
|
TuiTabsHorizontal,
|
||||||
Settings
|
Settings,
|
||||||
],
|
],
|
||||||
templateUrl: './network.html',
|
templateUrl: './network.html',
|
||||||
styleUrl: './network.scss',
|
styleUrl: './network.scss',
|
||||||
})
|
})
|
||||||
export class Network implements OnInit {
|
export class Network {
|
||||||
serviceManager = inject(ServiceManager)
|
serviceManager = inject(ServiceManager);
|
||||||
route = inject(ActivatedRoute)
|
route = inject(ActivatedRoute);
|
||||||
indexedDb = inject(IndexedDB)
|
indexedDb = inject(IndexedDB);
|
||||||
breakpoint = inject(TUI_BREAKPOINT)
|
breakpoint = inject(TUI_BREAKPOINT);
|
||||||
router = inject(Router)
|
router = inject(Router);
|
||||||
|
|
||||||
tabActiveIndex = 0
|
constructor() {
|
||||||
|
effect(() => {
|
||||||
routerOutletActive = signal(false)
|
if (this.network()) {
|
||||||
|
this.setupNetwork();
|
||||||
networkId = ""
|
}
|
||||||
get store() {
|
});
|
||||||
return this.serviceManager.networkServices()[this.networkId]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
network = input.required<NetworkData>();
|
||||||
this.route.params.subscribe(async params => {
|
|
||||||
console.log("Loading network...")
|
|
||||||
const networkId = params['networkId'];
|
|
||||||
this.networkId = networkId;
|
|
||||||
|
|
||||||
|
routerOutletActive = signal(false);
|
||||||
|
|
||||||
|
get store() {
|
||||||
|
return this.serviceManager.networkServices()[this.network().networkId];
|
||||||
|
}
|
||||||
|
|
||||||
|
setupNetwork() {
|
||||||
|
console.log(`Setting up NetworkView for ${this.network().networkId}`);
|
||||||
const session = this.serviceManager.currentSession();
|
const session = this.serviceManager.currentSession();
|
||||||
const networkData = this.serviceManager.networks().find(c => c.networkId === networkId);
|
|
||||||
|
|
||||||
if (!session || !networkData) {
|
if (!session) {
|
||||||
console.warn(`Initialization deferred for ${networkId}: Session or NetworkData missing.`);
|
console.warn(
|
||||||
|
`Initialization deferred for ${this.network().networkId}: Session or NetworkData missing.`,
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.serviceManager.networkServices()[networkId]) {
|
if (!this.serviceManager.networkServices()[this.network().networkId]) {
|
||||||
const newStore = {
|
const newStore = {
|
||||||
networkData: signal<NetworkData>(networkData),
|
networkData: signal<NetworkData>(this.network()),
|
||||||
textChannels: signal({}),
|
textChannels: signal({}),
|
||||||
wsListener: (action, data) => {
|
wsListener: (action, data) => {},
|
||||||
},
|
|
||||||
} as NetworkStorage;
|
} as NetworkStorage;
|
||||||
|
|
||||||
newStore.service = new NetworkService(
|
newStore.service = new NetworkService(
|
||||||
session.userData.userid,
|
session.userData.userid,
|
||||||
session.token,
|
session.token,
|
||||||
networkId,
|
this.network().networkId,
|
||||||
this.indexedDb.getApi(),
|
this.indexedDb.getApi(),
|
||||||
(action, data) => newStore.wsListener(action, data)
|
(action, data) => newStore.wsListener(action, data),
|
||||||
);
|
);
|
||||||
|
|
||||||
this.serviceManager.networkServices()[networkId] = newStore;
|
this.serviceManager.networkServices()[this.network().networkId] = newStore;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
version: "3.0-beta10",
|
version: "3.0-beta11",
|
||||||
api_url: "http://localhost:3000",
|
api_url: "http://localhost:3000",
|
||||||
cdn_url: "http://localhost:4000",
|
cdn_url: "http://localhost:4000",
|
||||||
ws_url: "ws://localhost:3000",
|
ws_url: "ws://localhost:3000",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
version: "3.0-beta10",
|
version: "3.0-beta11",
|
||||||
api_url: "https://api.chatenium.hu",
|
api_url: "https://api.chatenium.hu",
|
||||||
cdn_url: "https://cdn.chatenium.hu",
|
cdn_url: "https://cdn.chatenium.hu",
|
||||||
ws_url: "wss://api.chatenium.hu",
|
ws_url: "wss://api.chatenium.hu",
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
|
|
||||||
.drag-active * {
|
.drag-active * {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user