Actions
-
edit
diff --git a/src/app/home/home.component.scss b/src/app/home/home.component.scss
index d909936..f64f9df 100644
--- a/src/app/home/home.component.scss
+++ b/src/app/home/home.component.scss
@@ -1,12 +1,42 @@
.dashboard-container {
- padding: 24px;
+ // padding: 24px;
- .quick-actions {
+ // .quick-actions {
+ // display: flex;
+ // justify-content: end;
+
+ // button {
+ // margin-bottom: 16px;
+ // }
+ // }
+
+ .app-container {
display: flex;
- justify-content: end;
+ gap: 16px;
+ box-sizing: border-box;
- button {
- margin-bottom: 16px;
+ .chart-section {
+ flex: 0 0 30%;
+ }
+
+ .questions-section {
+ flex: 0 0 70%;
+ padding: 24px 0px;
+ margin-bottom: 24px;
+ margin-left: 1rem;
+
+ .question-row {
+ margin-bottom: 1rem;
+
+ mat-radio-group {
+ display: flex;
+ gap: 8px;
+
+ mat-radio-button {
+ margin-top: -5px;
+ }
+ }
+ }
}
}
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts
index de9ec78..4c155d6 100644
--- a/src/app/home/home.component.ts
+++ b/src/app/home/home.component.ts
@@ -14,6 +14,7 @@ import { ApiErrorHandlerService } from '../core/services/common/api-error-handle
import { CommonService } from '../core/services/common/common.service';
import { NotificationService } from '../core/services/common/notification.service';
import { NavigationService } from '../core/services/common/navigation.service';
+import { MatRadioChange } from '@angular/material/radio';
@Component({
selector: 'app-home',
@@ -111,6 +112,29 @@ export class HomeComponent {
return carnetStatus ? carnetStatus.name : value;
}
+ newCarnet(event: MatRadioChange): void {
+ if (event.value) {
+ this.navigateTo('add-carnet');
+ }
+ }
+
+ additionalSets(event: MatRadioChange): void {
+ }
+
+ duplicateCarnet(event: MatRadioChange): void {
+ }
+
+ extendCarnet(event: MatRadioChange): void {
+ }
+
+ editCarnet(item: any): void {
+ if (item && item.headerId) {
+ this.navigateTo(`edit-carnet/${item.headerId}?ApplicationName=${item.applicationName}`);
+ } else {
+ this.notificationService.showError('Invalid carnet data');
+ }
+ }
+
navigateTo(route: string): void {
this.navigationService.navigate([route]);
}
diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html
index d234c5c..b1d61ca 100644
--- a/src/app/login/login.component.html
+++ b/src/app/login/login.component.html
@@ -22,7 +22,7 @@
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts
index 170af43..d146153 100644
--- a/src/app/login/login.component.ts
+++ b/src/app/login/login.component.ts
@@ -7,10 +7,11 @@ import { NavigationService } from '../core/services/common/navigation.service';
import { UserService } from '../core/services/common/user.service';
import { User } from '../core/models/user';
import { ThemeService } from '../core/services/theme.service';
+import { RouterModule } from '@angular/router';
@Component({
selector: 'app-login',
- imports: [ReactiveFormsModule, CommonModule, AngularMaterialModule],
+ imports: [ReactiveFormsModule, CommonModule, AngularMaterialModule, RouterModule],
templateUrl: './login.component.html',
styleUrl: './login.component.scss'
})
diff --git a/src/app/register/register.component.html b/src/app/register/register.component.html
new file mode 100644
index 0000000..4e0da88
--- /dev/null
+++ b/src/app/register/register.component.html
@@ -0,0 +1,64 @@
+
+
+
User Registration
+
+
+
+
+ error_outline
+ Invalid registration link. Please request a new registration link from your
+ administrator.
+
+
+
+
+
+
+
+
ATA Carnet
+
+ Also known as the "Merchandise Passport," is an international customs document that simplifies temporary
+ exports to over 79 countries and territories.
+ It allows businesses to explore new markets, showcase products at trade shows, and attend global conferences
+ without paying duties or taxes.
+
+
+ It simplifies customs procedures for the temporary movement of goods and allows goods to
+ enter Customs territories of the ATA Carnet system free of customs duties and taxes for up to
+ one year.
+
+
+
\ No newline at end of file
diff --git a/src/app/register/register.component.scss b/src/app/register/register.component.scss
new file mode 100644
index 0000000..41be398
--- /dev/null
+++ b/src/app/register/register.component.scss
@@ -0,0 +1,95 @@
+/* registration.component.scss */
+.registration-container {
+ display: flex;
+ min-height: 85vh;
+ background-color: #f5f5f5;
+
+ .registration-card {
+ flex: 1;
+ max-width: 500px;
+ padding: 2rem;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ background-color: white;
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
+
+ .subtitle {
+ text-align: center;
+ color: #666;
+ font-size: 1.5rem;
+ margin-bottom: 2rem;
+ }
+
+ .registration-form {
+ display: flex;
+ flex-direction: column;
+ gap: 1.5rem;
+
+ mat-form-field {
+ width: 100%;
+ }
+
+ .login {
+ text-align: right;
+ margin-top: -1rem;
+
+ .login-link {
+ color: #666;
+ text-decoration: none;
+ font-size: 0.875rem;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+ }
+
+ .mdc-icon-button {
+ margin-right: 8px;
+ }
+
+ // button {
+ // margin-top: 1rem;
+ // padding: 0.5rem;
+ // font-size: 1rem;
+ // }
+ }
+ }
+
+ .info-section {
+ flex: 1;
+ padding: 4rem;
+ background-color: #597b7c;
+ color: white;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+
+ h3 {
+ font-size: 2rem;
+ margin-bottom: 1.5rem;
+ }
+
+ p {
+ line-height: 1.6;
+ font-size: 1rem;
+ }
+ }
+}
+
+@media (max-width: 768px) {
+ .registration-container {
+ flex-direction: column;
+
+ .registration-card {
+ max-width: 100%;
+ padding: 1.5rem;
+ }
+
+ .info-section {
+ padding: 2rem;
+ display: none;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/app/register/register.component.ts b/src/app/register/register.component.ts
new file mode 100644
index 0000000..62399b1
--- /dev/null
+++ b/src/app/register/register.component.ts
@@ -0,0 +1,82 @@
+import { Component, inject } from '@angular/core';
+import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
+import { ActivatedRoute, Router } from '@angular/router';
+import { AuthService } from '../core/services/common/auth.service';
+import { NotificationService } from '../core/services/common/notification.service';
+import { AngularMaterialModule } from '../shared/module/angular-material.module';
+import { ApiErrorHandlerService } from '../core/services/common/api-error-handler.service';
+import { CommonModule } from '@angular/common';
+import { ThemeService } from '../core/services/theme.service';
+
+@Component({
+ selector: 'app-register',
+ imports: [AngularMaterialModule, ReactiveFormsModule, CommonModule],
+ templateUrl: './register.component.html',
+ styleUrl: './register.component.scss'
+})
+export class RegisterComponent {
+
+ registrationForm: FormGroup;
+ isLoading = false;
+ hidePassword = true;
+ tokenError: boolean = false;
+ token: string | null = null;
+
+ private fb = inject(FormBuilder);
+ private authService = inject(AuthService);
+ private router = inject(Router);
+ private route = inject(ActivatedRoute);
+ private notificationService = inject(NotificationService);
+ private errorHandler = inject(ApiErrorHandlerService);
+ private themeService = inject(ThemeService);
+
+ constructor() {
+ this.registrationForm = this.fb.group({
+ email: ['', [Validators.required, Validators.email]],
+ password: ['', [Validators.required]]
+ });
+
+ // Get token from URL if present
+ this.token = this.route.snapshot.paramMap.get('token');
+
+ // Check if token is null or empty
+ if (!this.token || this.token.trim() === '') {
+ this.tokenError = true;
+ }
+ }
+
+ ngOnInit(): void {
+ this.themeService.setTheme('default');
+ }
+
+ onSubmit(): void {
+ if (this.registrationForm.invalid) {
+ this.registrationForm.markAllAsTouched();
+ return;
+ }
+
+ this.isLoading = true;
+ const { email, password } = this.registrationForm.value;
+
+ this.authService.register(email, password, this.token).subscribe({
+ next: () => {
+ this.notificationService.showSuccess('Registration successful');
+ this.router.navigate(['/login']);
+ },
+ error: (error) => {
+ this.isLoading = false;
+ let errorMessage = `Registration failed. Please request a new registration link from your administrator.`;
+ this.notificationService.showError(errorMessage);
+ console.error('Registration failed:', error);
+ }
+ });
+ }
+
+ get email() {
+ return this.registrationForm.get('email');
+ }
+
+ get password() {
+ return this.registrationForm.get('password');
+ }
+}