Fix bug spec introduced by resolving merge conflicts.

Also correct spelling, rename "addin" to "add-in".
pull/8481/head
Wieland Lindenthal 4 years ago
parent 8369fbe158
commit 1e205f8da3
  1. 8
      frontend/src/app/angular4-modules.ts
  2. 2
      frontend/src/app/modules/bim/bcf/openproject-bcf.module.ts
  3. 15
      frontend/src/app/modules/bim/revit_add_in/revit-add-in-settings-button.service.ts
  4. 0
      frontend/src/app/modules/bim/revit_add_in/revit-bridge.service.ts
  5. 4
      modules/bim/config/locales/js-en.yml
  6. 22
      modules/bim/spec/features/bim_revit_add_in_navigation_spec.rb
  7. 2
      spec/support/browsers/chrome.rb

@ -75,7 +75,7 @@ import {globalDynamicComponents} from "core-app/global-dynamic-components.const"
import {OpenprojectMembersModule} from "core-app/modules/members/members.module";
import {OpenprojectEnterpriseModule} from "core-components/enterprise/openproject-enterprise.module";
import {OpenprojectAugmentingModule} from "core-app/modules/augmenting/openproject-augmenting.module";
import {RevitAddinSettingsButtonService} from "core-app/modules/bim/revit_addin/revit-addin-settings-button.service";
import {RevitAddInSettingsButtonService} from "core-app/modules/bim/revit_add_in/revit-add-in-settings-button.service";
@NgModule({
imports: [
@ -146,7 +146,7 @@ import {RevitAddinSettingsButtonService} from "core-app/modules/bim/revit_addin/
// Split view
CommentService,
ConfirmDialogService,
RevitAddinSettingsButtonService,
RevitAddInSettingsButtonService,
],
declarations: [
OpContextMenuTrigger,
@ -201,8 +201,8 @@ export function initializeServices(injector:Injector) {
const PreviewTrigger = injector.get(PreviewTriggerService);
const mainMenuNavigationService = injector.get(MainMenuNavigationService);
const keyboardShortcuts = injector.get(KeyboardShortcutService);
// Conditionally add the Revit Addin settings button
injector.get(RevitAddinSettingsButtonService);
// Conditionally add the Revit Add-In settings button
injector.get(RevitAddInSettingsButtonService);
mainMenuNavigationService.register();

@ -44,7 +44,7 @@ import {HookService} from "core-app/modules/plugins/hook-service";
import {WorkPackageResource} from "core-app/modules/hal/resources/work-package-resource";
import {BcfWpAttributeGroupComponent} from "core-app/modules/bim/bcf/bcf-wp-attribute-group/bcf-wp-attribute-group.component";
import {BcfNewWpAttributeGroupComponent} from "core-app/modules/bim/bcf/bcf-wp-attribute-group/bcf-new-wp-attribute-group.component";
import {RevitBridgeService} from "core-app/modules/bim/revit_addin/revit-bridge.service";
import {RevitBridgeService} from "core-app/modules/bim/revit_add_in/revit-bridge.service";
/**
* Determines based on the current user agent whether

@ -1,5 +1,4 @@
import {Injectable, Injector} from '@angular/core';
import {RevitBridgeService} from "core-app/modules/bim/revit_addin/revit-bridge.service";
import {I18nService} from "core-app/modules/common/i18n/i18n.service";
/*
@ -7,17 +6,17 @@ import {I18nService} from "core-app/modules/common/i18n/i18n.service";
* the login menu) that give access to the Revit Plugin settings.
*/
@Injectable()
export class RevitAddinSettingsButtonService {
export class RevitAddInSettingsButtonService {
private readonly labelText:string;
private readonly groupLabelText:string;
constructor(readonly injector:Injector,
readonly i18n:I18nService) {
const onRevitAddinEnvironment = window.navigator.userAgent.search('Revit') > -1;
const onRevitAddInEnvironment = window.navigator.userAgent.search('Revit') > -1;
if (onRevitAddinEnvironment) {
this.labelText = i18n.t('js.revit.revit_addin_settings');
this.groupLabelText = i18n.t('js.revit.revit_addin');
if (onRevitAddInEnvironment) {
this.labelText = i18n.t('js.revit.revit_add_in_settings');
this.groupLabelText = i18n.t('js.revit.revit_add_in');
this.addUserMenuItem();
this.addLoginMenuItem();
@ -55,7 +54,7 @@ export class RevitAddinSettingsButtonService {
${this.groupLabelText}
</span>
</h3>
<div class="login-auth-provider-list revit-addin-button">
<div class="login-auth-provider-list revit-add-in-button">
<div class="auth-provider auth-provider-developer button">
<span class="auth-provider-name">${this.labelText}</span>
</div>
@ -64,7 +63,7 @@ export class RevitAddinSettingsButtonService {
`;
loginModal.appendChild(loginMenuItem);
const settingsButton = loginModal.querySelector('.revit-addin-button');
const settingsButton = loginModal.querySelector('.revit-add-in-button');
settingsButton!.addEventListener('click', () => this.goToSettings());
}

@ -21,5 +21,5 @@ en:
split: 'Viewer and table'
split_cards: 'Viewer and cards'
revit:
revit_addin: "Revit Addin"
revit_addin_settings: "Revit Addin settings"
revit_add_in: "Revit Add-In"
revit_add_in_settings: "Revit Add-In settings"

@ -32,7 +32,7 @@ describe 'BIM Revit Add-in navigation spec',
type: :feature,
with_config: { edition: 'bim' },
js: true,
driver: :chrome_headless_revit_addin do
driver: :chrome_headless_revit_add_in do
let(:project) { FactoryBot.create :project, enabled_module_names: %i[bim work_package_tracking] }
let!(:work_package) { FactoryBot.create(:work_package, project: project) }
let(:role) { FactoryBot.create(:role, permissions: %i[view_ifc_models manage_ifc_models view_work_packages]) }
@ -72,27 +72,27 @@ describe 'BIM Revit Add-in navigation spec',
model_page.has_no_menu_item_with_text? 'Viewer'
end
it 'the user menu has an option to go to the addin settings' do
it 'can switch to the Table view mode' do
model_page.switch_view 'Table'
expect(page).to have_selector('.work-package-table')
end
it 'the user menu has an option to go to the add-in settings' do
within '.top-menu-items-right' do
page.find("a[title='#{user.name}']").click
expect(page).to have_selector('li', text: I18n.t('js.revit.revit_addin_settings'))
expect(page).to have_selector('li', text: I18n.t('js.revit.revit_add_in_settings'))
end
end
end
context "signed out" do
it 'the user menu has an option to go to the addin settings' do
it 'the user menu has an option to go to the add-in settings' do
visit home_path
1
click_link I18n.t(:label_login)
expect(page).to have_text(I18n.t('js.revit.revit_addin_settings'))
expect(page).to have_text(I18n.t('js.revit.revit_add_in_settings'))
end
end
it 'can switch to the Table view mode' do
model_page.switch_view 'Table'
expect(page).to have_selector('.work-package-table')
end
end

@ -81,7 +81,7 @@ register_chrome_headless 'en', name: :headless_chrome_billy do |options, capabil
end
# Register Revit add in
register_chrome_headless 'en', name: :chrome_headless_revit_addin do |options, capabilities|
register_chrome_headless 'en', name: :chrome_headless_revit_add_in do |options, capabilities|
options.add_argument("--user-agent='foo bar Revit'")
end

Loading…
Cancel
Save