- team members in project - fixed
This commit is contained in:
parent
ed4a7e2568
commit
df3f3d4ada
4 changed files with 94 additions and 54 deletions
|
@ -4,7 +4,6 @@ angular.module('SeHub')
|
||||||
{
|
{
|
||||||
$scope.isStudent = false;
|
$scope.isStudent = false;
|
||||||
$scope.addMsg = false;
|
$scope.addMsg = false;
|
||||||
$scope.msgToPost = "";
|
|
||||||
$scope.oldText = "";
|
$scope.oldText = "";
|
||||||
$scope.messages = [];
|
$scope.messages = [];
|
||||||
$scope.userMessages = [];
|
$scope.userMessages = [];
|
||||||
|
@ -44,7 +43,6 @@ angular.module('SeHub')
|
||||||
}
|
}
|
||||||
$scope.postMessageClicked = function() // Posting the message itself
|
$scope.postMessageClicked = function() // Posting the message itself
|
||||||
{
|
{
|
||||||
console.log($scope.courseObj);
|
|
||||||
if($scope.msg.msgToAdd != null && $scope.courseObj.courseName)
|
if($scope.msg.msgToAdd != null && $scope.courseObj.courseName)
|
||||||
{
|
{
|
||||||
jsonNewMsg = {
|
jsonNewMsg = {
|
||||||
|
@ -81,13 +79,8 @@ angular.module('SeHub')
|
||||||
{
|
{
|
||||||
for(var i = 0; i < $scope.user.projects_id_list.length; i++)
|
for(var i = 0; i < $scope.user.projects_id_list.length; i++)
|
||||||
for(var j = 0; j < data.length; j++)
|
for(var j = 0; j < data.length; j++)
|
||||||
{
|
|
||||||
if($scope.user.projects_id_list[i] === data[j].id.toString())
|
if($scope.user.projects_id_list[i] === data[j].id.toString())
|
||||||
{
|
|
||||||
// $location.path('/tasks/fill/' + task.id + '/' + data[j].id);
|
|
||||||
$location.path('/tasks/overview/' + task.id + '/' + data[j].id + '/' + data[j].id);
|
$location.path('/tasks/overview/' + task.id + '/' + data[j].id + '/' + data[j].id);
|
||||||
}
|
|
||||||
}
|
|
||||||
}).error(function(err)
|
}).error(function(err)
|
||||||
{
|
{
|
||||||
console.log(err.message);
|
console.log(err.message);
|
||||||
|
@ -97,7 +90,6 @@ angular.module('SeHub')
|
||||||
|
|
||||||
$scope.gotoTask = function(task)
|
$scope.gotoTask = function(task)
|
||||||
{
|
{
|
||||||
// console.log(task);
|
|
||||||
if(task.isPersonal)
|
if(task.isPersonal)
|
||||||
{
|
{
|
||||||
$location.path('/tasks/fill/' + task.id + '/' + $scope.user.id);
|
$location.path('/tasks/fill/' + task.id + '/' + $scope.user.id);
|
||||||
|
|
|
@ -12,6 +12,7 @@ angular.module('SeHub')
|
||||||
$scope.project = [];
|
$scope.project = [];
|
||||||
$scope.isInProject = false;
|
$scope.isInProject = false;
|
||||||
$scope.projectMessages = [];
|
$scope.projectMessages = [];
|
||||||
|
$scope.msg = {};
|
||||||
|
|
||||||
// $scope.thisProject = {};
|
// $scope.thisProject = {};
|
||||||
// $scope.thisProject.courseName = $routeParams.className;
|
// $scope.thisProject.courseName = $routeParams.className;
|
||||||
|
@ -26,8 +27,6 @@ angular.module('SeHub')
|
||||||
{
|
{
|
||||||
console.log(err.message);
|
console.log(err.message);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.goToProfile = function(memberId)
|
$scope.goToProfile = function(memberId)
|
||||||
|
@ -86,12 +85,44 @@ angular.module('SeHub')
|
||||||
},
|
},
|
||||||
function()
|
function()
|
||||||
{ // No - Dont remove
|
{ // No - Dont remove
|
||||||
console.log("Not removed");
|
|
||||||
|
|
||||||
});
|
});
|
||||||
// $location.path('/class/' + data.id + '/' + data.courseName); // Will display all the projects in this course
|
// $location.path('/class/' + data.id + '/' + data.courseName); // Will display all the projects in this course
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.addMessageClicked = function()
|
||||||
|
{
|
||||||
|
$scope.addMsg = !$scope.addMsg; // Reveal the "POST" Button
|
||||||
|
}
|
||||||
|
$scope.postMessageClicked = function() // Posting the message itself
|
||||||
|
{
|
||||||
|
if($scope.msg.msgToAdd != null)
|
||||||
|
{
|
||||||
|
// console.log(msg.msgToAdd);
|
||||||
|
jsonNewMsg = {
|
||||||
|
'groupId': parseInt(projectId), // TODO Should be ===> $scope.courseObj.id
|
||||||
|
'message': $scope.msg.msgToAdd,
|
||||||
|
'isProject': true
|
||||||
|
};
|
||||||
|
console.log(jsonNewMsg.message);
|
||||||
|
console.log(jsonNewMsg.groupId);
|
||||||
|
console.log(jsonNewMsg.isProject);
|
||||||
|
|
||||||
|
apiService.createMessage(token, jsonNewMsg).success(function(data)
|
||||||
|
{
|
||||||
|
$scope.projectMessages.push(data);
|
||||||
|
}).error(function(err)
|
||||||
|
{
|
||||||
|
console.log(err.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$mdDialog.show($mdDialog.alert().title('Error Creating Message').content('Message content or Course is missing')
|
||||||
|
.ariaLabel('Send Message alert dialog').ok('Try Again!').targetEvent()); // Pop-up alert
|
||||||
|
}
|
||||||
|
$scope.msg.msgToAdd = null;
|
||||||
|
}
|
||||||
|
|
||||||
$scope.getProfileRoute = function(userName)
|
$scope.getProfileRoute = function(userName)
|
||||||
{
|
{
|
||||||
for(var i = 0; i < $scope.project.members.length; i++)
|
for(var i = 0; i < $scope.project.members.length; i++)
|
||||||
|
@ -143,6 +174,7 @@ angular.module('SeHub')
|
||||||
console.log(err.message);
|
console.log(err.message);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$scope.getProjectInfo(); // Get all this project data
|
|
||||||
$scope.displayProjectMessages(); // Display all messages in project
|
$scope.displayProjectMessages(); // Display all messages in project
|
||||||
|
$scope.getProjectInfo(); // Get all this project data
|
||||||
|
|
||||||
}]);
|
}]);
|
|
@ -128,7 +128,6 @@
|
||||||
<div ng-if="addMsg">
|
<div ng-if="addMsg">
|
||||||
<div layout = "row" layout-margin layout padding layout-align = "left center">
|
<div layout = "row" layout-margin layout padding layout-align = "left center">
|
||||||
<md-button ng-click="postMessageClicked()" ng class="md-raised md-primary">Post</md-button>
|
<md-button ng-click="postMessageClicked()" ng class="md-raised md-primary">Post</md-button>
|
||||||
<md-button ng-click="clearAllClicked()" ng class="md-raised md-primary">Clear All</md-button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="port_spacer"></div>
|
<div class="port_spacer"></div>
|
||||||
<div layout-padding layout = "row">
|
<div layout-padding layout = "row">
|
||||||
|
|
|
@ -77,6 +77,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</md-card>
|
</md-card>
|
||||||
|
<div class ="addMessage" layout="row" layout-margin layout padding>
|
||||||
|
<div>
|
||||||
|
<md-button ng-click="addMessageClicked()" ng class="md-raised md-primary" aria-label="aM"><i class="fa fa-comments"></i></md-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-if="addMsg">
|
||||||
|
<div layout = "row" layout-margin layout padding layout-align = "left center">
|
||||||
|
<md-button ng-click="postMessageClicked()" ng class="md-raised md-primary">Post</md-button>
|
||||||
|
</div>
|
||||||
|
<div class="port_spacer"></div>
|
||||||
|
<div layout-padding layout = "row">
|
||||||
|
<div flex = "60">
|
||||||
|
<md-input-container>
|
||||||
|
<label> Write Your Desired Message Here And Press Post</label>
|
||||||
|
<input type="text" minlength="1" ng-model="msg.msgToAdd" required></input>
|
||||||
|
</md-input-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div flex = "96" style="height:70%;">
|
<div flex = "96" style="height:70%;">
|
||||||
<div flex>
|
<div flex>
|
||||||
|
@ -84,7 +103,6 @@
|
||||||
<md-content class="md-padding">
|
<md-content class="md-padding">
|
||||||
<md-tabs md-dynamic-height md-border-bottom>
|
<md-tabs md-dynamic-height md-border-bottom>
|
||||||
<md-tab label="Messages">
|
<md-tab label="Messages">
|
||||||
<!-- <md-content class="md-padding"> -->
|
|
||||||
<md-card ng-repeat = "msg in userMessages">
|
<md-card ng-repeat = "msg in userMessages">
|
||||||
<div layout = "column" layout-padding>
|
<div layout = "column" layout-padding>
|
||||||
<div flex = "30" class="md-avatar">
|
<div flex = "30" class="md-avatar">
|
||||||
|
@ -104,7 +122,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</md-card>
|
</md-card>
|
||||||
<!-- </md-content> -->
|
|
||||||
</md-tab>
|
</md-tab>
|
||||||
<md-tab label="Commits">
|
<md-tab label="Commits">
|
||||||
<md-content class="tabDesign">
|
<md-content class="tabDesign">
|
||||||
|
|
Loading…
Reference in a new issue