Skip to content

Commit

Permalink
Bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Lanzilotto committed Oct 6, 2023
1 parent 87770df commit d347a49
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
<!-- (ROLE_IS_AGENT === false) || (ROLE_IS_AGENT === true && DISPLAY_ALL_TEAMMATES_TO_AGENT) -->
<!-- the last: ngIf="ROLE_IS_AGENT === false" -->
<!-- -------------------------------------------------------------------------------------- -->
<!-- <div class="col-xs-12" style="padding-right: 5px;">
<div class="col-xs-12" style="padding-right: 5px;">
<div class="card card--no-border" style="margin: 5px 0;margin-top: 8px;">
<div class="card-content"
style="padding-top: 0px;padding-left: 0px;padding-right: 0px;padding-bottom: 0px;">
Expand All @@ -412,7 +412,8 @@

<div #widgetsContent class="middle-nw">
<div class="served-by-conv-a" *ngIf="showRealTeammates === true">
<ng-container class="all-teammates" *ngIf="ONLY_MY_REQUESTS === false">
<!-- *ngIf="ONLY_MY_REQUESTS === false" -->
<ng-container class="all-teammates" >
<div class="served-by-conv-b" *ngFor="let agent of projectUserArray">

<div class="served-by-conv-c tool_tip">
Expand All @@ -421,16 +422,16 @@

<div *ngIf="agent?.hasImage" size="42" class="served-by-conv-e">

<!- - ---------------------------------------- - ->
<!- - Usecase Firebase - ->
<!- - ---------------------------------------- - ->
<!-- ---------------------------------------- -->
<!-- Usecase Firebase -->
<!-- ---------------------------------------- -->
<img *ngIf="UPLOAD_ENGINE_IS_FIREBASE"
src="https://firebasestorage.googleapis.com/v0/b/{{storageBucket}}/o/profiles%2F{{agent?.id_user._id}}%2Fphoto.jpg?alt=media"
alt="" onerror="this.src='assets/img/no_image_user.png'">

<!- - ---------------------------------------- - ->
<! -- Usecase Native - ->
<!- - ---------------------------------------- - ->
<!-- ---------------------------------------- -->
<!-- Usecase Native -->
<!-- ---------------------------------------- -->
<img *ngIf="!UPLOAD_ENGINE_IS_FIREBASE"
src="{{baseUrl}}images?path=uploads%2Fusers%2F{{agent?.id_user._id}}%2Fimages%2Fthumbnails_200_200-photo.jpg"
alt="" onerror="this.src='assets/img/no_image_user.png'">
Expand All @@ -443,9 +444,9 @@
</div>
</div>

<!- - ---------------------------------------- - ->
<!- - Usecase No profile image - ->
<!- - ---------------------------------------- - ->
<!-- ---------------------------------------- -->
<!-- Usecase No profile image -->
<!-- ---------------------------------------- -->
<div *ngIf="!agent?.hasImage" size="42" class="served-by-conv-e">
<div class="altenative-conv-avatar-wrap" style="width: 43px; height: 43px; top: -1px;"
[ngStyle]="{'background': 'linear-gradient(rgb(255,255,255) -125%,' + agent?.id_user?.fillColour + ')'}">
Expand Down Expand Up @@ -482,10 +483,10 @@
</div>
</div>
</ng-container>
<!- - ------------------------------------------------------------------ - ->
<!- - teammates of the groups to which the current user belongs - ->
<!- - ------------------------------------------------------------------ - ->
<ng-container class="curren-user-teammates" *ngIf="ONLY_MY_REQUESTS === true">
<!-- ------------------------------------------------------------------ -->
<!-- teammates of the groups to which the current user belongs -->
<!-- ------------------------------------------------------------------ -->
<!-- <ng-container class="curren-user-teammates" *ngIf="ONLY_MY_REQUESTS === true">
<div class="served-by-conv-b" *ngFor="let agent of filteredProjectUsersArray">
<div class="served-by-conv-c tool_tip">
Expand Down Expand Up @@ -546,12 +547,12 @@
</span>
</div>
</div>
</ng-container>
</ng-container> -->
</div>

<!- - ---------------------------------------------- - ->
<!- - Skeleton - ->
<!- - ---------------------------------------------- - ->
<!-- ---------------------------------------------- -->
<!-- Skeleton -->
<!-- ---------------------------------------------- -->
<div class="served-by-conv-a" *ngIf="showRealTeammates === false">
<div class="served-by-conv-b" *ngFor="let fake of generateFake(project_user_length)">

Expand All @@ -572,7 +573,7 @@

</div>
</div>
</div> -->
</div>
<!-- .END HERE -->

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,12 +720,12 @@ $f21blue: #039be5;
.middle-nw {
float: left;
// width: 90%;
width: 89%;
width: 91%;
// overflow: auto;
overflow: hidden;
/*will change this to hidden later to deny scolling to user*/
white-space: nowrap;
height: 60px;
// height: 60px;
}

// .teammates-with-picture-assigned-requests-count {
Expand Down Expand Up @@ -816,7 +816,7 @@ $f21blue: #039be5;
align-items: center;
justify-content: center;
display: flex;
margin-top: 4px;
margin-top: 9px;
background: #e4e6eb;
border-radius: 50%;
padding: 2px;
Expand Down
35 changes: 18 additions & 17 deletions src/app/ws_requests/ws-requests-list/ws-requests-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,13 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit
// createBotsAndUsersArray() {
this.usersService.getProjectUsersByProjectId().subscribe((_projectUsers: any) => {
// this.logger.log('% »»» WebSocketJs WF WS-RL - +++ GET PROJECT-USERS ', projectUsers);
console.log('[WS-REQUESTS-LIST]- GET PROJECT-USERS RES ', _projectUsers);
// console.log('[WS-REQUESTS-LIST]- GET PROJECT-USERS RES ', _projectUsers);
if (_projectUsers) {
this.project_users = _projectUsers
this.project_user_length = _projectUsers.length;
this.logger.log('[WS-REQUESTS-LIST] - GET PROJECT-USERS LENGTH ', this.project_user_length);
// this.projectUserArray = _projectUsers;
// console.log('[WS-REQUESTS-LIST] - GET PROJECT-USERS LENGTH ', this.project_user_length);
// console.log('[WS-REQUESTS-LIST] - GET PROJECT-USERS project_users ', this.project_users);
this.projectUserArray = _projectUsers;

_projectUsers.forEach(projectuser => {

Expand All @@ -594,7 +595,7 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit
this.wsRequestsService.subscriptionToWsAllProjectUsersOfTheProject(projectuser.id_user._id);

// Commented nk
// this.listenToAllProjectUsersOfProject$(projectuser)
this.listenToAllProjectUsersOfProject$(projectuser)

this.createAgentAvatarInitialsAnfBckgrnd(projectuser.id_user)

Expand Down Expand Up @@ -634,7 +635,7 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit
takeUntil(this.unsubscribe$)
)
.subscribe((projectUser_from_ws_subscription) => {
console.log('[WS-REQUESTS-LIST] $UBSC TO WS PROJECT-USERS (listenTo) projectUser_from_ws_subscription', projectUser_from_ws_subscription);
// console.log('[WS-REQUESTS-LIST] $UBSC TO WS PROJECT-USERS (listenTo) projectUser_from_ws_subscription', projectUser_from_ws_subscription);
// this.logger.log('WS-REQUESTS-LIST PROJECT-USERS ', projectuser);

if (projectuser['_id'] === projectUser_from_ws_subscription['_id']) {
Expand Down Expand Up @@ -686,24 +687,24 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit
if (departmentsCount > 1) {
// console.log('»»» »»» DEPTS PAGE - DEPT)', dept);
if (dept && dept.default !== true) {
console.log('[DEPTS] - GET DEPTS - DEPT NAME: ', dept.name, 'dept object', dept);
// console.log('[DEPTS] - GET DEPTS - DEPT NAME: ', dept.name, 'dept object', dept);

if (!dept.id_group || dept.id_group === undefined) {
count = count + 1;
console.log('[WS-REQUESTS-LIST] display all teammates')
// console.log('[WS-REQUESTS-LIST] display all teammates')
}
}
} else if (departmentsCount === 1) {
// console.log('[WS-REQUESTS-LIST] USECASE: THERE IS ONLY A DEPT - DEPT NAME ', dept.name, 'dept object', dept);


if (!dept.id_group || dept.id_group === undefined) {
console.log('[WS-REQUESTS-LIST] (only default dept) ')
// console.log('[WS-REQUESTS-LIST] (only default dept) ')
count = count + 1;
}
}
});
console.log('[DEPTS] - COUNT OF DEPT WITHOUT GROUP', count);
// console.log('[DEPTS] - COUNT OF DEPT WITHOUT GROUP', count);
if (count > 0) {
// this.DISPLAY_ALL_TEAMMATES_TO_AGENT = true;
this.filteredProjectUsersArray = projectUserArray
Expand All @@ -723,35 +724,35 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit
}

getGroupsByProjectId(projectUserArray) {
console.log('[WS-REQUESTS-LIST] - GROUPS - ALL PROJECT USERS ', projectUserArray)
// console.log('[WS-REQUESTS-LIST] - GROUPS - ALL PROJECT USERS ', projectUserArray)
this.groupService.getGroupsByProjectId().subscribe((groups: any) => {
console.log('[WS-REQUESTS-LIST] - GROUPS GET BY PROJECT ID', groups);
// console.log('[WS-REQUESTS-LIST] - GROUPS GET BY PROJECT ID', groups);
const memberOfAllGroups = []
if (groups) {
this.groupsList = groups;

// this.logger.log('[DEPT-EDIT-ADD] - GROUP ID SELECTED', this.selectedGroupId);
this.groupsList.forEach(group => {
console.log('[WS-REQUESTS-LIST] - GROUP ', group);
// console.log('[WS-REQUESTS-LIST] - GROUP ', group);

if (group.members.includes(this.currentUserID)) {
// console.log('[WS-REQUESTS-LIST] - GROUPS MEMBERS INCLUDES CURRENT USER');
group.members.forEach(member => {
memberOfAllGroups.indexOf(member) === -1 ? memberOfAllGroups.push(member) : this.logger.log("PUSH MEMBER ID IN memberOfAllGroups : This item already exists");
});

console.log('[WS-REQUESTS-LIST] - ARRAY OF ALL MEMBERS OF GROUPS ', memberOfAllGroups);
// console.log('[WS-REQUESTS-LIST] - ARRAY OF ALL MEMBERS OF GROUPS ', memberOfAllGroups);

this.filteredProjectUsersArray = projectUserArray.filter(projectUser => memberOfAllGroups.includes(projectUser.id_user._id))
console.log('[WS-REQUESTS-LIST] - PROJECT USER FILTERED FOR MEMBERS OF THE GROUPS IN WICH IS PRESENT THE CURRENT USER ', this.filteredProjectUsersArray);
// console.log('[WS-REQUESTS-LIST] - PROJECT USER FILTERED FOR MEMBERS OF THE GROUPS IN WICH IS PRESENT THE CURRENT USER ', this.filteredProjectUsersArray);
} else {
console.log('[WS-REQUESTS-LIST] - GROUPS MEMBERS NOT INCLUDES CURRENT USER - SHOW ALL TEAMMATES');
// console.log('[WS-REQUESTS-LIST] - GROUPS MEMBERS NOT INCLUDES CURRENT USER - SHOW ALL TEAMMATES');
this.filteredProjectUsersArray = projectUserArray
}
});

} else {
console.log('[WS-REQUESTS-LIST] - THE PROJECT NOT HAS GROUPS - SHOW ALL TEAMMATES');
// console.log('[WS-REQUESTS-LIST] - THE PROJECT NOT HAS GROUPS - SHOW ALL TEAMMATES');
this.filteredProjectUsersArray = projectUserArray
}
}, (error) => {
Expand Down Expand Up @@ -1104,7 +1105,7 @@ export class WsRequestsListComponent extends WsSharedComponent implements OnInit
// DEPTS_LAZY: add this
addDeptObject(wsrequests) {
this.departmentService.getDeptsByProjectIdToPromise().then((_departments: any) => {
console.log('[WS-REQUESTS-LIST] - (DEPTS_LAZY) GET DEPTS BY PROJECT-ID toPromise', _departments);
// console.log('[WS-REQUESTS-LIST] - (DEPTS_LAZY) GET DEPTS BY PROJECT-ID toPromise', _departments);

wsrequests.forEach(request => {
if (request.department) {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/demo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ my-app .main-panel .main-content .card {
padding: 0px;
display: inline-block;
flex: 1 1 32px;
margin-left: 15px;
// margin-left: 15px;
cursor: pointer;
}

Expand Down

0 comments on commit d347a49

Please sign in to comment.