Compare commits

..

No commits in common. "master" and "API_Dev" have entirely different histories.

20 changed files with 130 additions and 871 deletions

View file

@ -703,9 +703,9 @@ def getAllUserTasks(token):
taskDic['forSortDate'] = taskTime
ownerId = user.key().id()
if not t.isPersonal:
if t.isPersonal:
ownerId = user.key().id()
else:
project = Project.all().filter("courseId = ", course.key().id())
for p in project.run():
if str(p.key().id()) in user.projects_id_list:
@ -1114,7 +1114,6 @@ def getAllUnsubmittedTasks(token):
taskDic['isPersonal'] = task.isPersonal
taskDic['usersToReview'] = []
taskDic['projectsToReview'] = []
taskDic['id'] = task.key().id()
tgs = TaskGrade.all().filter("taskId = ", task.key().id())
tcs = TaskComponent.all().filter("taskId = ", task.key().id()).filter("order = ", 0).filter("userId != ", -1)

View file

@ -2,7 +2,6 @@ __author__ = 'etye'
import unittest
import requests
import json
import webbrowser
from Testing.config import __CONFIG__
class UserTestPlan(unittest.TestCase):
@classmethod
@ -70,18 +69,8 @@ class UserTestPlan(unittest.TestCase):
self.assertEquals(r.status_code, 200)
self.assertTrue(len(r.json())>= 1)
def test_campusesGet_validToken_hebrewToken(self):
r = requests.get(self.__class__.url_+'api/campuses/getAll/????')
self.assertEquals(r.status_code, 403)
# connectUserToCampus = self.__class__.url_+'http://localhost:8080/api/help/validation/confirm/TOKEN|post.jce.ac.il'
# webbrowser.open('http://eample.com')
#/api/campuses/getCampusesByUser/<string:token>
def test_getCampusesByUser_lecturerToken(self):
connectUserToCampus = self.__class__.url_+'api/help/validation/confirm/'++__CONFIG__['TOKENS']['LECTURER']+'|post.jce.ac.il'
webbrowser.open('http://localhost:8080/api/help/validation/confirm/_QA_TOKEN_TEST_LECTURER|post.jce.ac.il')
r = requests.get(self.__class__.url_+'api/campuses/getCampusesByUser/'+__CONFIG__['TOKENS']['LECTURER'])
self.assertEquals(r.status_code, 200)
if __name__ == '__main__':
unittest.main()

View file

@ -1,191 +0,0 @@
__author__ = 'etye'
import unittest
import requests
import json
#import logging
import datetime
from Testing.config import __CONFIG__
class MessagesTestPlan(unittest.TestCase):
@classmethod
def setUpClass(cls):
debug = __CONFIG__['DEBUG']
if debug:
url = __CONFIG__['PATHS']['DEBUG']
else:
url = __CONFIG__['PATHS']['PRODUCTION']
cls.url_ = url
request = requests.get(url+'api/qa/init')
if 200 <= request.status_code <= 299:
print 'Initialized'
'''
/api/messages/create/<string:token>
POST OPTIONS
token user payload e msg
This call will create a new Message in the DB
'''
def test_messageCreate_Student(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_+'api/messages/create/_QA_TOKEN_TEST_STUDENT'
#params = {'seToken': 'seToken' }
data = {
'groupId' : 123456789,
'message' : 'Class is canceled',
'isProject' : True
}
#r = requests.post(self.__class__.url_+'api/courses/create/'+__CONFIG__['TOKENS']['STUDENT'],data=payload)
r = requests.post(url, data=json.dumps(data), headers=headers)
self.assertEquals(r.status_code, 403, 'message: ' + r.json()['message'])
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
def test_messageCreate_Lecturer(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_+'api/messages/create/_QA_TOKEN_TEST_LECTURER'
#params = {'seToken': 'seToken' }
data = {
'groupId' : 123456789,
'message' : 'Class is canceled',
'isProject' : True
}
#r = requests.post(self.__class__.url_+'api/courses/create/'+__CONFIG__['TOKENS']['STUDENT'],data=payload)
r = requests.post(url, data=json.dumps(data), headers=headers)
self.assertEquals(r.status_code, 403, 'message: ' + r.json()['message'])
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
def test_messageCreate_INVALIDTOKEN(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_+'api/messages/create/invlaidToken'
#params = {'seToken': 'seToken' }
data = {
'groupId' : 123456789,
'message' : 'Class is canceled',
'isProject' : True
}
#r = requests.post(self.__class__.url_+'api/courses/create/'+__CONFIG__['TOKENS']['STUDENT'],data=payload)
r = requests.post(url, data=json.dumps(data), headers=headers)
self.assertEquals(r.status_code, 403, 'message: ' + r.json()['message'])
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
'''
/api/messages/deleteMessage/<string:token>/<string:msgId>
OPTIONS DELETE
token msgId user msg e
>This Call will delete a message by owner token
Route Parameters
- SeToken: token - msgId: 1234567890
Payload
- NONE
'''
def test_deleteMessage_Student(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
#create Message and get the id to call delete message API REST
r = requests.delete(self.__class__.url_+'api/messages/deleteMessage/_QA_TOKEN_TEST_STUDENT/<string:msgID')
self.assertEquals(r.status_code, 204)
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
def test_deleteMessage_Lecturer(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
#create Message and get the id to call delete message API REST
r = requests.delete(self.__class__.url_+'api/messages/deleteMessage/_QA_TOKEN_TEST_LECTURER/<string:msgID')
self.assertEquals(r.status_code, 204)
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
def test_deleteMessage_invalidToken(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
#create Message and get the id to call delete message API REST
r = requests.delete(self.__class__.url_+'api/messages/deleteMessage/InvalidToken/<string:msgID')
self.assertEquals(r.status_code, 204)
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
'''
/api/messages/getAllUserMessages/<string:token>
HEAD OPTIONS GET
token user arr allMsgs projectMsgs m msgDic msgTime i
>This Call will return an array of all messages (sorted by date),
Route Parameters
- SeToken: token
- groupId: 1234567890
Payload
- NONE
'''
def test_getAllUserMessages_Lecturer(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
#create Message and get the id to call delete message API REST
r = requests.get(self.__class__.url_+'api/messages/getAllUserMessages/_QA_TOKEN_TEST_LECTURER')
self.assertEquals(r.status_code, 200)
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
def test_getAllUserMessages_STUDENT(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
#create Message and get the id to call delete message API REST
r = requests.get(self.__class__.url_+'api/messages/getAllUserMessages/_QA_TOKEN_TEST_STUDENT')
self.assertEquals(r.status_code, 200)
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
'''
/api/messages/create/<string:token>
POST OPTIONS
token user payload e msg
This call will create a new Message in the DB
Route Parameters
- seToken: 'seToken'
Payload
- JSON Object, Example:
{
'groupId' : 123456789,
'message' : 'Class is canceled',
'isProject' : true
}
'''

View file

@ -1 +0,0 @@
__author__ = 'etye'

View file

@ -1,396 +0,0 @@
__author__ = 'etye'
import unittest
import requests
import json
#import logging
import datetime
from Testing.config import __CONFIG__
class TaskTestPlan(unittest.TestCase):
@classmethod
def setUpClass(cls):
debug = __CONFIG__['DEBUG']
if debug:
url = __CONFIG__['PATHS']['DEBUG']
else:
url = __CONFIG__['PATHS']['PRODUCTION']
cls.url_ = url
request = requests.get(url+'api/qa/init')
if 200 <= request.status_code <= 299:
print 'Initialized'
'''
/api/tasks/create/<string:token>
POST OPTIONS
'''
def test_tasks_create_LectureToken(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_+'api/tasks/create/_QA_TOKEN_TEST_LECTURER'
#params = {'seToken': 'seToken' }
data = {
'title':'task1',
'courseId':1234567890,
'description':'pls fddfsdfdsk',
'dueDate':{'year':2010,
'month':2,
'day':4
}, 'isPersonal':True,
'components':[
{
'type' : 'should be type1',
'label' : 'should be label1',
'isMandatory' : True,
'order' : 1
},
{
'type' : 'should be type2',
'label' : 'should be label2',
'isMandatory' : True,
'order' : 2
},
{
'type' : 'should be type3',
'label' : 'should be label3',
'isMandatory' : False,
'order' : 3
}
]
}
#r = requests.post(self.__class__.url_+'api/courses/create/'+__CONFIG__['TOKENS']['STUDENT'],data=payload)
r = requests.post(url, data=json.dumps(data), headers=headers)
self.assertEquals(r.status_code, 201, 'message: ' + r.json()['message'])
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
def test_tasks_create_Student_Token(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_+'api/tasks/create/_QA_TOKEN_TEST_STUDENT'
#params = {'seToken': 'seToken' }
data = {
'title':'task1',
'courseId':1234567890,
'description':'pls fddfsdfdsk',
'dueDate':{'year':2010,
'month':2,
'day':4
}, 'isPersonal':True,
'components':[
{
'type' : 'should be type1',
'label' : 'should be label1',
'isMandatory' : True,
'order' : 1
},
{
'type' : 'should be type2',
'label' : 'should be label2',
'isMandatory' : True,
'order' : 2
},
{
'type' : 'should be type3',
'label' : 'should be label3',
'isMandatory' : False,
'order' : 3
}
]
}
#r = requests.post(self.__class__.url_+'api/courses/create/'+__CONFIG__['TOKENS']['STUDENT'],data=payload)
r = requests.post(url, data=json.dumps(data), headers=headers)
self.assertEquals(r.status_code, 201, 'message: ' + r.json()['message'])
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
def test_tasks_create_Student_Token(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_+'api/tasks/create/INVALIDTOKEN'
#params = {'seToken': 'seToken' }
data = {
'title':'task1',
'courseId':1234567890,
'description':'pls fddfsdfdsk',
'dueDate':{'year':2010,
'month':2,
'day':4
}, 'isPersonal':True,
'components':[
{
'type' : 'should be type1',
'label' : 'should be label1',
'isMandatory' : True,
'order' : 1
},
{
'type' : 'should be type2',
'label' : 'should be label2',
'isMandatory' : True,
'order' : 2
},
{
'type' : 'should be type3',
'label' : 'should be label3',
'isMandatory' : False,
'order' : 3
}
]
}
#r = requests.post(self.__class__.url_+'api/courses/create/'+__CONFIG__['TOKENS']['STUDENT'],data=payload)
r = requests.post(url, data=json.dumps(data), headers=headers)
self.assertEquals(r.status_code, 201, 'message: ' + r.json()['message'])
print("***********************************************")
print(self._testMethodName+"Has finished Successfully")
print("***********************************************")
'''
/api/tasks/submitGrade/<string:token>/<string:taskId>/<string:projectname>
'''
def test_submitGrade_Lecturer(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_ +'api/tasks/submitGrade/_QA_TOKEN_TEST_LECTURER/_QA__TEST_PROJECT/QA_TEST_PROJECT_NAME'
#params = {'seToken': 'seToken' }
data = {
'title': 'task1',
'courseId': 1234567890,
'description': 'plsfddfsdfdsk',
'dueDate': {
'year': 2010,
'month': 2,
'day': 4
},
'isPersonal': True,
'components': [{
'type': 'shouldbetype1',
'label': 'shouldbelabel1',
'isMandatory': True,
'order': 1
},
{
'type': 'shouldbetype2',
'label': 'shouldbelabel2',
'isMandatory': True,
'order': 2
},
{
'type': 'shouldbetype3',
'label': 'shouldbelabel3',
'isMandatory': False,
'order': 3
}]
}
r = requests.post(url, data=json.dumps(data), headers=headers)
print(r._content)
if(r.status_code!=201):print("_____"+self._testMethodName+" has Failed"+"_____" + r._content)
self.assertEquals(r.status_code, 201)
self.assertEquals(r.status_code, 201, 'message: ' + r.json()['message'])
def test_submitGrade_Student(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_ +'api/tasks/submitGrade/_QA_TOKEN_TEST_STUDENT/_QA__TEST_PROJECT/QA_TEST_PROJECT_NAME'
#params = {'seToken': 'seToken' }
data = {
'title': 'task1',
'courseId': 1234567890,
'description': 'plsfddfsdfdsk',
'dueDate': {
'year': 2010,
'month': 2,
'day': 4
},
'isPersonal': True,
'components': [{
'type': 'shouldbetype1',
'label': 'shouldbelabel1',
'isMandatory': True,
'order': 1
},
{
'type': 'shouldbetype2',
'label': 'shouldbelabel2',
'isMandatory': True,
'order': 2
},
{
'type': 'shouldbetype3',
'label': 'shouldbelabel3',
'isMandatory': False,
'order': 3
}]
}
r = requests.post(url, data=json.dumps(data), headers=headers)
print(r._content)
if(r.status_code!=201):print("_____"+self._testMethodName+" has Failed"+"_____" + r._content)
self.assertEquals(r.status_code, 404)
#self.assertEquals(r.status_code, 400, 'message: ' + r.json()['message'])
def test_submitGrade_INVALIDTOKEN(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_ +'api/tasks/submitGrade/InvalidToken/invalidId/InvalidProject'
#params = {'seToken': 'seToken' }
data = {
'title': 'task1',
'courseId': 1234567890,
'description': 'fun course',
'dueDate': {
'year': 2010,
'month': 2,
'day': 4
},
'isPersonal': True,
'components': [{
'type': 'shouldbetype1',
'label': 'shouldbelabel1',
'isMandatory': True,
'order': 1
},
{
'type': 'shouldbetype2',
'label': 'shouldbelabel2',
'isMandatory': True,
'order': 2
},
{
'type': 'shouldbetype3',
'label': 'shouldbelabel3',
'isMandatory': False,
'order': 3
}]
}
r = requests.post(url, data=json.dumps(data), headers=headers)
print(r._content)
if(r.status_code!=201):print("_____"+self._testMethodName+" has Failed"+"_____" + r._content)
self.assertEquals(r.status_code, 404)
'''
/api/tasks/submitTask/<string:token>/<string:taskId>/<stringProjectName>
'''
def test_submitTask_LECTURER(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_ +'api/tasks/submitTask/_QA_TOKEN_TEST_LECTURER/_QA__TEST_PROJECT/QA_TEST_PROJECT_NAME'
#params = {'seToken': 'seToken' }
data = {
'title': 'task1',
'courseId': 1234567890,
'description': 'plsfddfsdfdsk',
'dueDate': {
'year': 2010,
'month': 2,
'day': 4
},
'isPersonal': True,
'components': [{
'type': 'shouldbetype1',
'label': 'shouldbelabel1',
'isMandatory': True,
'order': 1
},
{
'type': 'shouldbetype2',
'label': 'shouldbelabel2',
'isMandatory': True,
'order': 2
},
{
'type': 'shouldbetype3',
'label': 'shouldbelabel3',
'isMandatory': False,
'order': 3
}]
}
r = requests.post(url, data=json.dumps(data), headers=headers)
print(r._content)
if(r.status_code!=201):print("_____"+self._testMethodName+" has Failed"+"_____" + r._content)
self.assertEquals(r.status_code, 500)
def test_submitTask_STUDENT(self):
print (datetime.datetime.now().time())
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
headers = {'content-type': 'application/json'}
url = self.__class__.url_ +'api/tasks/submitTask/_QA_TOKEN_TEST_STUDENT/_QA__TEST_PROJECT/QA_TEST_PROJECT_NAME'
#params = {'seToken': 'seToken' }
data = {
'title': 'task1',
'courseId': 1234567890,
'description': 'plsfddfsdfdsk',
'dueDate': {
'year': 2010,
'month': 2,
'day': 4
},
'isPersonal': True,
'components': [{
'type': 'shouldbetype1',
'label': 'shouldbelabel1',
'isMandatory': True,
'order': 1
},
{
'type': 'shouldbetype2',
'label': 'shouldbelabel2',
'isMandatory': True,
'order': 2
},
{
'type': 'shouldbetype3',
'label': 'shouldbelabel3',
'isMandatory': False,
'order': 3
}]
}
r = requests.post(url, data=json.dumps(data), headers=headers)
print(r._content)
if(r.status_code!=201):print("_____"+self._testMethodName+" has Failed"+"_____" + r._content)
self.assertEquals(r.status_code, 500)

View file

@ -271,7 +271,7 @@ class UserTestPlan(unittest.TestCase):
}
#r = requests.post(self.__class__.url_+'api/courses/create/'+__CONFIG__['TOKENS']['STUDENT'],data=payload)
r = requests.put(url, data=json.dumps(data), headers=headers)
self.assertEquals(r.status_code, 404)
self.assertEquals(r.status_code, 400)
def test_addUserToCampus_invalidToken(self):
headers = {'content-type': 'application/json'}
@ -282,7 +282,7 @@ class UserTestPlan(unittest.TestCase):
}
#r = requests.post(self.__class__.url_+'api/courses/create/'+__CONFIG__['TOKENS']['STUDENT'],data=payload)
r = requests.put(url, data=json.dumps(data), headers=headers)
self.assertEquals(r.status_code, 404)
self.assertEquals(r.status_code, 400)
'''
def test_addUserToCourse_invalidToken(self):
@ -311,13 +311,13 @@ class UserTestPlan(unittest.TestCase):
#url = self.__class__.url_+'api/users/getUserById/'+__CONFIG__['TOKENS']['STUDENT'] + '/'+__CONFIG__['ID']['STUDENT_ID']
url = 'http://localhost:8080/api/users/getUserById/_QA_TOKEN_TEST_STUDENT/6225984592281600'
r = requests.get(url)
self.assertEquals(r.status_code, 204)
self.assertEquals(r.status_code, 200)
def test_getUserById_lecturer(self):
#url = self.__class__.url_+'api/users/getUserById/'+__CONFIG__['TOKENS']['STUDENT'] + '/'+__CONFIG__['ID']['STUDENT_ID']
url = 'http://localhost:8080/api/users/getUserById/_QA_TOKEN_TEST_LECTURER/6225984592281600'
r = requests.get(url)
self.assertEquals(r.status_code, 204)
self.assertEquals(r.status_code, 200)
def test_getUserById_invalidToken(self):
#url = self.__class__.url_+'api/users/getUserById/'+__CONFIG__['TOKENS']['STUDENT'] + '/'+__CONFIG__['ID']['STUDENT_ID']
@ -331,8 +331,8 @@ class UserTestPlan(unittest.TestCase):
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
url=self.__class__.url_+'api/users/getUsersByCampus/'+__CONFIG__['TOKENS']['STUDENT']+'/6736157987569664'#campus id
#url='http://localhost:8080/api/users/getUsersByCampus/_QA_TOKEN_TEST_STUDENT/6736157987569664'
#url=self.__class__.url_+'api/users/getUsersByCampus/'+__CONFIG__['TOKENS']['STUDENT']+'/6736157987569664'#campus id
url='http://localhost:8080/api/users/getUsersByCampus/_QA_TOKEN_TEST_STUDENT/6736157987569664'
r = requests.get(url)
self.assertEquals(r.status_code, 200)
print("***********************************************")
@ -344,8 +344,8 @@ class UserTestPlan(unittest.TestCase):
print("***********************************************")
print(self._testMethodName+"Has begun")
print("***********************************************")
url=self.__class__.url_+'api/users/getUsersByCampus/'+__CONFIG__['TOKENS']['LECTURER']+'/6736157987569664'#campus id
#url = 'http://localhost:8080/api/users/getUsersByCampus/_QA_TOKEN_TEST_STUDENT/6736157987569664'
#url=self.__class__.url_+'api/users/getUsersByCampus/'+__CONFIG__['TOKENS']['LECTURER']+'/6736157987569664'#campus id
url = 'http://localhost:8080/api/users/getUsersByCampus/_QA_TOKEN_TEST_STUDENT/6736157987569664'
r = requests.get(url)
self.assertEquals(r.status_code, 200)
print("***********************************************")

View file

@ -1 +0,0 @@
__author__ = 'etye'

View file

@ -2,7 +2,7 @@ __author__ = 'etye'
__CONFIG__ = {
'DEBUG': False,
'DEBUG': True,
'PATHS': {
'DEBUG': 'http://localhost:8080/',
'PRODUCTION': 'http://se-hub.appspot.com/'

View file

@ -1,17 +0,0 @@
indexes:
# AUTOGENERATED
# This index.yaml is automatically updated whenever the dev_appserver
# detects that a new type of query is run. If you want to manage the
# index.yaml file manually, remove the above marker line (the line
# saying "# AUTOGENERATED"). If you want to manage some indexes
# manually, move them above the marker line. The index.yaml file is
# automatically uploaded to the admin console when you next deploy
# your application using appcfg.py.
- kind: TaskComponent
properties:
- name: order
- name: taskId
- name: userId

View file

@ -92,11 +92,17 @@ body.noscroll
box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.75);
}
.md-toolbar-tools h1 {
font-size: inherit;
font-weight: inherit;
margin: inherit;
}
/* Added BY devMatan */
/*.disabledSubmitButton:
{
/*background: #f7f7f7;*/
/*border-radius: 10000px;*/
/*text-align: center;*/
/*position: relative !important;*
}*/
.campusAvatar img
{
@ -292,16 +298,6 @@ body.noscroll
cursor: pointer;
}
.hoverable{
cursor: pointer;
}
.hoverable:hover{
cursor: pointer;
background-color: #E2E2E2;
}
.se-menu li:active{
background-color: #B2B2B2;
text-shadow:#e0e0e0 1px 1px 0;

View file

@ -7,7 +7,6 @@ angular.module('SeHub')
$scope.oldText = "";
$scope.messages = [];
$scope.userMessages = [];
$scope.unSubmittedTasks = [];
$scope.userTasks = [];
$scope.messagesDisplay = [];
$scope.courses = [];
@ -67,9 +66,26 @@ angular.module('SeHub')
$scope.msg.msgToAdd = null;
}
$scope.reviewTask = function(taskId, groupId)
$scope.reviewTask = function(task)
{
$location.path('/tasks/overview/' + taskId + '/' + groupId + '/' + groupId);
//tasks/overview/:taskId/:submitterId/:gId', {
if(task.isPersonal) // As Lecturer
{
$location.path('/tasks/overview/' + task.id + '/' + $scope.user.id + '/' + $scope.user.id);
}
else // it's a project task
{
apiService.getProjectsByCourse(token, task.courseId).success(function(data)
{
for(var i = 0; i < $scope.user.projects_id_list.length; i++)
for(var j = 0; j < data.length; j++)
if($scope.user.projects_id_list[i] === data[j].id.toString())
$location.path('/tasks/overview/' + task.id + '/' + data[j].id + '/' + data[j].id);
}).error(function(err)
{
console.log(err.message);
});
}
}
$scope.gotoTask = function(task)
@ -176,11 +192,6 @@ angular.module('SeHub')
console.log($scope.courseObj);
}
$scope.getDate = function(msg){
return msg.date.day.toString() + "-" + msg.date.month.toString() +"-"+ msg.date.year.toString() + " " + msg.date.hour.toString() +":"+msg.date.minute.toString();
}
$scope.chooseProjectClicked = function()
{
console.log("choose project Clicked!!");
@ -193,16 +204,6 @@ angular.module('SeHub')
{
$scope.displayMessages(); // // Display all messages in message feed and the latest one
}
apiService.getAllUnsubmittedTasks(token).success(function(data)
{
console.log(data);
$scope.unSubmittedTasks = data;
}).error(function(err)
{
console.log(err.message);
});
// $scope.displayMessages();
$scope.displayTasks(); // Display all tasks in task feed and the latest one
// $scope.getProjects(); // Get all projects info

View file

@ -1,4 +1,4 @@
angular.module('SeHub').controller('newTasksController', ['$scope', 'apiService', '$cookies', '$location',
angular.module('SeHub').controller('newTasksController', ['$scope', 'apiService', '$cookies', '$location' ,
function($scope, apiService, $cookies, $location) {
$scope.newComp = {};
@ -44,10 +44,10 @@ angular.module('SeHub').controller('newTasksController', ['$scope', 'apiService'
day: payload.dueDate.getDate()
}
apiService.createTask(token, payload).success(function(data) {
apiService.createTask(token, payload).success(function(data){
$location.path('/tasks');
}).error(function(err) {
}).error(function(err){
console.error(err);
})
} else {
@ -95,10 +95,10 @@ angular.module('SeHub').controller('newTasksController', ['$scope', 'apiService'
var type = $scope.newComp.type;
comp.type = type;
comp.order = compOrder;
compOrder++;
compOrder ++;
comp.isMandatory = $scope.newComp.isMandatory;
comp.label = "";
var i = 0;
var i = 0
if (!(type === 'textbox' || type === 'textarea' || type === 'checkbox'))
while ($scope.newComp.label[i]) {
comp.label += $scope.newComp.label[i] + "|";

View file

@ -7,48 +7,35 @@ angular.module('SeHub')
$scope.isEditPressed = false;
$scope.user = $scope.$parent.user;
$scope.loadingData = true;
$scope.displayingMessages = true;
$scope.isMaster = false;
$scope.isMember = false;
$scope.project = [];
$scope.isInProject = false;
$scope.projectMessages = [];
$scope.msg = {};
$scope.isMaster = false;
$scope.isLecturer = $scope.user.isLecturer;
// $scope.thisProject = {};
// $scope.thisProject.courseName = $routeParams.className;
console.log($scope.user.id)
// console.log($scope.projectid)
$scope.getDate = function(msg){
return msg.date.day.toString() + "-" + msg.date.month.toString() +"-"+ msg.date.year.toString() + " " + msg.date.hour.toString() +":"+msg.date.minute.toString();
}
$scope.displayProjectMessages = function()
{
apiService.getAllUserMessages(token).success(function(data)
{
$scope.displayingMessages = false;
// for(var i = 0; i < data.length; i ++)
// if(!data.isPersonal)
$scope.projectMessages = data;
$scope.projectMessages = data;
}).error(function(err)
{
console.log(err.message);
console.log(err.message);
});
}
$scope.goToProfile = function(memberId)
{
$location.path('/profile/' + memberId);
$location.path('#/profile/' + memberId);
}
$scope.removeUserFromProject = function()
{
apiService.removeUserFromProject(token, $scope.user.id, projectId).success(function(data)
apiService.removeUserFromProject.success(function(data)
{
}).error(function(err)
@ -79,9 +66,6 @@ angular.module('SeHub')
$scope.removeProject = function(ev)
{
if($scope.user.id === $scope.project.master_id)
$scope.isMaster = true;
var confirm = $mdDialog.confirm().title('Remove Project').content('Would you like to delete this project?').ariaLabel('removeProj')
.ok('Please do it!').cancel('No').targetEvent(ev);
$mdDialog.show(confirm).then(function()
@ -95,7 +79,7 @@ angular.module('SeHub')
$location.path('/myProjects');
}).error(function(err)
{
$mdDialog.show($mdDialog.alert().title('Project Removal').content('Project removal failed - reason ' + err.message)
$mdDialog.show($mdDialog.alert().title('Project Removal').content('Project removal failed - reason' + err.message)
.ariaLabel('project remove alert dialog').ok('Try Again').targetEvent(ev));
});
},
@ -119,6 +103,9 @@ angular.module('SeHub')
'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)
{
@ -154,8 +141,6 @@ angular.module('SeHub')
apiService.getProjectsById(token, projectId).success(function(data)
{
$scope.project = data;
if($scope.user.id === $scope.project.master_id)
$scope.isMaster = true;
for(var i = 0; i < data.members.length; i++)
{
if($scope.user.id === data.members[i].id)

View file

@ -38,8 +38,6 @@ angular.module('SeHub')
$scope.readOnly = true;
} else { //In This Case We Need An Empty Task To Be Able To Fill It
if($scope.isMaster)
$location.path('/tasks');
$scope.readOnly = false;
}
@ -90,12 +88,7 @@ angular.module('SeHub')
$scope.submitTask = function(event) { //Dialog will pop-up if not all mandatory fields are filled
if (validateComponents()) {
payload = $scope.task.components;
for(var i = 0 ; i < payload.length ; i++){
if (payload[i].type === 'checkbox')
payload[i].value = payload[i].value.toString();
}
apiService.submitTask(token, taskId, groupId, payload).success(function(data) {
apiService.submitTask(token, taskId, groupId, $scope.task.components).success(function(data) {
$mdDialog.show(
$mdDialog.alert()
.title('Submitted!')
@ -108,9 +101,6 @@ angular.module('SeHub')
$location.path('/tasks/overview/' + taskId + '/' + groupId + '/' + groupId);
});
}).error(function(err)
{
console.log(err.message);
})
} else {
@ -148,7 +138,6 @@ angular.module('SeHub')
.ok('No Problem!')
.targetEvent(event)
);
console.error(err);
})
}

View file

@ -19,15 +19,11 @@ angular.module('SeHub')
///Need to show the List
$mdDialog.show({
controller: DialogController,
templateUrl: 'templates/views/UserStateList.html?v=1122231',
templateUrl: 'templates/views/UserStateList.html?v=1',
parent: $scope,
targetEvent: ev,
locals: {
data: {
task: task,
token: token,
isPersonal: isPersonal
}
data: {task: task, token: token, isPersonal: isPersonal}
}
})
.then(function(answer) {
@ -46,83 +42,35 @@ angular.module('SeHub')
ownerId = $scope.user.projects_id_list[j];
}
apiService.isTaskSubmitted(token, task.id, ownerId).success(function(data) {
if (data.submitted) {
if (ownerId)
$location.path('/tasks/overview/' + task.id + '/' + ownerId + '/' + ownerId);
else {
$mdDialog.show(
$mdDialog.alert()
.title('You Have No Project in this class')
.content('To Be Able To Fill A Project Task you need to be assigned to a project')
.ariaLabel('ddd')
.ok('Ok, ill join/create a project')
.targetEvent(event)
).then(function() {
$location.path('/campuses');
});
}
} else {
if (ownerId)
$location.path('/tasks/fill/' + task.id + '/' + ownerId);
else {
$mdDialog.show(
$mdDialog.alert()
.title('You Have No Project in this class')
.content('To Be Able To Fill A Project Task you need to be assigned to a project')
.ariaLabel('ddd')
.ok('Ok, ill join/create a project')
.targetEvent(event)
).then(function() {
$location.path('/campuses');
});
}
}
}).error(function(err) {
console.error(err);
});
if (data.submitted)
$location.path('/tasks/overview/' + task.id + '/' + ownerId + '/' + ownerId)
else
$location.path('/tasks/fill/' + task.id + '/' + ownerId)
})
}).error(function(err) {
console.error('Error: ', err);
});
} else {
apiService.isTaskSubmitted(token, task.id, $scope.user.id).success(function(data) {
if (data.submitted) {
$location.path('/tasks/overview/' + task.id + '/' + $scope.user.id + '/' + $scope.user.id);
} else {
$location.path('/tasks/fill/' + task.id + '/' + $scope.user.id);
}
}).error(function(err) {
console.error(err);
})
}
}
}
$scope.createNewTask = function() {
$location.path('/tasks/new');
}
function DialogController($scope, $mdDialog, data, apiService) {
console.log(apiService);
$scope.task = data.task;
$scope.isPersonal = data.isPersonal;
var token = data.token;
$scope.loading = true;
apiService.getUsersStateByTask(token, $scope.task.id).success(function(data) {
apiService.getUsersStateByTask(token, $scope.task.id).success(function(data){
$scope.classList = data;
$scope.loading = false;
}).error(function(err) {
}).error(function(err){
console.error(err);
$scope.hide();
})
$scope.goToTask = function(obj) {
$mdDialog.hide();
$location.path('/tasks/overview/' + $scope.task.id + '/' + obj.id + '/' + obj.id);
}
$scope.hide = function() {
$mdDialog.hide();

View file

@ -117,14 +117,6 @@ service.factory('apiService', ['$http', function($http) {
};
return $http(req);
},
getAllUnsubmittedTasks: function(token){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllUnsubmittedTasks/" + token;
req = {
method : "GET",
url : url
};
return $http(req);
},
getAllFutureTasks: function(token, courseId){
var url = (DEBUG ? "http://localhost:8080" : "http://se-hub.appspot.com") + "/api/tasks/getAllFutureTasks/" + token + "/" + courseId;
req = {

View file

@ -1,4 +1,4 @@
<md-dialog aria-label="Class Status" style='width: 60%'>
<md-dialog aria-label="Class Status" style='width: 80%'>
<form>
<md-toolbar>
<div class="md-toolbar-tools">
@ -10,14 +10,14 @@
</div>
</md-toolbar>
<md-dialog-conten layout-padding>
<!-- <div ng-if='loading'>
<div ng-if='loading'>
</div>
<div ng-if='!loading'>
<div ng-repeat="obj in classList">
<div layout='row' width='100%' max-height="20px">
<div layout='row' width='100%' >
<div>
<img ng-src="{{obj.avatar_url || obj.logo_url}}" alt="" class='campusAvatar' style='max-height=15px'>
<img ng-src="{{obj.avatar_url || obj.logo_url}}" alt="" class='campusAvatar' style='max-height:auto'>
</div>
<div class='spacer'></div>
<div>{{obj.name || obj.projectName}}</div>
@ -28,20 +28,9 @@
</div>
<md-divider ng-if="!$last"></md-divider>
</div>
</div> -->
<md-list>
<md-list-item class="md-3-line hoverable" ng-repeat="obj in classList" layout="row" ng-click='goToTask(obj)'>
<img ng-src="{{obj.avatar_url || obj.logo_url}}?{{$index}}" class="md-avatar" alt="{{obj.id}}" />
<div class="md-list-item-text">
<h4>{{obj.name || obj.projectName}}</h3>
<p>Grade: {{obj.grade.grade || "Not Yet Reviewed"}}</p>
<!-- <p>{{ item.notes }}</p> -->
</div>
</md-list-item>
</md-list>
</div>
</md-dialog-content>
<!-- <div class="md-actions" layout="row">
<div class="md-actions" layout="row">
<md-button href="http://en.wikipedia.org/wiki/Mango" target="_blank" hide show-md>
More on Wikipedia
</md-button>
@ -52,6 +41,6 @@
<md-button ng-click="answer('useful')" class="md-primary">
Useful
</md-button>
</div> -->
</div>
</form>
</md-dialog>

View file

@ -70,7 +70,6 @@
<div>
{{msg.group.courseName}}
{{msg.group.projectName}}
{{getDate(msg)}}
</div>
</div>
<div flex = "40">
@ -82,25 +81,16 @@
</md-tab>
<md-tab label="Tasks waiting for review">
<md-content class="md-padding">
<div ng-repeat = "course in unSubmittedTasks">
<md-card ng-repeat = "task in course.tasks" layout-padding>
Title: {{task.title}}
<br/>{{(task.isPersonal) ? "A personal task": "A project task"}}
<div ng-repeat = "uName in task.usersToReview">
<br></br>
<md-button ng-click="reviewTask(task.id, uName.id)">
Name: {{uName.name}}
</md-button>
</div>
<div ng-repeat = "projName in task.projectsToReview">
Title: {{task.title}}
<br></br>
<md-button ng-click="reviewTask(task.id, projName.id)">
Name: {{projName.projectName}}
</md-button>
</div>
</md-card>
</div>
<md-card ng-repeat = "task in userTasks" layout-padding>
<div>
Title:
<md-button ng-click="reviewTask(task)">
{{task.title}}
</md-button>
<br></br>
Description: {{task.description}}
</div>
</md-card>
</md-content>
</md-tab>
</md-tabs>
@ -122,15 +112,17 @@
</div>
<div>
Latest Message-
<md-card layout-margin layout-padding>
<md-card layout-margin layout-padding ng-if="!userMessages">
{{userMessages[0].message}}
</md-card>
<md-card layout-margin layout-padding ng-if="userMessages">
No Messages.
</md-card>
</div>
</div>
<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>
<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">
@ -158,18 +150,17 @@
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Messages">
<md-card ng-repeat = "msg in userMessages">
<div layout = "row" layout-padding>
<div flex = "10" class="md-avatar">
<img ng-src="{{msg.user.avatar_url}}" style="width:80%">
<div layout = "column" layout-padding>
<div flex = "30" class="md-avatar">
<img ng-src="{{msg.user.avatar_url}}" style="width:100%">
</div>
<div flex = "20" layout = "column">
<div flex = "20" layout = "row">
<div>
{{msg.user.username}}
</div>
<div>
{{msg.group.courseName}}
{{msg.group.projectName}}
{{getDate(msg)}}
</div>
</div>
<div flex = "40">

View file

@ -18,7 +18,7 @@
<div layout = "row" flex = "45">
<!-- <div ng-if = "isMasterOrLecturer"> -->
<md-card layout = "row">
<div ng-if="!isLecturer && !isMember && !isInProject" layout-padding>
<div ng-if="!isMember && !isInProject" layout-padding>
<md-button ng-click="joinProject($event)" ng class = "md-raised md-primary" aria-label="jP">
<i class="fa fa-user-plus"></i>
</md-button>
@ -44,20 +44,20 @@
Team Members:
<ul layout-padding>
<div layout = "column" ng-repeat = "member in project.members">
<div layout = "row">
<div>
<md-button ng-click = "goToProfile(member.id)">
{{member.name}}
</md-button>
</div>
<div ng-if="isMaster">
<!-- <li ng-repeat = "member in project.members"> -->
<div layout = "row">
<div>
<md-button ng-click = "goToProfile(member.id)">
{{member.name}}
</md-button>
</div>
<div ng-if = "isEditPressed">
<md-button ng-click="removeUserFromProject()" ng class="md-raised md-primary" aria-label="rU">
<i class="fa fa-times"></i>
</md-button>
</div>
</div>
</div>
<!-- </li> -->
</div>
</ul>
</div>
@ -100,34 +100,28 @@
<div flex = "96" style="height:70%;">
<div flex>
<md-card>
<md-content>
<md-content class="md-padding">
<md-tabs md-dynamic-height md-border-bottom>
<md-tab label="Messages">
<div ng-if="displayingMessages" layout-paddig layout-margin class="loader">
<md-progress-circular md-mode="indeterminate"></md-progress-circular>
</div>
<md-content class="tabDesign">
<md-card ng-repeat = "msg in projectMessages">
<div layout = "row" layout-padding ng-if="!displayingMessages && msg.isProject && msg.groupId == project.id">
<div flex = "10">
<img ng-src="{{msg.user.avatar_url}}" style="width:80%">
<md-card ng-repeat = "msg in userMessages">
<div layout = "column" layout-padding>
<div flex = "30" class="md-avatar">
<img ng-src="{{msg.user.avatar_url}}" style="width:100%">
</div>
<div flex = "20" layout = "row">
<div>
{{msg.user.username}}
</div>
<div flex = "20" layout = "column">
<div>
{{msg.user.username}}
</div>
<div>
{{msg.group.courseName}}
{{msg.group.projectName}}
{{getDate(msg)}}
</div>
</div>
<div flex = "40">
{{msg.message}}
<div>
{{msg.group.courseName}}
{{msg.group.projectName}}
</div>
</div>
</md-card>
</md-content>
<div flex = "40">
{{msg.message}}
</div>
</div>
</md-card>
</md-tab>
<md-tab label="Commits">
<md-content class="tabDesign">
@ -139,21 +133,21 @@
</tr>
<tr ng-repeat = "commit in project.info.commits" layout-margin align = "center">
<td>
<span>
<span ng-repeat = "msg in commit">
<a target = "_blank"ng-href="{{commit.html_url}}"
style="text-decoration:none; color:black;">
{{commit.commit.message}}
{{msg.message}}
</a>
</span>
</td>
<td>
<span >
{{commit.commit.committer.date}}
<span ng-repeat = "date in commit.author">
{{date.date}}
</span>
</td>
<td >
<td ng-repeat = "member in project.members">
<a ng-href="#/profile/{{member.id}}" style="text-decoration:none; color:black;">
{{commit.commit.committer.name}}
{{member.name}}
</a>
</td>
</tr>
@ -186,7 +180,7 @@
{{issue.milestone.title}}
</td>
<td>
<span>
<span ng-repeat = "member in project.members">
<a ng-href = "{{getProfileRoute(issue.assignee.login)}}" style="text-decoration:none; color:black;">
{{issue.assignee.login}}
</a>
@ -197,12 +191,12 @@
</table>
</md-content>
</md-tab>
<!-- <md-tab label="tasks">
<md-tab label="tasks">
<md-content class="md-padding">
<h1 class="md-display-2">tasks</h1>
<p>tasks..</p>
</md-content>
</md-tab> -->
</md-tab>
</md-tabs>
</md-content>
</md-card>

View file

@ -101,14 +101,6 @@
</md-content>
</md-tab>
</md-tabs>
<div style='position:fixed;bottom:15px;right:15px'>
<md-button class="md-fab md-primary" ng-click='createNewTask()'>
<md-tooltip md-direction='top' >
Create New Task
</md-tooltip>
<i class="fa fa-plus"></i>
</md-button>
</div>
</md-content>
</div>
</md-content>