diff --git a/src/app/account/login/login.component.ts b/src/app/account/login/login.component.ts index a158376..865c7e5 100644 --- a/src/app/account/login/login.component.ts +++ b/src/app/account/login/login.component.ts @@ -63,7 +63,7 @@ export class LoginComponent { this.authService.login(username, password).subscribe({ next: (authResponse) => { // Handle successful login - this.router.navigate(['/']); // Navigate to the home page or dashboard + this.router.navigate(['/tickets/list']); // Navigate to the home page or dashboard }, error: (error) => { // Handle login error diff --git a/src/app/core/data/ticket.ts b/src/app/core/data/ticket.ts index 9346456..9df1ccf 100644 --- a/src/app/core/data/ticket.ts +++ b/src/app/core/data/ticket.ts @@ -18,7 +18,7 @@ export interface SupportTicket { icon: 'ri-arrow-right-up-line', num: '', count: 0, - title: 'Open Tickets' + title: 'Відкриті задачі' }, { id: 2, @@ -28,7 +28,7 @@ export interface SupportTicket { icon: 'ri-arrow-right-down-line', num: '', count: 0, - title: 'Tickets in Progess' + title: 'Задачі в роботі' }, { id: 3, @@ -38,7 +38,7 @@ export interface SupportTicket { icon: 'ri-arrow-right-down-line', num: '', count: 0, - title: 'Tickets in Review' + title: 'Задач на перевірці' }, { id: 4, @@ -48,7 +48,7 @@ export interface SupportTicket { icon: 'ri-arrow-right-down-line', num: '', count: 0, - title: 'Tickets in Resubmit' + title: 'Задач на доперевірці' }, { id: 5, @@ -58,7 +58,7 @@ export interface SupportTicket { icon: 'ri-arrow-right-up-line', num: '', count: 0, - title: 'Tickets Done' + title: 'Задач зроблено' }, ]; diff --git a/src/app/layouts/sidebar/menu.ts b/src/app/layouts/sidebar/menu.ts index 7aedcf8..e32c8bb 100644 --- a/src/app/layouts/sidebar/menu.ts +++ b/src/app/layouts/sidebar/menu.ts @@ -3,7 +3,7 @@ import { MenuItem } from "./menu.model"; export const MENU: MenuItem[] = [ { id: 0, - label: 'ПАНЕЛЬ ЗАВІДУВАЧА КАФЕДРОЮ', + label: 'ПАНЕЛЬ СТУДЕНТА', isTitle: true }, { @@ -13,9 +13,9 @@ export const MENU: MenuItem[] = [ }, { id: 2, - label: 'Список Інструкторів', + label: 'Список Задач', icon: 'bx bx-list-ul', - link: '/learning/list-of-instructors', + link: '/tickets/list', parentId: 34 }, { diff --git a/src/app/layouts/topbar/topbar.component.html b/src/app/layouts/topbar/topbar.component.html index c566516..f503c34 100644 --- a/src/app/layouts/topbar/topbar.component.html +++ b/src/app/layouts/topbar/topbar.component.html @@ -16,7 +16,9 @@ - +
+

Студент

+
+
-
-
@@ -83,7 +78,8 @@ - diff --git a/src/app/pages/tickets/overview/overview.component.ts b/src/app/pages/tickets/overview/overview.component.ts index 7896464..90e05c0 100644 --- a/src/app/pages/tickets/overview/overview.component.ts +++ b/src/app/pages/tickets/overview/overview.component.ts @@ -5,6 +5,7 @@ import { AuthenticationService } from 'src/app/core/services/auth.service'; import { restApiService } from 'src/app/core/services/rest-api.service'; import { GlobalComponent } from 'src/app/global-component'; import { Task, Comment } from 'src/app/interfaces/api-interfaces'; + @Component({ selector: 'app-overview', templateUrl: './overview.component.html', @@ -20,6 +21,14 @@ export class OverviewComponent implements OnInit { taskId: string = ''; fileId: any; + translations: { [key: string]: string } = { + open: 'Відкриті', + in_review: 'На перевірці', + in_progress: 'В роботі', + resubmit: 'На доперевірці', + done: 'Зроблено' + }; + constructor( private route: ActivatedRoute, private apiService: restApiService, @@ -99,26 +108,23 @@ export class OverviewComponent implements OnInit { }); } -downloadFile(fileId: string) { - this.apiService.downloadFile(fileId).subscribe({ - next: ({ blob, filename }) => { - const url = window.URL.createObjectURL(blob); - const anchor = document.createElement('a'); - anchor.href = url; - anchor.download = filename; // Use the extracted filename - document.body.appendChild(anchor); - anchor.click(); - window.URL.revokeObjectURL(url); - document.body.removeChild(anchor); - }, - error: error => { - console.error('Download failed:', error); - } - }); -} - - - + downloadFile(fileId: string) { + this.apiService.downloadFile(fileId).subscribe({ + next: ({ blob, filename }) => { + const url = window.URL.createObjectURL(blob); + const anchor = document.createElement('a'); + anchor.href = url; + anchor.download = filename; // Use the extracted filename + document.body.appendChild(anchor); + anchor.click(); + window.URL.revokeObjectURL(url); + document.body.removeChild(anchor); + }, + error: error => { + console.error('Download failed:', error); + } + }); + } isCurrentUser(senderId: string): boolean { return this.authService.getCurrentUserUUID() === senderId; @@ -162,4 +168,8 @@ downloadFile(fileId: string) { }); } } + + getTranslatedStatus(status: string): string { + return this.translations[status] ?? status; + } }