Skip to content

Commit

Permalink
Merge pull request #186 from venkykandagaddala/cbrelease-4.8.22
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
venkykandagaddala authored Feb 19, 2025
2 parents 397a71f + f25a0d0 commit cbe9bdd
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EventsService } from '../../services/events.service'
import { ActivatedRoute, Router } from '@angular/router'
import * as _ from 'lodash'
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
import { URL_PATRON, material, speaker } from '../../models/events.model'
import { URL_PATRON, material, noSpecialChar, speaker } from '../../models/events.model'
import { StepperSelectionEvent } from '@angular/cdk/stepper'
import { MatStepper } from '@angular/material/stepper'
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar'
Expand Down Expand Up @@ -52,8 +52,9 @@ export class CreateEventComponent implements OnInit, AfterViewInit {

initializeFormAndParams() {
this.eventDetailsForm = this.formBuilder.group({
eventName: new FormControl('', [Validators.required]),
description: new FormControl('', [Validators.required, Validators.maxLength(250)]),
eventName: new FormControl('', [Validators.required, Validators.minLength(10),
Validators.maxLength(70), Validators.pattern(noSpecialChar)]),
description: new FormControl('', [Validators.required, Validators.minLength(250), Validators.maxLength(500)]),
eventCategory: new FormControl('', [Validators.required]),
streamType: new FormControl(''),
startDate: new FormControl('', [Validators.required]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
<mat-error *ngIf="showValidationMsg('eventName','required')">
Event name is mandatory
</mat-error>
<mat-error *ngIf="showValidationMsg('eventName','pattern')">
Only ( a-z/A-Z , 0-9 . _ - $ / : [ ]' ' !) characters are supported
</mat-error>
<mat-error *ngIf="!showValidationMsg('eventName','pattern')
&& showValidationMsg('eventName','minlength')">
Minimum characters left to create {{ 10 - eventDetails?.controls['eventName'].value.length}}
</mat-error>
</mat-form-field>
</div>

Expand All @@ -46,12 +53,15 @@
Description
</div>
<mat-form-field appearance="outline" class="">
<textarea matInput placeholder="Add your description" formControlName="description" maxlength="250"> </textarea>
<textarea matInput placeholder="Add your description" formControlName="description" maxlength="500"> </textarea>
<mat-error *ngIf="showValidationMsg('description','required')">
Description is mandatory
</mat-error>
<mat-error *ngIf="showValidationMsg('description','minlength')">
Minimum characters left to create {{ 250 - eventDetails?.controls['description'].value.length}}
</mat-error>
</mat-form-field>
<span class="description-count flex justify-end">{{eventDetails?.value?.description?.length}}/250</span>
<span class="description-count flex justify-end">{{eventDetails?.value?.description?.length}}/500</span>
</div>

<ng-container *ngIf="uploadedVideoName; else uploadVideo">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="competency-details flex-grow">
<div class="competency-details px-4 flex-grow">
<div class="mt-4 flex justify-between">
<div class="title">Add Competency</div>
<ng-container *ngIf="openMode === 'edit'">
Expand All @@ -8,26 +8,24 @@
<div class="add-theme-sec mt-4" *ngIf="competencies?.length">
<div class="" *ngFor="let competency of competencies, let index=c">
<div class="mb-4">
<div class="flex area {{competency.competencyAreaName.toLocaleLowerCase()}} justify-between">
<div class="flex area my-border {{competency?.competencyAreaName?.toLocaleLowerCase()}} justify-between">
<div class="flex">
<div class="flex gap-2 items-center">
<mat-icon class="cursor-pointer" *ngIf="competency?.collapsed"
(click)="hideAnfShow(competency)">arrow_drop_up</mat-icon>
<mat-icon class="cursor-pointer" *ngIf="!competency?.collapsed"
(click)="hideAnfShow(competency)">arrow_drop_down</mat-icon>
<div>{{competency.competencyAreaName}}</div>
<div>{{competency?.competencyAreaName}}</div>
</div>
</div>
<ng-container *ngIf="openMode === 'edit'">
<div>
<mat-icon class="cursor-pointer" (click)="removeNode(competency)">delete</mat-icon>
</div>
</ng-container>
<div>
<mat-icon class="cursor-pointer" (click)="removeNode(competency)">delete</mat-icon>
</div>
</div>
<ng-container *ngIf="competency?.themes?.length">
<div class="themes-card" *ngFor="let theme of competency.themes, let i=index">
<div *ngFor="let theme of competency?.themes, let i=index">
<div
class="flex font-medium theme theme-{{competency.competencyAreaName.toLocaleLowerCase()}} justify-between bottom-border"
class="flex font-medium my-border theme theme-{{competency?.competencyAreaName?.toLocaleLowerCase()}} justify-between"
*ngIf="competency?.collapsed">
<div class="flex ">
<div class="flex pl-4">
Expand All @@ -36,37 +34,31 @@
(click)="hideAnfShow(theme)">arrow_drop_up</mat-icon>
<mat-icon class="cursor-pointer" *ngIf="!theme?.collapsed"
(click)="hideAnfShow(theme)">arrow_drop_down</mat-icon>
<div>{{i + 1}}. {{theme.competencyThemeName}}</div>
<div>{{i + 1}}. {{theme?.competencyThemeName}}</div>
</div>
</div>
</div>

<ng-container *ngIf="openMode === 'edit'">
<div>
<mat-icon class="cursor-pointer" (click)="removeTheme(competency, theme)"
*ngIf="competency?.themes?.length > 1">delete</mat-icon>
</div>
</ng-container>
<div>
<mat-icon class="cursor-pointer" (click)="removeTheme(competency, theme)"
*ngIf="competency?.themes?.length > 1">delete</mat-icon>
</div>
</div>
<ng-container *ngIf="theme?.subThems?.length">
<div *ngFor="let subTheme of theme.subThems, let j=index">
<div *ngFor="let subTheme of theme?.subThems, let j=index">
<div
class="flex theme sub-theme-{{competency.competencyAreaName.toLocaleLowerCase()}} justify-between bottom-border"
class="flex theme my-border sub-theme-{{competency?.competencyAreaName?.toLocaleLowerCase()}} justify-between"
*ngIf="theme?.collapsed && competency?.collapsed">
<div class="flex pl-10">
<div class="flex extra-padding">
<div class="flex">
<div class="flex gap-2 items-center">
<div>{{i+1}}.{{j+1}}. {{subTheme.competencySubThemeAdditionalProperties.displayName}}</div>
<div>{{i+1}}.{{j+1}}. {{subTheme?.competencySubThemeAdditionalProperties?.displayName}}</div>
</div>
</div>
</div>

<ng-container *ngIf="openMode === 'edit'">
<div>
<mat-icon class="cursor-pointer" *ngIf="theme?.subThems?.length > 1"
(click)="removeSubTheme(competency, theme, subTheme)">delete</mat-icon>
</div>
</ng-container>
<div>
<mat-icon class="cursor-pointer" *ngIf="theme?.subThems?.length > 1"
(click)="removeSubTheme(competency, theme, subTheme)">delete</mat-icon>
</div>
</div>
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.competency-details {
margin: 0 0%;

.title {
font-family: Montserrat;
Expand All @@ -13,6 +14,7 @@
.pill {
padding: 5px 16px;
border: 1px solid rgba(0, 0, 0, 0.4);
;
border-radius: 50px;
cursor: pointer;
font-family: Lato;
Expand All @@ -31,13 +33,11 @@
color: rgba(27, 76, 161, 1);
}

.themes-card {
border-bottom: 1px solid #c3c3c3;
}

.bottom-border {
border: 1px solid #c3c3c3;
border-bottom: 0px !important;
border-bottom: 1px solid #c3c3c3;
border-left: 1px solid #c3c3c3;
border-right: 1px solid #c3c3c3;
border-top: 1px solid #c3c3c3;
}

.extra-padding {
Expand Down Expand Up @@ -85,28 +85,22 @@
}

.behavioural {
border-top: 4px solid #F8B861!important;
border-top: 4px solid #F8B861 !important;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border-left: 1px solid #c3c3c3;
border-right: 1px solid #c3c3c3;
}

.functional {
border-top: 4px solid #E24577;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border-left: 1px solid #c3c3c3;
border-right: 1px solid #c3c3c3;

}

.domain {
border-top: 4px solid #7B47A4!important;
border-top: 4px solid #7B47A4 !important;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border-left: 1px solid #c3c3c3;
border-right: 1px solid #c3c3c3;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class EventCompetenciesComponent implements OnChanges {
return { ...competency }
}
})
this.openSnackBar('Competency theme is removee successfully.')
this.openSnackBar('Competency theme is removed successfully.')
}

removeSubTheme(_competency: any, _theme: any, _subTheme: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,55 +73,60 @@
</div>
</ng-container>
</mat-tab>

<mat-tab label="Materials">
<ng-container>
<ng-container *ngIf="event?.eventHandouts?.length">
<mat-tab label="Materials">
<ng-container>
<div class="flex flex-col my-4 px-4 gap-5">
<ng-container *ngIf="event?.eventHandouts?.length">
<ng-container *ngFor="let handout of event?.eventHandouts">
<div class="content-card">
<div class="flex flex-col my-4 px-4">
<div class="r-name text-truncate">{{handout?.title}}</div>
<div class="r-type flex items-center gap-2">
<img src="/assets/icons/event_pdf.svg" alt="pdf" />
<a href="{{handout?.content1 || handout?.content}}" target="_blank">{{handout?.title}}</a>
<ng-container>
<div class="flex flex-col my-4 px-4 gap-5">
<ng-container *ngIf="event?.eventHandouts?.length">
<ng-container *ngFor="let handout of event?.eventHandouts">
<div class="content-card">
<div class="flex flex-col my-4 px-4">
<div class="r-name text-truncate">{{handout?.title}}</div>
<div class="r-type flex items-center gap-2">
<img src="/assets/icons/event_pdf.svg" alt="pdf" />
<a href="{{handout?.content1 || handout?.content}}"
target="_blank">{{handout?.title}}</a>
</div>
</div>
</div>
</div>
</ng-container>
</ng-container>
</ng-container>
<ng-container *ngIf="!event?.eventHandouts?.length">
No material is added.
</ng-container>
</div>
<ng-container *ngIf="!event?.eventHandouts?.length">
No material is added.
</ng-container>
</div>
</ng-container>
</ng-container>
</ng-container>
</mat-tab>
</mat-tab>
</ng-container>

<mat-tab label="Speakers">
<ng-container>
<ng-container *ngIf="event?.speakers?.length">
<mat-tab label="Speakers">
<ng-container>
<div class="flex flex-col my-4 px-4 gap-5">
<ng-container *ngIf="event?.speakers?.length">
<ng-container *ngFor="let speaker of event?.speakers">
<div class="content-card">
<div class="flex flex-col my-4 px-4">
<div class="r-name text-truncate speaker-name pb-2">{{speaker?.name}}</div>
<div class="r-type flex items-center gap-2 speaker-description">
{{speaker?.description}}
<ng-container>
<div class="flex flex-col my-4 px-4 gap-5">
<ng-container *ngIf="event?.speakers?.length">
<ng-container *ngFor="let speaker of event?.speakers">
<div class="content-card">
<div class="flex flex-col my-4 px-4">
<div class="r-name text-truncate speaker-name pb-2">{{speaker?.name}}</div>
<div class="r-type flex items-center gap-2 speaker-description">
{{speaker?.description}}
</div>
</div>
</div>
</div>
</ng-container>
</ng-container>
</ng-container>
<ng-container *ngIf="!event?.speakers?.length">
No speakers are added.
</ng-container>
</div>
<ng-container *ngIf="!event?.speakers?.length">
No speakers are added.
</ng-container>
</div>
</ng-container>
</ng-container>
</ng-container>
</mat-tab>
</mat-tab>
</ng-container>

</mat-tab-group>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
<mat-form-field appearance="outline" class="w-full">
<input matInput placeholder="Add your event name" formControlName="eventName" maxlength="70">
<mat-hint>Only ( a-z/A-Z , 0-9 . - _ $ / : [ ]' ' !) characters are supported</mat-hint>
<mat-hint align="end" class="text-sm">{{eventForm.controls['eventName'].value.length}}/70</mat-hint>
<mat-error *ngIf="!eventForm.controls['eventName'].hasError('required') && !eventForm.controls['eventName'].errors?.pattern &&
eventForm.controls['eventName'].errors?.minlength">
Minimum characters left to create {{ 10 - eventForm?.controls['eventName'].value.length}}
</mat-error>
<mat-error *ngIf="eventForm?.get('eventName') && eventForm.get('eventName').hasError('required')">
Event name is mandatory
</mat-error>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export class BasicInfoComponent implements OnInit {
/^[\u0900-\u097F\u0980-\u09FF\u0C00-\u0C7F\u0B80-\u0BFF\u0C80-\u0CFF\u0D00-\u0D7F\u0A80-\u0AFF\u0B00-\u0B7F\u0A00-\u0A7Fa-zA-Z0-9\(\)\$\[\]\.\-,:!' _\/]*$/ // NOSONAR
)
this.eventForm = this.formBuilder.group({
eventName: new FormControl('', [Validators.required, Validators.pattern(noSpecialChar)]),
eventName: new FormControl('', [Validators.required, Validators.minLength(10),
Validators.maxLength(70), Validators.pattern(noSpecialChar)]),
eventType: new FormControl('recorded', [Validators.required]),
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ export interface material {
content: string
}

export const URL_PATRON = /^(https?|http):\/\/[^\s/$.?#].[^\s]*$/
export const URL_PATRON = /^(https?|http):\/\/[^\s/$.?#].[^\s]*$/

export const noSpecialChar = new RegExp(
/^[\u0900-\u097F\u0980-\u09FF\u0C00-\u0C7F\u0B80-\u0BFF\u0C80-\u0CFF\u0D00-\u0D7F\u0A80-\u0AFF\u0B00-\u0B7F\u0A00-\u0A7Fa-zA-Z0-9\(\)\$\[\]\.\-,:!' _\/]*$/ // NOSONAR
)

0 comments on commit cbe9bdd

Please sign in to comment.