diff --git a/frontend/src/app/features/team-planner/team-planner/page/team-planner-page.component.ts b/frontend/src/app/features/team-planner/team-planner/page/team-planner-page.component.ts index 406c192536..b921539266 100644 --- a/frontend/src/app/features/team-planner/team-planner/page/team-planner-page.component.ts +++ b/frontend/src/app/features/team-planner/team-planner/page/team-planner-page.component.ts @@ -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 { diff --git a/modules/team_planner/config/locales/js-en.yml b/modules/team_planner/config/locales/js-en.yml index 43b4c02f7d..0bf7129f8e 100644 --- a/modules/team_planner/config/locales/js-en.yml +++ b/modules/team_planner/config/locales/js-en.yml @@ -3,4 +3,5 @@ en: js: team_planner: title: 'Team planner' + unsaved_title: 'Unnamed team planner' label_assignee_plural: 'Assignees' diff --git a/modules/team_planner/spec/features/team_planner_spec.rb b/modules/team_planner/spec/features/team_planner_spec.rb index 4cc5574694..e4585eeb20 100644 --- a/modules/team_planner/spec/features/team_planner_spec.rb +++ b/modules/team_planner/spec/features/team_planner_spec.rb @@ -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 diff --git a/modules/team_planner/spec/support/pages/team_planner.rb b/modules/team_planner/spec/support/pages/team_planner.rb index 0e995fd0c7..0f3b5546e1 100644 --- a/modules/team_planner/spec/support/pages/team_planner.rb +++ b/modules/team_planner/spec/support/pages/team_planner.rb @@ -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)