Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#44828] remove truncation from relation subjects

Eric Schubert8c9ed7c15078
diff --git a/frontend/src/app/features/hal/resources/work-package-resource.ts b/frontend/src/app/features/hal/resources/work-package-resource.ts
index a0677b97b2e..e5a98d03a3a 100644
--- a/frontend/src/app/features/hal/resources/work-package-resource.ts
+++ b/frontend/src/app/features/hal/resources/work-package-resource.ts
@@ -31,8 +31,12 @@ import { States } from 'core-app/core/states/states.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { InputState } from 'reactivestates';
-import { WorkPackagesActivityService } from 'core-app/features/work-packages/components/wp-single-view-tabs/activity-panel/wp-activity.service';
-import { WorkPackageNotificationService } from 'core-app/features/work-packages/services/notifications/work-package-notification.service';
+import {
+ WorkPackagesActivityService,
+} from 'core-app/features/work-packages/components/wp-single-view-tabs/activity-panel/wp-activity.service';
+import {
+ WorkPackageNotificationService,
+} from 'core-app/features/work-packages/services/notifications/work-package-notification.service';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { OpenProjectFileUploadService } from 'core-app/core/file-upload/op-file-upload.service';
@@ -169,8 +173,8 @@ export class WorkPackageBaseResource extends HalResource {
* Return "<subject> (#<id>)" if the id is known.
*/
public subjectWithId(truncateSubject = 40):string {
- const id = isNewResource(this) ? '' : ` (#${this.id})`;
- const subject = _.truncate(this.subject, { length: truncateSubject });
+ const id = isNewResource(this) ? '' : ` (#${this.id || ''})`;
+ const subject = truncateSubject <= 0 ? this.subject : _.truncate(this.subject, { length: truncateSubject });
return `${subject}${id}`;
}
diff --git a/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html b/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html
index 4dc1cac0df2..29e3990b57c 100644
--- a/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html
+++ b/frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html
@@ -38,8 +38,8 @@
<a uiSref="work-packages.show.tabs"
[uiParams]="{ workPackageId: relatedWorkPackage.id, tabIdentifier: 'relations' }"
class="wp-relations--subject-field"
- [textContent]="relatedWorkPackage.subjectWithId()"
- [attr.aria-label]="normalizedRelationType + ' ' + relatedWorkPackage.subjectWithId()">
+ [textContent]="relatedWorkPackage.subjectWithId(0)"
+ [attr.aria-label]="normalizedRelationType + ' ' + relatedWorkPackage.subjectWithId(0)">
</a>
</div>
diff --git a/frontend/src/global_styles/content/work_packages/tabs/_relations.sass b/frontend/src/global_styles/content/work_packages/tabs/_relations.sass
index 4eb283fa056..20e140c50f1 100644
--- a/frontend/src/global_styles/content/work_packages/tabs/_relations.sass
+++ b/frontend/src/global_styles/content/work_packages/tabs/_relations.sass
@@ -93,10 +93,6 @@
.wp-relations-status-field
margin-left: 2px
-// Break apart long subjects in the rather small block
-.wp-relations--subject-field
- word-break: break-all
-
// Relation description field
.wp-relation--description-read-value
@include unset-button-styles