added username dialog
This commit is contained in:
parent
8ed2e3644a
commit
d215ded33f
4 changed files with 46 additions and 7 deletions
|
|
@ -98,6 +98,8 @@
|
||||||
@for (user of taskData.assigned; track user ) {
|
@for (user of taskData.assigned; track user ) {
|
||||||
<div
|
<div
|
||||||
class="circle"
|
class="circle"
|
||||||
|
(mousemove)="openDialog(user, $event)"
|
||||||
|
(mouseleave)="closeDialog()"
|
||||||
[ngStyle]="{
|
[ngStyle]="{
|
||||||
'background-color': firebaseService.getUserDetails(user, 'color')
|
'background-color': firebaseService.getUserDetails(user, 'color')
|
||||||
}"
|
}"
|
||||||
|
|
@ -108,6 +110,14 @@
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@if (AssignedDialogId != '') {
|
||||||
|
<div class="dialog" [style.left.px]="dialogX" [style.top.px]="dialogY">
|
||||||
|
<p>
|
||||||
|
{{ firebaseService.getUserDetails(AssignedDialogId, "firstName") }},
|
||||||
|
{{ firebaseService.getUserDetails(AssignedDialogId, "lastName") }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="middle-spacer"><div class="line"></div></div>
|
<div class="middle-spacer"><div class="line"></div></div>
|
||||||
<div class="right-side">
|
<div class="right-side">
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,21 @@ section {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dialog {
|
||||||
|
position: fixed;
|
||||||
|
width: min-content;
|
||||||
|
height: fit-content;
|
||||||
|
padding: 10px 15px;
|
||||||
|
border-radius: 0px 20px 20px 20px;
|
||||||
|
border: 1px solid var(--black);
|
||||||
|
z-index: 2;
|
||||||
|
background-color: var(--white);
|
||||||
|
p {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.edit-task-overlay-content {
|
.edit-task-overlay-content {
|
||||||
height: calc(700px - 128px);
|
height: calc(700px - 128px);
|
||||||
padding: 0 6px;
|
padding: 0 6px;
|
||||||
|
|
@ -112,6 +127,7 @@ p {
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
border: 2px solid var(--white);
|
border: 2px solid var(--white);
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
|
cursor: default;
|
||||||
.initials {
|
.initials {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,9 @@ export class AddTaskComponent {
|
||||||
searchValue: string = '';
|
searchValue: string = '';
|
||||||
searchInput: boolean = false;
|
searchInput: boolean = false;
|
||||||
filteredUsers: User[] = [];
|
filteredUsers: User[] = [];
|
||||||
|
AssignedDialogId: string = '';
|
||||||
|
dialogX: number = 0;
|
||||||
|
dialogY: number = 0;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public firebaseService: FirebaseService,
|
public firebaseService: FirebaseService,
|
||||||
|
|
@ -51,6 +54,20 @@ export class AddTaskComponent {
|
||||||
this.loadLocalStorageData();
|
this.loadLocalStorageData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openDialog(userId: any, event: MouseEvent) {
|
||||||
|
this.AssignedDialogId = userId;
|
||||||
|
this.updateDialogPosition(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateDialogPosition(event: MouseEvent) {
|
||||||
|
this.dialogX = event.clientX + 25;
|
||||||
|
this.dialogY = event.clientY + 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
closeDialog() {
|
||||||
|
this.AssignedDialogId = '';
|
||||||
|
}
|
||||||
|
|
||||||
loadEditTaskData() {
|
loadEditTaskData() {
|
||||||
if (this.overlayData !== '') {
|
if (this.overlayData !== '') {
|
||||||
const taskData = this.getTaskData(this.overlayData)[0];
|
const taskData = this.getTaskData(this.overlayData)[0];
|
||||||
|
|
|
||||||
|
|
@ -86,12 +86,8 @@ export class FirebaseService implements OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
async addNewTask(task: Task) {
|
async addNewTask(task: Task) {
|
||||||
await addDoc(collection(this.firestore, 'tasks'), task)
|
await addDoc(collection(this.firestore, 'tasks'), task).catch((err) => {
|
||||||
.catch((err) => {
|
|
||||||
console.error(err);
|
console.error(err);
|
||||||
})
|
|
||||||
.then((docRef) => {
|
|
||||||
console.log('Document written with ID: ', docRef?.id);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue