Merge pull request #10976 from Rincewind34/feature/43239-correct-wptype-styling-in-relations

Added highlighting for wp-type in relation table
pull/10946/head
Oliver Günther 2 years ago committed by GitHub
commit e5457289ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.component.ts
  2. 1
      frontend/src/app/features/work-packages/components/wp-relations/wp-relation-row/wp-relation-row.template.html
  3. 4
      spec/features/work_packages/details/relations/relations_spec.rb
  4. 2
      spec/support/components/work_packages/relations.rb

@ -10,6 +10,8 @@ import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destr
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { RelationResource } from 'core-app/features/hal/resources/relation-resource';
import { WorkPackageRelationsService } from '../wp-relations.service';
import { Highlighting } from 'core-app/features/work-packages/components/wp-fast-table/builders/highlighting/highlighting.functions';
@Component({
selector: 'wp-relation-row',
@ -200,4 +202,8 @@ export class WorkPackageRelationRowComponent extends UntilDestroyedMixin impleme
.catch((err:any) => this.notificationService.handleRawError(err,
this.relatedWorkPackage));
}
public highlightingClassForWpType():string {
return Highlighting.inlineClass('type', this.relatedWorkPackage.type.id!);
}
}

@ -14,6 +14,7 @@
<span *ngIf="groupByWorkPackageType"
[textContent]="normalizedRelationType"></span>
<span *ngIf="!groupByWorkPackageType"
[ngClass]="highlightingClassForWpType()"
[textContent]="relatedWorkPackage.type.name"></span>
<span class="hidden-for-sighted" [textContent]="text.updateRelation"></span>
</button>

@ -101,8 +101,8 @@ describe 'Work package relations tab', js: true, selenium: true do
expect(page).to have_selector('.relation-group--header', text: 'FOLLOWS')
expect(page).to have_selector('.relation-group--header', text: 'RELATED TO')
expect(page).to have_selector('.relation-row--type', text: type_1.name)
expect(page).to have_selector('.relation-row--type', text: type_2.name)
expect(page).to have_selector('.relation-row--type', text: type_1.name.upcase)
expect(page).to have_selector('.relation-row--type', text: type_2.name.upcase)
find(toggle_btn_selector).click
expect(page).to have_selector(toggle_btn_selector, text: 'Group by relation type', wait: 10)

@ -110,7 +110,7 @@ module Components
text: relation_label.upcase,
wait: 10)
expect(page).to have_selector('.relation-row--type', text: to.type.name)
expect(page).to have_selector('.relation-row--type', text: to.type.name.upcase)
expect(page).to have_selector('.wp-relations--subject-field', text: to.subject)

Loading…
Cancel
Save