Skip to content
This repository was archived by the owner on Nov 7, 2018. It is now read-only.

Commit de15ec9

Browse files
authored
Merge pull request #12 from teresita-guerrero/issue7
Extremely long strings displayed on UserStory table - fix Fixes #7
2 parents 837c846 + d356137 commit de15ec9

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

dashboard-project-app/client/app/projectDetail/controllers/projectDetail.controller.js

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
(function(){
2+
(function () {
33

44
angular.module('dashboardProjectApp')
55
.controller('projectDetailController', ['$scope','$state', 'UserStory', '$location',
@@ -39,19 +39,30 @@
3939
$scope.actualProject = {};
4040

4141
function getFile() {
42-
43-
UserStory.findById({id:$scope.taskId},
44-
function success(userStory) {
45-
$scope.userStory = userStory;
46-
47-
$scope.userStory.updatedOn = moment($scope.userStory.updatedOn).format("MM-DD-YYYY");
48-
for(var key in $scope.userStory.tasks_status) {
49-
$scope.actualProject[key] = $scope.userStory.tasks_status[key].projects[0]
42+
UserStory.findById({id:$scope.taskId},
43+
function success(userStory) {
44+
$scope.userStory = userStory;
45+
46+
// Formating User Story name
47+
if ((userStory.description).length > 100) {
48+
$scope.userStory.shortDescription = userStory.
49+
description.substr(0,50) + " ...";
50+
}
51+
else {
52+
$scope.userStory.shortDescription = userStory.
53+
description;
54+
}
55+
56+
$scope.userStory.updatedOn = moment($scope.userStory.
57+
updatedOn).format("MM-DD-YYYY");
58+
for(var key in $scope.userStory.tasks_status) {
59+
$scope.actualProject[key] = $scope.userStory.
60+
tasks_status[key].projects[0]
61+
}
62+
}, function onError(error){
63+
$location.path('/projectDetail/notFound/' + $scope.taskId);
5064
}
51-
52-
}, function onError(error){
53-
$location.path('/projectDetail/notFound/' + $scope.taskId);
54-
});
65+
);
5566
};
5667

5768
$scope.selectProject = function(keyProject, idTask){
@@ -76,7 +87,8 @@
7687
}])
7788
.filter('capitalize', function() {
7889
return function(input) {
79-
return (!!input) ? input.charAt(0).toUpperCase() + input.substr(1).toLowerCase() : '';
90+
return (!!input) ? input.charAt(0).toUpperCase() + input.substr(1).
91+
toLowerCase() : '';
8092
}
8193
})
8294
.filter('removeDashes', function() {

dashboard-project-app/client/app/projectDetail/views/quickResume.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<div class="well frm-well">
44
<div class="row">
55
<div class="col-xs-11">
6-
<div class="dp-title ">
7-
{{userStory.description}}
6+
<div class="dp-title" data-toggle="tooltip" title="{{userStory.description}}">
7+
{{userStory.shortDescription}}
88
<span class="dp-label label label-primary dp-label-{{userStory.status}}">
99
{{userStory.status | removeDashes | capitalize}}
1010
</span>

dashboard-project-app/client/app/projectList/styles/projectList.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@
2323
.fixed-table-toolbar .bars, .fixed-table-toolbar .search, .fixed-table-toolbar .columns{
2424
margin-bottom: 25px;
2525
}
26+
.fixed-table-container tbody td {
27+
max-width:200px; /* Customise it accordingly */
28+
white-space: nowrap;
29+
overflow: hidden;
30+
text-overflow: ellipsis;
31+
}

0 commit comments

Comments
 (0)