From 8f043e8cf5602137e6020ba1f279739db24be120 Mon Sep 17 00:00:00 2001 From: Cameron Perera Date: Wed, 30 Aug 2023 12:19:01 -0500 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20update=20how=20proxy?= =?UTF-8?q?-url=20determins=20default=20proxy=20info=20(#1869)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/components/session/proxy-url/index.js | 8 +++----- .../scopes/scope/projects/sessions/session.hbs | 2 +- .../tests/integration/components/proxy-url-test.js | 13 ++++--------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/ui/desktop/app/components/session/proxy-url/index.js b/ui/desktop/app/components/session/proxy-url/index.js index d62a20f3e..5cd061246 100644 --- a/ui/desktop/app/components/session/proxy-url/index.js +++ b/ui/desktop/app/components/session/proxy-url/index.js @@ -7,15 +7,13 @@ import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; import { inject as service } from '@ember/service'; -import { TYPE_TARGET_SSH } from 'api/models/target'; export default class SessionProxyUrlComponent extends Component { @service intl; - @tracked selectedValue = - this.args.targetType === TYPE_TARGET_SSH - ? this.intl.t('resources.session.proxy-url.ssh') - : this.intl.t('resources.session.proxy-url.address-port'); + @tracked selectedValue = this.args.isSSHTarget + ? this.intl.t('resources.session.proxy-url.ssh') + : this.intl.t('resources.session.proxy-url.address-port'); get isAddressAndPort() { return ( diff --git a/ui/desktop/app/templates/scopes/scope/projects/sessions/session.hbs b/ui/desktop/app/templates/scopes/scope/projects/sessions/session.hbs index 20955bfad..17cee4207 100644 --- a/ui/desktop/app/templates/scopes/scope/projects/sessions/session.hbs +++ b/ui/desktop/app/templates/scopes/scope/projects/sessions/session.hbs @@ -28,7 +28,7 @@ {{/if}} diff --git a/ui/desktop/tests/integration/components/proxy-url-test.js b/ui/desktop/tests/integration/components/proxy-url-test.js index 289def2cc..08bcc7987 100644 --- a/ui/desktop/tests/integration/components/proxy-url-test.js +++ b/ui/desktop/tests/integration/components/proxy-url-test.js @@ -8,7 +8,6 @@ import { setupRenderingTest } from 'desktop/tests/helpers'; import { render, click } from '@ember/test-helpers'; import { hbs } from 'ember-cli-htmlbars'; import { setupIntl } from 'ember-intl/test-support'; -import { TYPE_TARGET_TCP, TYPE_TARGET_SSH } from 'api/models/target'; module('Integration | Component | session/proxy-url', function (hooks) { setupRenderingTest(hooks); @@ -18,14 +17,13 @@ module('Integration | Component | session/proxy-url', function (hooks) { assert.expect(2); this.set('proxyAddress', 'http://localhost'); this.set('proxyPort', '1234'); - this.set('targetType', TYPE_TARGET_TCP); await render( hbs` ` ); @@ -38,14 +36,13 @@ module('Integration | Component | session/proxy-url', function (hooks) { assert.expect(2); this.set('proxyAddress', 'http://localhost'); this.set('proxyPort', '1234'); - this.set('targetType', TYPE_TARGET_TCP); await render( hbs` ` ); @@ -62,14 +59,13 @@ module('Integration | Component | session/proxy-url', function (hooks) { assert.expect(2); this.set('proxyAddress', 'http://localhost'); this.set('proxyPort', '1234'); - this.set('targetType', TYPE_TARGET_TCP); await render( hbs` ` ); @@ -82,14 +78,13 @@ module('Integration | Component | session/proxy-url', function (hooks) { assert.expect(2); this.set('proxyAddress', 'http://localhost'); this.set('proxyPort', '1234'); - this.set('targetType', TYPE_TARGET_SSH); await render( hbs` ` );