[41717] Consolidate create labels in calendar, boards, team planner

https://community.openproject.org/wp/41717
pull/10509/head
Oliver Günther 3 years ago
parent 1d2583867f
commit e1bfe76eee
  1. 3
      frontend/src/app/features/boards/boards-sidebar/boards-menu.component.html
  2. 1
      frontend/src/app/features/boards/boards-sidebar/boards-menu.component.ts
  3. 3
      frontend/src/app/features/boards/index-page/boards-index-page.component.html
  4. 1
      frontend/src/app/features/boards/index-page/boards-index-page.component.ts
  5. 1
      frontend/src/app/features/calendar/sidemenu/calendar-sidemenu.component.html
  6. 3
      frontend/src/app/features/calendar/sidemenu/calendar-sidemenu.component.ts
  7. 2
      frontend/src/app/features/team-planner/team-planner/sidemenu/team-planner-sidemenu.component.ts
  8. 2
      modules/boards/config/locales/js-en.yml
  9. 4
      modules/boards/spec/features/board_enterprise_spec.rb
  10. 2
      modules/boards/spec/features/support/board_index_page.rb
  11. 4
      modules/calendar/app/views/calendar/calendars/index.html.erb
  12. 2
      modules/calendar/config/locales/js-en.yml
  13. 6
      modules/calendar/spec/features/calendars_index_spec.rb
  14. 2
      modules/calendar/spec/features/calendars_spec.rb
  15. 4
      modules/team_planner/app/views/team_planner/team_planner/index.html.erb
  16. 1
      modules/team_planner/config/locales/en.yml
  17. 1
      modules/team_planner/config/locales/js-en.yml
  18. 10
      modules/team_planner/spec/features/team_planner_index_spec.rb

@ -13,8 +13,9 @@
*ngIf="canCreateBoards$ | async"
class="spot-button spot-button_outlined"
(click)="showNewBoardModal()"
[title]="text.create_new_board"
>
<span class="spot-icon spot-icon_add"></span>
<span [textContent]="text.create_new_board"></span>
<span [textContent]="text.board"></span>
</button>
</div>

@ -62,6 +62,7 @@ export class BoardsMenuComponent extends UntilDestroyedMixin implements OnInit {
.pipe(this.untilDestroyed());
text = {
board: this.I18n.t('js.label_board'),
create_new_board: this.I18n.t('js.boards.create_new'),
};

@ -7,11 +7,12 @@
<li *ngIf="canAdd"
class="toolbar-item">
<a class="button -alt-highlight"
[title]="text.create_new_board"
(click)="newBoard()">
<op-icon icon-classes="button--icon icon-add">
</op-icon>
<span class="button--text"
[textContent]="text.create">
[textContent]="text.board">
</span>
</a>
</li>

@ -27,6 +27,7 @@ export class BoardsIndexPageComponent extends UntilDestroyedMixin implements OnI
public text = {
name: this.I18n.t('js.modals.label_name'),
create: this.I18n.t('js.button_create'),
create_new_board: this.I18n.t('js.boards.create_new'),
board: this.I18n.t('js.label_board'),
boards: this.I18n.t('js.label_board_plural'),
type: this.I18n.t('js.boards.label_board_type'),

@ -14,6 +14,7 @@
class="spot-button spot-button_outlined"
[uiSref]="createButton.uiSref"
[uiParams]="createButton.uiParams"
[title]="text.create_new_calendar"
>
<span class="spot-icon spot-icon_add"></span>
<span [textContent]="createButton.title"></span>

@ -33,11 +33,12 @@ export class CalendarSidemenuComponent extends UntilDestroyedMixin {
.pipe(this.untilDestroyed());
text = {
calendar: this.I18n.t('js.calendar.title'),
create_new_calendar: this.I18n.t('js.calendar.create_new'),
};
createButton = {
title: this.text.create_new_calendar,
title: this.text.calendar,
uiSref: 'calendar.page.show',
uiParams: {
query_id: null,

@ -39,7 +39,7 @@ export class TeamPlannerSidemenuComponent extends UntilDestroyedMixin {
);
text = {
create_new_team_planner: this.I18n.t('js.team_planner.create_new'),
create_new_team_planner: this.I18n.t('js.team_planner.title'),
};
createButton = {

@ -2,7 +2,7 @@
en:
js:
boards:
create_new: 'New board'
create_new: 'Create new board'
label_unnamed_board: 'Unnamed board'
label_unnamed_list: 'Unnamed list'
label_board_type: 'Board type'

@ -54,7 +54,7 @@ describe 'Boards enterprise spec', type: :feature, js: true do
end
it 'disabled all action boards' do
page.find('.toolbar-item a', text: I18n.t('js.button_create')).click
page.find('.toolbar-item a', text: 'Board').click
expect(page).to have_selector('[data-qa-selector="op-tile-block"]:not([disabled])', text: 'Basic')
expect(page).to have_selector('[data-qa-selector="op-tile-block"]:disabled', count: 5)
@ -84,7 +84,7 @@ describe 'Boards enterprise spec', type: :feature, js: true do
end
it 'enables all options' do
page.find('.toolbar-item a', text: I18n.t('js.button_create')).click
page.find('.toolbar-item a', text: 'Board').click
expect(page).to have_selector('[data-qa-selector="op-tile-block"]:not([disabled])', count: 6)
end

@ -57,7 +57,7 @@ module Pages
end
def create_board(action: nil, expect_empty: false)
page.find('.toolbar-item a', text: I18n.t('js.button_create')).click
page.find('.toolbar-item a', text: 'Board').click
text = action == nil ? 'Basic' : action.to_s[0..5]
find('[data-qa-selector="op-tile-block-title"]', text: text).click

@ -33,9 +33,9 @@ See COPYRIGHT and LICENSE files for more details.
<li class="toolbar-item">
<%= link_to new_project_calendars_path(@project),
class: 'button -alt-highlight',
title: t(:button_create) do %>
title: t('js.calendar.create_new') do %>
<%= op_icon('button--icon icon-add') %>
<span class="button--text"><%= t(:button_create) %></span>
<span class="button--text"><%= t(:label_calendar) %></span>
<% end %>
</li>
<% end %>

@ -2,7 +2,7 @@
en:
js:
calendar:
create_new: 'New calendar'
create_new: 'Create new calendar'
title: 'Calendar'
too_many: 'There are %{count} work packages in total, but only %{max} can be shown.'
unsaved_title: 'Unnamed calendar'

@ -66,7 +66,7 @@ describe 'Team planner index', type: :feature, js: true, with_ee: %i[team_planne
it 'shows an index action' do
expect(page).to have_text 'There is currently nothing to display.'
expect(page).to have_selector '.button', text: 'Create'
expect(page).to have_selector '.button', text: 'Calendar'
end
end
@ -91,7 +91,7 @@ describe 'Team planner index', type: :feature, js: true, with_ee: %i[team_planne
expect(page).to have_no_selector "[data-qa-selector='calendar-remove-#{query.id}']"
# Does not show the create button
expect(page).to have_no_selector '.button', text: 'Create'
expect(page).to have_no_selector '.button', text: 'Calendar'
end
context 'when the view is non-public' do
@ -105,7 +105,7 @@ describe 'Team planner index', type: :feature, js: true, with_ee: %i[team_planne
expect(page).to have_no_selector "[data-qa-selector='team-planner-remove-#{query.id}']"
# Does not show the create button
expect(page).to have_no_selector '.button', text: 'Create'
expect(page).to have_no_selector '.button', text: 'Calendar'
end
end
end

@ -81,7 +81,7 @@ describe 'Work package calendars', type: :feature, js: true do
expect(page).to have_text 'There is currently nothing to display.'
# Open a new calendar from there
click_on 'Create'
find('.toolbar-item a', text: 'Calendar').click
loading_indicator_saveguard

@ -5,9 +5,9 @@
<li class="toolbar-item">
<%= link_to new_project_team_planners_path(@project),
class: 'button -alt-highlight',
title: t(:button_create) do %>
title: t(:'team_planner.label_create_new_team_planner') do %>
<%= op_icon('button--icon icon-add') %>
<span class="button--text"><%= t(:button_create) %></span>
<span class="button--text"><%= t(:'team_planner.label_team_planner') %></span>
<% end %>
</li>
<% end %>

@ -6,6 +6,7 @@ en:
team_planner:
label_team_planner: "Team planner"
label_create_new_team_planner: "Create new team planner"
label_team_planner_plural: "Team planners"
label_assignees: "Assignees"
upsale:

@ -3,7 +3,6 @@ en:
js:
team_planner:
add_existing: 'Add existing'
create_new: 'New team planner'
title: 'Team planner'
unsaved_title: 'Unnamed team planner'
no_data: 'Add assignees to set up your team planner.'

@ -47,16 +47,16 @@ describe 'Team planner index', type: :feature, js: true, with_ee: %i[team_planne
it 'shows an index action' do
expect(page).to have_text 'There is currently nothing to display.'
expect(page).to have_selector '.button', text: 'Create'
expect(page).to have_selector '.button', text: 'Team planner'
end
it 'can create an action through the sidebar' do
click_on 'New team planner'
find('[data-qa-selector="team-planner--create-button"]').click
team_planner.expect_title
# Also works from the frontend
click_on 'New team planner'
find('[data-qa-selector="team-planner--create-button"]').click
team_planner.expect_no_toaster
team_planner.expect_title
@ -84,7 +84,7 @@ describe 'Team planner index', type: :feature, js: true, with_ee: %i[team_planne
expect(page).to have_no_selector "[data-qa-selector='team-planner-remove-#{query.id}']"
# Does not show the create button
expect(page).to have_no_selector '.button', text: 'Create'
expect(page).to have_no_selector '.button', text: 'Team planner'
end
context 'when the view is non-public' do
@ -98,7 +98,7 @@ describe 'Team planner index', type: :feature, js: true, with_ee: %i[team_planne
expect(page).to have_no_selector "[data-qa-selector='team-planner-remove-#{query.id}']"
# Does not show the create button
expect(page).to have_no_selector '.button', text: 'Create'
expect(page).to have_no_selector '.button', text: 'Team planner'
end
end
end

Loading…
Cancel
Save