Skip to content

Commit

Permalink
Merge pull request #641 from Worktez/dev-angular
Browse files Browse the repository at this point in the history
Internal Release 6.1.1
  • Loading branch information
simran142002 authored Jul 23, 2022
2 parents 87edb30 + 37cf453 commit 0674e3a
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 28 deletions.
9 changes: 9 additions & 0 deletions firestore.indexes.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
{ "fieldPath": "SprintNumber", "order": "ASCENDING" }
]
},
{
"collectionGroup": "Tasks",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "SprintNumber", "order": "ASCENDING" },
{ "fieldPath": "TeamId", "order": "ASCENDING" },
{ "fieldPath": "Status", "order": "ASCENDING" }
]
},
{
"collectionGroup": "Notifications",
"queryScope": "COLLECTION",
Expand Down
2 changes: 2 additions & 0 deletions functions/model/sprints/tark/updateSprintStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ exports.updateSprintStatus = function(request, response) {
const appKey = request.body.data.AppKey;
const teamId = request.body.data.TeamId;
const uid = request.body.data.Uid;
const date = request.body.data.Date;
let orgDomain;
let result;
let status = 200;
Expand All @@ -55,6 +56,7 @@ exports.updateSprintStatus = function(request, response) {
updateSprintStatusInputJson = {
Status: sprintStatus,
EndStoryPoint: sprintDoc.CompletedStoryPoint,
EndDate: date,
};
message = "Updated Sprint Status As Completed";
}
Expand Down
5 changes: 3 additions & 2 deletions functions/model/tasks/tark/editTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ exports.editTask = function(request, response) {
const editedSprintName = createSprintName(editedSprintNumber);
const type = request.body.data.Type;
const reporter = request.body.data.Reporter;
const milestoneId = request.body.data.MilestoneId;
// const milestoneId = request.body.data.MilestoneId;
// console.log("Milestone Id from Edit task", milestoneId);
let result;
let status = 200;
let assigneeName = "";
Expand Down Expand Up @@ -211,7 +212,7 @@ exports.editTask = function(request, response) {
Status: taskStatus,
Reporter: reporter,
LastUpdatedDate: date,
MilestoneId: milestoneId,
// MilestoneId: milestoneId,
};

const p3 = getUser(uid, "").then((data) => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const routes: Routes = [
{ path: 'TasksEvaluation', component: TasksEvaluationComponent, canActivate: [AngularFireAuthGuard] },
{ path: 'TaskDetails/:taskId', component: TaskDetailsComponent, canActivate: [AngularFireAuthGuard] },
{ path: 'MyDashboard', component: MyDashBoardComponent, canActivate: [AngularFireAuthGuard] },
{ path: '', component: SocialPageComponent},
{ path: 'Social', component: SocialPageComponent},
{ path: 'FilterPage', component: FilterPageComponent},
{ path: 'CreateNewOrganization', component: CreateNewOrganizationComponent, canActivate: [AngularFireAuthGuard] },
{ path: 'CreateNewTeam', component: CreateNewTeamComponent, canActivate: [AngularFireAuthGuard] },
Expand Down
17 changes: 15 additions & 2 deletions src/app/body/board/sprint-details/sprint-details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import { Sprint } from 'src/app/Interface/TeamInterface';
import { PopupHandlerService } from 'src/app/services/popup-handler/popup-handler.service';
import { AuthService } from '../../../services/auth.service';
import { StartServiceService } from 'src/app/services/start/start-service.service';
import { ToolsService } from 'src/app/services/tool/tools.service';




@Component({
Expand All @@ -42,10 +45,12 @@ export class SprintDetailsComponent implements OnInit {
showLoader:boolean = false
sprintDataReady: boolean = false
activeSprintNumber: number;
todayDate: string;

constructor(public startService: StartServiceService, private authService: AuthService, public applicationSettingsService: ApplicationSettingsService, private functions: AngularFireFunctions, public errorHandlerService: ErrorHandlerService, public backendService: BackendService, private router: Router, public popupHandlerService: PopupHandlerService) { }
constructor(public startService: StartServiceService, private authService: AuthService, public applicationSettingsService: ApplicationSettingsService, public toolsService: ToolsService, private functions: AngularFireFunctions, public errorHandlerService: ErrorHandlerService, public backendService: BackendService, private router: Router,public popupHandlerService: PopupHandlerService) { }

ngOnInit(): void {
this.todayDate = this.toolsService.date();
this.applicationSettingsService.sprintDataObservable.subscribe((data) => {
this.sprintDataReady = true;
if(this.startService.currentSprintNumber == 0){
Expand All @@ -56,15 +61,18 @@ export class SprintDetailsComponent implements OnInit {
}
});
this.filterSprintNumber=this.startService.teamCurrentSprintNumber ;

}

changeSprintStatus(sprintStatus: string) {
this.showLoader = true;
const callable = this.functions.httpsCallable('sprints/updateSprintStatus');
const appKey = this.backendService.getOrganizationAppKey();
const uid = this.authService.getLoggedInUser();



callable({AppKey: appKey, CurrentSprintName: this.currentSprintName, SprintStatus: sprintStatus, TeamId: this.sprintData.TeamId, Uid: uid }).subscribe({
callable({AppKey: appKey, CurrentSprintName: this.currentSprintName, SprintStatus: sprintStatus, TeamId: this.sprintData.TeamId, Uid: uid, Date: this.todayDate}).subscribe({
next: (data) => {
console.log("Successful updated ");
},
Expand All @@ -76,6 +84,11 @@ export class SprintDetailsComponent implements OnInit {
complete: () => this.applicationSettingsService.sprintDataObservable.subscribe((data) => {
this.sprintData = data;
this.showLoader = false;
if(sprintStatus=='Completed'){
this.sprintData.EndDate= this.todayDate = this.toolsService.date().split('/').reverse().join('-');
this.workPercentage=100;

}
})
});
}
Expand Down
6 changes: 4 additions & 2 deletions src/app/body/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { NavbarHandlerService } from 'src/app/services/navbar-handler/navbar-han
import { ErrorHandlerService } from 'src/app/services/error-handler/error-handler.service';
import { AuthService } from '../../services/auth.service';
import { Location } from '@angular/common';
import { StartServiceService } from 'src/app/services/start/start-service.service';

@Component({
selector: 'app-login',
Expand All @@ -34,7 +35,7 @@ export class LoginComponent implements OnInit {
activeLogin: boolean = true
userExistChecked=false;

constructor(public authService: AuthService, public router: Router, public navbarHandler: NavbarHandlerService, public errorHandlerService: ErrorHandlerService, private location: Location) { }
constructor(public authService: AuthService, public router: Router, public navbarHandler: NavbarHandlerService, public errorHandlerService: ErrorHandlerService, private location: Location, public startService: StartServiceService) { }

ngOnInit(): void {
this.navbarHandler.resetNavbar();
Expand Down Expand Up @@ -89,7 +90,8 @@ export class LoginComponent implements OnInit {
}

navigateToHome() {
this.router.navigate(['/']);
this.router.navigate(['/Social']);
this.startService.startApplication();
}

navigateToVerification(path) {
Expand Down
2 changes: 2 additions & 0 deletions src/app/body/social-page/social-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export class SocialPageComponent implements OnInit {
this.authService.userAppSettingObservable.subscribe((data)=>{
this.pageReady = true;
this.loadSocialPageData();

});
}

Expand Down Expand Up @@ -92,6 +93,7 @@ export class SocialPageComponent implements OnInit {
this.loadSocialPageData();
}


loadRecentActivity(){
const newarray = this.posts.filter((data)=>{
if(this.authService.userAppSetting != undefined && data.Uid == this.authService.userAppSetting.uid) {
Expand Down
8 changes: 2 additions & 6 deletions src/app/body/task-details/edit-page/edit-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ export class EditPageComponent implements OnInit {
sprintNumber: number
currentSprintNumber: number
backlogSprintNumber: number
milestoneData=[]
milestoneId:string
estimatedTimeHrs: number
estimatedTimeMins: number

Expand Down Expand Up @@ -172,7 +170,7 @@ export class EditPageComponent implements OnInit {
return res;
});
if (condition) {
this.newVal = [this.editTask.Description, this.assigneeName.value, this.editTask.EstimatedTime, this.editTask.Priority, this.editTask.Difficulty, this.editTask.StoryPointNumber, this.editTask.Type, this.editTask.Status, this.editTask.Title, this.reporterName.value, this.milestoneId];
this.newVal = [this.editTask.Description, this.assigneeName.value, this.editTask.EstimatedTime, this.editTask.Priority, this.editTask.Difficulty, this.editTask.StoryPointNumber, this.editTask.Type, this.editTask.Status, this.editTask.Title, this.reporterName.value];
this.generateChanges();
console.log("Inputs are valid");
this.editPage();
Expand Down Expand Up @@ -202,8 +200,6 @@ export class EditPageComponent implements OnInit {
this.changedData = this.changedData + " title,";
if(this.prevVal[9] != this.newVal[9])
this.changedData = this.changedData + " reporter,";
if(this.prevVal[10] != this.newVal[10])
this.changedData = this.changedData + " milestoneId"
if (this.changedData != "")
this.changedData = "Edited-" + this.changedData;
this.changedData = this.changedData.substring(0, this.changedData.length - 1) + "."
Expand All @@ -214,7 +210,7 @@ export class EditPageComponent implements OnInit {
const appKey = this.backendService.getOrganizationAppKey();
if (!(this.task.Status === "Completed")) {
const callable = this.functions.httpsCallable('tasks/editTask');
await callable({Title: this.editTask.Title, Status: this.editTask.Status, AppKey: appKey, Id: this.editTask.Id, Description: this.editTask.Description, Priority: this.editTask.Priority, Difficulty: this.editTask.Difficulty, Assignee: this.assigneeName.value, EstimatedTime: this.editTask.EstimatedTime, Project: this.task.Project, SprintNumber: this.editTask.SprintNumber, StoryPointNumber: this.editTask.StoryPointNumber, OldStoryPointNumber: this.prevVal[5], PreviousId: this.previousSprintId, CreationDate: this.editTask.CreationDate, Date: this.todayDate, Time: this.time, ChangedData: this.changedData, Uid: this.authService.user.uid, Type:this.editTask.Type, Reporter: this.reporterName.value, MilestoneId: this.milestoneId}).subscribe({
await callable({Title: this.editTask.Title, Status: this.editTask.Status, AppKey: appKey, Id: this.editTask.Id, Description: this.editTask.Description, Priority: this.editTask.Priority, Difficulty: this.editTask.Difficulty, Assignee: this.assigneeName.value, EstimatedTime: this.editTask.EstimatedTime, Project: this.task.Project, SprintNumber: this.editTask.SprintNumber, StoryPointNumber: this.editTask.StoryPointNumber, OldStoryPointNumber: this.prevVal[5], PreviousId: this.previousSprintId, CreationDate: this.editTask.CreationDate, Date: this.todayDate, Time: this.time, ChangedData: this.changedData, Uid: this.authService.user.uid, Type:this.editTask.Type, Reporter: this.reporterName.value}).subscribe({
next: (data) => {
this.enableLoader = false;
this.showClose = true;
Expand Down
21 changes: 21 additions & 0 deletions src/app/body/team-details/team-details.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,31 @@ hr {
border-bottom: 2px solid var(--scrollbar-color);
}

#DeleteModalLabel{
text-align: left;
}

.modal-dialog {
height: 100%;
width: 600px;
display: flex;
align-items: center;
}

.modal-content {
margin: 0 auto;
background-color: var(--secondary-bg);
color: var(--primary-color);
}

.btn {
color: var(--text);
}

.btn-danger{
color: #ffff;
}

.btn:hover {
background-color: var(--dropdown-hover);
color: var(--button-text-hover);
Expand Down
22 changes: 19 additions & 3 deletions src/app/body/team-details/team-details.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ <h3>Team Id: {{ team.TeamId }}</h3>
</mat-icon>
</span>
<span class="btn">
<mat-icon fontSet="material-icons-outlined" class="align-middle" (click)="deleteTeam()" title="delete Team"
data-bs-toggle="tooltip">
<mat-icon fontSet="material-icons-outlined" class="align-middle" data-target="#deleteTeam" title="delete Team" type="button" data-toggle="modal"
data-bs-toggle="tooltip">
delete
</mat-icon>
</span>
Expand Down Expand Up @@ -98,7 +98,23 @@ <h2>Team Labels</h2>
<ng-container *ngIf="showLoader">
<app-loader></app-loader>
</ng-container>

<div class="modal fade" id="deleteTeam" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title" id="DeleteModalLabel">Confirmation Message</h2>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<div class="alert alert-danger" role="alert">Are you sure you want to delete this team?</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger" (click) = "deleteTeam()">Delete</button>
</div>
</div>
</div>
</div>
<ng-container *ngIf="updateTeamEnabled">
<app-update-team (teamUpdated)="teamUpdated($event)" [teamToUpdate]="teamToUpdate"></app-update-team>
</ng-container>
Expand Down
2 changes: 1 addition & 1 deletion src/app/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class HeaderComponent implements OnInit {
}

socialPage() {
this.router.navigate(['/']);
this.router.navigate(['/Social']);
}

filterPage(){
Expand Down
4 changes: 1 addition & 3 deletions src/app/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export class AuthService {
user: User;
userAppSetting: UserAppSetting;
public userName:string = "";
public landingToSocial: boolean = false;


educations: MyEducationData[];
public educationCollectionData: Observable<MyEducationData[]>

Expand Down Expand Up @@ -74,7 +73,6 @@ export class AuthService {

createUserData(user: User) {
const callable = this.functions.httpsCallable('users/createNewUser');
console.log("create new user from ui");
callable({ uid: user.uid, photoURL: user.photoURL, displayName: user.displayName, email: user.email, phoneNumber: user.phoneNumber, providerId: user.providerId }).subscribe({
next: (data) => {
console.log("Successful ");
Expand Down
14 changes: 6 additions & 8 deletions src/app/services/start/start-service.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ export class StartServiceService {

loadNext(SelectedOrgAppKey: string, SelectedTeamId: string, uid: string, AppTheme: string) {
this.userAppSettingsReady = true;
this.authService.landingToSocial = false
if (SelectedOrgAppKey != "") {
if (SelectedOrgAppKey != undefined && SelectedOrgAppKey != "") {
this.authService.organizationAvailable = true;
this.authService.getListedOrganizationData(uid);
this.backendService.getOrgDetails(SelectedOrgAppKey);
Expand All @@ -125,14 +124,11 @@ export class StartServiceService {
this.quickNotes.getQuickNotes();
} else {
this.authService.organizationAvailable = false;
this.router.navigate(['/Social']);
}
if (SelectedOrgAppKey) {
if(!this.authService.landingToSocial) {
this.authService.landingToSocial = true;
if(this.currentUrl == '/') {
this.router.navigate(['/MyDashboard']);
}

if(this.currentUrl == '/') {
this.router.navigate(['/MyDashboard']);
}
if(SelectedTeamId != "") {
this.selectedTeamId = SelectedTeamId;
Expand All @@ -158,6 +154,8 @@ export class StartServiceService {
this.applicationDataState.next(true);
console.log("TeamId doesn't exists");
}
} else {
this.router.navigate(['/Social']);
}
}

Expand Down

0 comments on commit 0674e3a

Please sign in to comment.