Set the title to "Unnamed team planner"

pull/9944/head
Oliver Günther 3 years ago
parent 88df8a5696
commit 22033a5d07
  1. 12
      frontend/src/app/features/team-planner/team-planner/page/team-planner-page.component.ts
  2. 1
      modules/team_planner/config/locales/js-en.yml
  3. 2
      modules/team_planner/spec/features/team_planner_spec.rb
  4. 4
      modules/team_planner/spec/support/pages/team_planner.rb

@ -13,6 +13,7 @@ import { ZenModeButtonComponent } from 'core-app/features/work-packages/componen
import { WorkPackageFilterButtonComponent } from 'core-app/features/work-packages/components/wp-buttons/wp-filter-button/wp-filter-button.component';
import { WorkPackageFilterContainerComponent } from 'core-app/features/work-packages/components/filters/filter-container/filter-container.directive';
import { QueryParamListenerService } from 'core-app/features/work-packages/components/wp-query/query-param-listener.service';
import { QueryResource } from 'core-app/features/hal/resources/query-resource';
@Component({
templateUrl: '../../../work-packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html',
@ -27,13 +28,14 @@ import { QueryParamListenerService } from 'core-app/features/work-packages/compo
export class TeamPlannerPageComponent extends PartitionedQuerySpacePageComponent implements OnInit {
text = {
title: this.I18n.t('js.team_planner.title'),
unsaved_title: this.I18n.t('js.team_planner.unsaved_title'),
};
/** Go back using back-button */
backButtonCallback:() => void;
/** Current query title to render */
selectedTitle = this.text.title;
selectedTitle = this.text.unsaved_title;
filterContainerDefinition:DynamicComponentDefinition = {
component: WorkPackageFilterContainerComponent,
@ -87,6 +89,14 @@ export class TeamPlannerPageComponent extends PartitionedQuerySpacePageComponent
this.currentPartition = state.data?.partition || '-split';
}
updateTitle(query?:QueryResource):void {
if (!query?.id) {
this.selectedTitle = this.text.unsaved_title;
} else {
super.updateTitle(query);
}
}
// For shared template compliance
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars
updateTitleName(val:string):void {

@ -3,4 +3,5 @@ en:
js:
team_planner:
title: 'Team planner'
unsaved_title: 'Unnamed team planner'
label_assignee_plural: 'Assignees'

@ -113,6 +113,8 @@ describe 'Team planner', type: :feature, js: true do
it 'renders a basic board' do
team_planner.visit!
team_planner.title
team_planner.expect_assignee user
team_planner.expect_assignee other_user

@ -44,8 +44,8 @@ module Pages
project_team_planner_path(project)
end
def expect_title
expect(page).to have_selector '.editable-toolbar-title--fixed', text: 'Team planner'
def expect_title(title = 'Unnamed team planner')
expect(page).to have_selector '.editable-toolbar-title--fixed', text: title
end
def expect_assignee(user, present: true)

Loading…
Cancel
Save