diff --git a/ui/winstudentgoaltracker/src/app/desktop/components/add-goal-modal/add-goal-modal.html b/ui/winstudentgoaltracker/src/app/desktop/components/add-goal-modal/add-goal-modal.html deleted file mode 100644 index 96cabbf..0000000 --- a/ui/winstudentgoaltracker/src/app/desktop/components/add-goal-modal/add-goal-modal.html +++ /dev/null @@ -1,83 +0,0 @@ -
- - diff --git a/ui/winstudentgoaltracker/src/app/desktop/components/add-goal-modal/add-goal-modal.scss b/ui/winstudentgoaltracker/src/app/desktop/components/add-goal-modal/add-goal-modal.scss deleted file mode 100644 index c652855..0000000 --- a/ui/winstudentgoaltracker/src/app/desktop/components/add-goal-modal/add-goal-modal.scss +++ /dev/null @@ -1,146 +0,0 @@ -:host { - position: fixed; - inset: 0; - display: flex; - align-items: center; - justify-content: center; - z-index: 1000; -} - -.overlay { - position: absolute; - inset: 0; - background: rgba(0, 0, 0, 0.4); -} - -.modal { - position: relative; - background: #fff; - border-radius: 10px; - box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18); - width: 420px; - max-width: 95vw; -} - -.modal-header { - display: flex; - align-items: center; - justify-content: space-between; - padding: 1.25rem 1.5rem 0; -} - -.modal-title { - margin: 0; - font-size: 1.25rem; - font-weight: 600; -} - -.close-btn { - background: none; - border: none; - font-size: 1.5rem; - line-height: 1; - cursor: pointer; - color: #666; - padding: 0; -} - -.close-btn:hover { - color: #111; -} - -.modal-body { - padding: 1.25rem 1.5rem 1.5rem; - display: flex; - flex-direction: column; - gap: 1rem; -} - -.field { - display: flex; - flex-direction: column; - gap: 0.3rem; -} - -.field label { - font-size: 0.875rem; - font-weight: 500; - color: #333; -} - -.optional { - font-weight: 400; - color: #999; -} - -.field input, -.field textarea, -.field select { - padding: 0.5rem 0.75rem; - border: 1px solid #ddd; - border-radius: 6px; - font-size: 0.9375rem; - font-family: inherit; - outline: none; - resize: vertical; -} - -.field input:focus, -.field textarea:focus, -.field select:focus { - border-color: #4f46e5; - box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15); -} - -.error { - font-size: 0.875rem; - color: #dc2626; - margin: 0; -} - -.modal-actions { - display: flex; - justify-content: flex-end; - gap: 0.75rem; - margin-top: 0.25rem; -} - -.btn { - padding: 0.5rem 1.125rem; - border-radius: 6px; - font-size: 0.875rem; - font-weight: 500; - cursor: pointer; - border: 1px solid transparent; -} - -.btn-secondary { - background: transparent; - border-color: #ddd; - color: #555; -} - -.btn-secondary:hover { - background: #f5f5f5; -} - -.btn-primary { - background: #4f46e5; - color: #fff; - border-color: #4f46e5; -} - -.btn-primary:hover:not(:disabled) { - background: #4338ca; - border-color: #4338ca; -} - -.btn-primary:disabled { - opacity: 0.55; - cursor: not-allowed; -} - -.required { - color: red; - margin-left: 4px; -} diff --git a/ui/winstudentgoaltracker/src/app/desktop/components/add-goal-modal/add-goal-modal.ts b/ui/winstudentgoaltracker/src/app/desktop/components/add-goal-modal/add-goal-modal.ts deleted file mode 100644 index 61feb4d..0000000 --- a/ui/winstudentgoaltracker/src/app/desktop/components/add-goal-modal/add-goal-modal.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Component, computed, inject, input, output, signal } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { CreateGoalDto } from '../../../shared/classes/create-goal.dto'; -import { StudentGoalItem } from '../../../shared/classes/student-goal'; -import { StudentService } from '../../../shared/services/student.service'; - -@Component({ - selector: 'app-add-goal-modal', - imports: [FormsModule], - templateUrl: './add-goal-modal.html', - styleUrl: './add-goal-modal.scss', -}) -export class AddGoalModal { - - // ************************** Constructor ************************** - - // ************************** Declarations ************************* - - private readonly studentService = inject(StudentService); - - readonly studentId = input.required(); - readonly existingGoals = input.required(); - readonly nextIepDate = input(); - readonly goalCreated = output(); - readonly cancelled = output(); - - protected readonly isSubmitting = signal(false); - protected readonly errorMessage = signal(null); - - protected readonly parentGoalOptions = computed(() => - this.existingGoals().filter(g => g.goalParentId === null) - ); - - protected form: CreateGoalDto = { - description: '', - category: '', - baseline: '', - goalParentId: null, - targetCompletionDate: null, - }; - - // ***************************************************************** - // Pre-fills targetCompletionDate from the student's nextIepDate. - // ***************************************************************** - ngOnInit() { - const iepDate = this.nextIepDate?.(); - if (iepDate) { - this.form.targetCompletionDate = iepDate; - } - } - - // ************************** Properties *************************** - - // ************************ Public Methods ************************* - - // ************************ Event Handlers ************************* - - async onSubmit() { - this.errorMessage.set(null); - this.isSubmitting.set(true); - - const result = await this.studentService.createGoal(this.studentId(), this.form); - - this.isSubmitting.set(false); - - if (!result.success) { - this.errorMessage.set(result.message); - return; - } - - this.goalCreated.emit(result.payload!); - } - - onCancel() { - this.cancelled.emit(); - } - - // ********************** Support Procedures *********************** -} diff --git a/ui/winstudentgoaltracker/src/app/desktop/components/add-student-modal/add-student-modal.html b/ui/winstudentgoaltracker/src/app/desktop/components/add-student-modal/add-student-modal.html index 6bc143b..bc4a110 100644 --- a/ui/winstudentgoaltracker/src/app/desktop/components/add-student-modal/add-student-modal.html +++ b/ui/winstudentgoaltracker/src/app/desktop/components/add-student-modal/add-student-modal.html @@ -1,66 +1,22 @@ -
- -