Skip to content

Commit

Permalink
send for review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ramkumar-pacewisdom committed Jul 23, 2024
2 parents b4f38a6 + 29aa51a commit 3d798e7
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export class ProjectDetailsComponent implements OnDestroy, OnInit {
} else {
const dialogRef = this.dialog.open(DialogPopupComponent, {
disableClose: true,
autoFocus : false,
data: {
header: 'SAVE_CHANGES',
content: 'ADD_TITLE_TO_CONTINUE_SAVING',
Expand Down
5 changes: 4 additions & 1 deletion projects/lib-project/src/lib/lib-project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export class LibProjectService {
createOrUpdateProject(projectData?:any,projectId?:string|number) {
this.projectData.title = this.projectData?.title?.length > 0 ? this.projectData.title :'Untitled project';
for (let key in projectData) {
projectData[key]= projectData[key]?.value ? projectData[key].value : projectData[key]
if(Array.isArray(projectData[key])) {
projectData[key] = projectData[key].map((element:any) => element.value ? element.value : element)
}
projectData[key]= projectData[key]?.value ? projectData[key].value : projectData[key];
}
const config = {
url: projectId ? this.Configuration.urlConFig.PROJECT_URLS.CREATE_OR_UPDATE_PROJECT+'/'+projectId : this.Configuration.urlConFig.PROJECT_URLS.CREATE_OR_UPDATE_PROJECT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ <h3 class="text-sm font-bold p-4">{{dialogueData?.content |translate}}</h3>
<div class="flex">
<mat-form-field class="w-full" appearance="outline">
<mat-label>{{ control.label }}</mat-label>
<input matInput id="exampleInput" [(ngModel)]="title" name="{{control.name}}" placeholder="Type here..."
<input matInput id="exampleInput" [(ngModel)]="title" #input="ngModel" name="{{control.name}}" placeholder="Type here..."
[maxlength]="control?.validators.maxLength"
[required]="control?.validators?.required"
[pattern]="control?.validators?.pattern">
</mat-form-field>
</div>
@if(dialogueForm.controls[control.name] && dialogueForm.controls[control.name].errors){
<mat-error class="error-container">
@if(input.touched && dialogueForm.controls[control.name] && dialogueForm.controls[control.name].errors){
<div class="error-message">
<mat-icon class="error-icon" matPrefix>error_outline</mat-icon>
@if(dialogueForm.controls[control.name]?.errors?.['required']){
Expand All @@ -30,10 +30,8 @@ <h3 class="text-sm font-bold p-4">{{dialogueData?.content |translate}}</h3>
<span>{{control.errorMessage.maxLength}}</span>
}
</div>
}
</mat-error>
}


}
}
</form>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
@if(filterData){
<div class="container">
@for(filter of filterData;track filter){
<div class="filter-container">
<mat-select [placeholder]="filter.label | translate" [multiple]="filter.isMultiple" (selectionChange)="OnClickfilter($event, filter)">
@for(option of filter.option;track option){
<mat-option [value]="option.value">{{option.label | translate}}</mat-option>
}
</mat-select>
</div>
<div class="container">
@for(filter of filterData;track filter){
<div class="filter-container">
@if(filter.option){
<mat-select [placeholder]="filter.label | translate" [multiple]="filter.isMultiple" (selectionChange)="OnClickfilter($event, filter)">
@for(option of filter.option;track option){
<mat-option [value]="option.value">{{option.label | translate}}</mat-option>
}
</mat-select>
}
@else {
<div>
<button class="inline-flex items-center text-primary px-2">
{{ filter.label | translate }}
<span class="ml-2 flex items-center justify-center w-5 h-5 rounded-full bg-numberCircle text-white text-sm">{{ changeReqCount || inprogressCount }}</span>
</button>
</div>
}
@if(showChangesButton){
<div class="filter-container">
<div>
<button class="inline-flex items-center text-primary px-2">{{ changeButton | translate }}
<span class="ml-2 flex items-center justify-center w-5 h-5 rounded-full bg-numberCircle text-white text-sm">{{ changeReqCount }}</span>
</button>
</div>
</div>
}
</div>
}
}
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class FilterComponent {
@Output() sortOptionsChanged = new EventEmitter<{ sort_by: string, sort_order: string }>();
changeButton: string = "CHANGES_REQUIRED";
@Input() changeReqCount: number = 0
@Input() inprogressCount : number = 0

OnClickfilter(event:any, filter: any){
if (["A_TO_Z", "Z_TO_A", "LATEST_FIRST", "OLDEST_FIRST"].includes(event.value)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="w-full p-6 flex flex-col gap-2">
<lib-search (searchEvent)="receiveSearchResults($event)" [maxLength]="150"></lib-search>
<lib-filter [filterData]="filters.filterData" (filteredData)="onFilterChange($event)" (sortOptionsChanged)="onSortOptionsChanged($event)" [showChangesButton]="filters.showChangesButton" [changeReqCount]="filters.changeReqCount"></lib-filter>
<lib-filter [filterData]="filters.filterData" (filteredData)="onFilterChange($event)" (sortOptionsChanged)="onSortOptionsChanged($event)" [showChangesButton]="filters.showChangesButton" [changeReqCount]="filters.changeReqCount" [inprogressCount]="filters.inprogressCount"></lib-filter>
@if(filters.filteredLists.length > 0) {
<div class="w-full flex justify-between gap-2">
<div class="flex justify-center items-center text-lg">{{"SHOWING" | translate}} <span class="px-1">{{filters.filteredLists.length}}</span> {{ "RESULTS" | translate}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export class ResourceHolderComponent implements OnInit{
filterData: [] as any,
showChangesButton: false,
showActionButton: false,
changeReqCount : 0
changeReqCount : 0,
inprogressCount : 0
};

sortOptions = {
Expand Down Expand Up @@ -77,7 +78,10 @@ export class ResourceHolderComponent implements OnInit{
this.filters.filterData = currentData?.filterData || [];
this.noResultMessage = currentData?.noResultMessage || '' ;
this.pageStatus = currentData?.value || '';
this.buttonsData = currentData?.buttonsData[0].buttons || currentData?.buttonsData[0].tagButtons || {}
this.buttonsData = [
...(currentData.buttonsData ? currentData.buttonsData[0].buttons : []),
...(currentData.statusButtons || [])
];
this.getQueryParams();
this.noResultFound = this.noResultMessage;
this.filters.showChangesButton = this.filters.filterData.some((filter: any) => filter.label === 'STATUS');
Expand Down Expand Up @@ -135,6 +139,7 @@ export class ResourceHolderComponent implements OnInit{
}
}
this.filters.changeReqCount = result.changes_requested_count;
this.filters.inprogressCount = 0;
});
}

Expand Down
3 changes: 3 additions & 0 deletions projects/self-creation-portal/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,8 @@
"YOUR_RESOURCE_HAS_BEEN_SAVED_AS_DRAFT":"Your resource has been saved as draft",
"VIEW":"View",
"RESOURCE_DELETED_SUCCESSFULLY":"Resource deleted successfully",
"INPROGRESS" : "In progress",
"START_REVIEW" : "Start review",
"RESUME_REVIEW" : "Resume review",
"NO_REVIEWERS_FOUND":"No reviewers found. Contact your organization admin."
}

0 comments on commit 3d798e7

Please sign in to comment.