From f1f05410055a8f0a2f842be84b7af37a1393c19a Mon Sep 17 00:00:00 2001 From: Maciej Kempin Date: Fri, 27 Oct 2023 09:23:43 +0100 Subject: [PATCH 001/154] 3.12.4 > 3.16 --- .gitignore | 1 + MODULE_REPORT.md | 180 +- app/adapters/v3.js | 2 +- app/components/billing-summary-status.js | 2 +- app/components/billing/address.js | 5 +- app/components/billing/credits-calculator.js | 24 +- app/components/billing/first-plan.js | 8 +- app/components/billing/payment-details-tab.js | 12 +- app/components/billing/postal-address.js | 8 +- app/components/billing/user-usage.js | 2 +- app/components/branch-row.js | 4 +- app/components/build-messages-list.js | 6 +- .../dialogs/user-management-modal.js | 2 +- app/components/owner/wizard.js | 2 +- app/components/plan-usage.js | 4 +- app/components/repository-layout.js | 2 +- app/components/request-config.js | 2 +- app/components/status-images.js | 5 +- app/components/ui-kit/link.js | 6 +- app/controllers/account/settings.js | 4 +- app/controllers/builds.js | 2 +- app/controllers/organization/settings.js | 2 +- app/models/commit.js | 2 +- app/models/repo.js | 6 +- app/routes/legacy-repo-url.js | 5 +- app/routes/provider.js | 5 +- app/serializers/repo.js | 2 +- app/serializers/v3.js | 2 +- app/services/auth.js | 5 +- app/services/multi-vcs.js | 6 +- app/services/store.js | 2 +- .../billing/payment-details-tab.hbs | 2 +- .../dialogs/user-management-modal.hbs | 9 +- .../dialogs/user-statistics-modal.hbs | 9 +- app/templates/components/insights-overlay.hbs | 2 +- .../components/multi-signin-button.hbs | 2 +- .../components/trigger-custom-build.hbs | 2 +- .../components/zendesk-request-form.hbs | 2 +- app/templates/signin.hbs | 2 +- app/templates/signup.hbs | 2 +- app/utils/filtered-array-manager.js | 5 +- app/utils/ui-kit/prefix.js | 6 +- package-lock.json | 9071 +++++++++++++---- package.json | 2 +- .../auth/automatic-sign-out-test.js | 4 +- tests/acceptance/auth/first-sync-test.js | 4 +- .../github-apps-installation-redirect-test.js | 4 +- tests/acceptance/auth/sign-out-test.js | 4 +- tests/acceptance/builds/build-stages-test.js | 4 +- tests/acceptance/builds/cancel-test.js | 4 +- tests/acceptance/builds/current-tab-test.js | 4 +- tests/acceptance/builds/debug-test.js | 4 +- tests/acceptance/builds/invalid-build-test.js | 4 +- tests/acceptance/builds/prioritize-test.js | 4 +- tests/acceptance/builds/pull-requests-test.js | 4 +- tests/acceptance/builds/restart-test.js | 4 +- .../builds/view-pull-request-test.js | 4 +- .../config/oss-feature-flags-test.js | 4 +- tests/acceptance/config/yaml-test.js | 4 +- .../acceptance/dashboard/repositories-test.js | 4 +- tests/acceptance/enterprise/banner-test.js | 4 +- .../enterprise/beta-features-disabled-test.js | 4 +- .../acceptance/enterprise/navigation-test.js | 4 +- .../feature-flags/app-boots-test.js | 4 +- tests/acceptance/help-page-test.js | 4 +- tests/acceptance/home/broadcasts-test.js | 4 +- tests/acceptance/home/flashes-test.js | 4 +- tests/acceptance/home/sidebar-tabs-test.js | 4 +- tests/acceptance/home/utm-test.js | 4 +- .../acceptance/home/with-repositories-test.js | 4 +- .../home/without-repositories-test.js | 4 +- tests/acceptance/job/basic-layout-test.js | 4 +- tests/acceptance/job/build-matrix-test.js | 4 +- tests/acceptance/job/cancel-test.js | 4 +- tests/acceptance/job/debug-test.js | 4 +- tests/acceptance/job/delete-log-test.js | 4 +- tests/acceptance/job/invalid-log-test.js | 4 +- tests/acceptance/job/log-error-test.js | 4 +- tests/acceptance/job/restart-test.js | 4 +- tests/acceptance/layouts/cta-test.js | 4 +- tests/acceptance/layouts/default-test.js | 4 +- tests/acceptance/layouts/logo-test.js | 4 +- tests/acceptance/layouts/plans-test.js | 4 +- tests/acceptance/layouts/pro-test.js | 4 +- tests/acceptance/logo-test.js | 4 +- .../marketing/travisci-vs-jenkins-test.js | 4 +- tests/acceptance/non-existent-routes-test.js | 4 +- tests/acceptance/owner/insights-test.js | 4 +- tests/acceptance/owner/not-found-test.js | 4 +- tests/acceptance/owner/repos-test.js | 4 +- tests/acceptance/plans-test.js | 4 +- tests/acceptance/profile/basic-layout-test.js | 4 +- tests/acceptance/profile/billing-test.js | 4 +- tests/acceptance/profile/filtering-test.js | 4 +- tests/acceptance/profile/not-found-test.js | 4 +- tests/acceptance/profile/plan-usage-test.js | 4 +- tests/acceptance/profile/redirect-test.js | 4 +- tests/acceptance/profile/sync-test.js | 4 +- tests/acceptance/profile/unsubscribe-test.js | 4 +- .../profile/update-repositories-test.js | 4 +- .../acceptance/profile/user-settings-test.js | 4 +- tests/acceptance/profile/view-token-test.js | 4 +- tests/acceptance/repo/active_on_org-test.js | 4 +- tests/acceptance/repo/allowance-test.js | 4 +- tests/acceptance/repo/branches-test.js | 4 +- .../acceptance/repo/build-list-routes-test.js | 4 +- tests/acceptance/repo/caches-test.js | 4 +- tests/acceptance/repo/not-active-test.js | 4 +- tests/acceptance/repo/not-found-test.js | 4 +- tests/acceptance/repo/requests-test.js | 4 +- tests/acceptance/repo/settings-test.js | 4 +- .../acceptance/repo/show-public-repo-test.js | 4 +- tests/acceptance/repo/show-test.js | 4 +- tests/acceptance/repo/trigger-build-test.js | 4 +- tests/acceptance/repo/view-migrated-test.js | 4 +- tests/acceptance/search/flow-test.js | 4 +- tests/acceptance/search/no-results-test.js | 4 +- tests/acceptance/sign-in-test.js | 4 +- tests/acceptance/sign-up-test.js | 4 +- tests/helpers/setup-application-test.js | 6 +- tests/integration/v2-serializer-test.js | 110 +- tests/unit/routes/signin-test.js | 2 +- tests/unit/services/gtm-test.js | 4 +- tests/unit/utils/vcs-test.js | 8 +- 124 files changed, 7737 insertions(+), 2129 deletions(-) diff --git a/.gitignore b/.gitignore index 3d5203f0f9..d1216431c6 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /testem.log /yarn-error.log .DS_Store +env # ember-try /.node_modules.ember-try/ diff --git a/MODULE_REPORT.md b/MODULE_REPORT.md index 11f809a925..ad7c7cc0e5 100644 --- a/MODULE_REPORT.md +++ b/MODULE_REPORT.md @@ -17,11 +17,11 @@ if (!Ember.testing) { **Global**: `Ember.Handlebars` -**Location**: `app/helpers/github-commit-link.js` at line 7 +**Location**: `app/helpers/commit-link.js` at line 7 ```js +import formatCommit from 'travis/utils/format-commit'; -import Ember from 'ember'; const { escapeExpression: escape } = Ember.Handlebars.Utils; export default Helper.extend({ @@ -31,7 +31,7 @@ export default Helper.extend({ **Global**: `Ember.testing` -**Location**: `app/controllers/build.js` at line 32 +**Location**: `app/controllers/build.js` at line 31 ```js init() { @@ -59,7 +59,7 @@ export default Helper.extend({ **Global**: `Ember.testing` -**Location**: `app/controllers/repo.js` at line 63 +**Location**: `app/controllers/repo.js` at line 66 ```js init() { @@ -78,7 +78,7 @@ export default Helper.extend({ ```js // Acceptance tests will wait for the promise to resolve, so skip in tests - if (this.get('isOpen') && !Ember.testing) { + if (this.isOpen && !Ember.testing) { yield new EmberPromise(resolve => later(resolve, 10000)); ``` @@ -87,7 +87,7 @@ export default Helper.extend({ **Global**: `Ember.Handlebars` -**Location**: `app/components/build-message.js` at line 7 +**Location**: `app/components/build-message.js` at line 10 ```js import Ember from 'ember'; @@ -101,13 +101,13 @@ export default Component.extend({ **Global**: `Ember.testing` -**Location**: `app/components/dashboard-row.js` at line 26 +**Location**: `app/components/queued-jobs.js` at line 16 ```js - this.toggleProperty('dropupIsOpen'); - + init() { + this._super(...arguments); if (!Ember.testing) { - later((() => { this.set('dropupIsOpen', false); }), 4000); + return Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this)); } ``` @@ -115,21 +115,21 @@ export default Component.extend({ **Global**: `Ember.testing` -**Location**: `app/components/queued-jobs.js` at line 13 +**Location**: `app/components/repository-sidebar.js` at line 45 ```js - init() { - this._super(...arguments); - if (!Ember.testing) { - return Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this)); } + + if (!Ember.testing) { + Visibility.every(config.intervals.updateTimes, () => { + const callback = (record) => record.get('currentBuild'); ``` ### Unknown Global **Global**: `Ember.testing` -**Location**: `app/components/running-jobs.js` at line 18 +**Location**: `app/components/running-jobs.js` at line 16 ```js init() { @@ -143,21 +143,7 @@ export default Component.extend({ **Global**: `Ember.testing` -**Location**: `app/components/repository-sidebar.js` at line 46 - -```js - } - - if (!Ember.testing) { - Visibility.every(config.intervals.updateTimes, () => { - const callback = (record) => record.get('currentBuild'); -``` - -### Unknown Global - -**Global**: `Ember.testing` - -**Location**: `app/components/top-bar.js` at line 38 +**Location**: `app/components/top-bar.js` at line 59 ```js @@ -169,43 +155,29 @@ export default Component.extend({ ### Unknown Global -**Global**: `Ember.testing` - -**Location**: `app/controllers/dashboard/builds.js` at line 12 - -```js - init() { - this._super(...arguments); - if (!Ember.testing) { - Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this)); - } -``` - -### Unknown Global - **Global**: `Ember.Test` -**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 14 +**Location**: `tests/acceptance/repo/not-found-test.js` at line 21 ```js - - hooks.beforeEach(function () { + // Ignore promise rejection. + // Original exception will fail test on promise rejection. adapterException = Ember.Test.adapter.exception; loggerError = Ember.Logger.error; - Ember.Test.adapter.exception = () => {}; + Ember.Test.adapter.exception = () => null; ``` ### Unknown Global **Global**: `Ember.Logger` -**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 15 +**Location**: `tests/acceptance/repo/not-found-test.js` at line 22 ```js - hooks.beforeEach(function () { + // Original exception will fail test on promise rejection. adapterException = Ember.Test.adapter.exception; loggerError = Ember.Logger.error; - Ember.Test.adapter.exception = () => {}; + Ember.Test.adapter.exception = () => null; Ember.Logger.error = () => null; ``` @@ -213,12 +185,12 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 16 +**Location**: `tests/acceptance/repo/not-found-test.js` at line 23 ```js adapterException = Ember.Test.adapter.exception; loggerError = Ember.Logger.error; - Ember.Test.adapter.exception = () => {}; + Ember.Test.adapter.exception = () => null; Ember.Logger.error = () => null; }); ``` @@ -227,11 +199,11 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 17 +**Location**: `tests/acceptance/repo/not-found-test.js` at line 24 ```js loggerError = Ember.Logger.error; - Ember.Test.adapter.exception = () => {}; + Ember.Test.adapter.exception = () => null; Ember.Logger.error = () => null; }); @@ -241,7 +213,7 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 21 +**Location**: `tests/acceptance/repo/not-found-test.js` at line 28 ```js @@ -255,7 +227,7 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 22 +**Location**: `tests/acceptance/repo/not-found-test.js` at line 29 ```js hooks.afterEach(function () { @@ -267,29 +239,57 @@ export default Component.extend({ ### Unknown Global +**Global**: `Ember.testing` + +**Location**: `app/services/animation.js` at line 6 + +```js +import fade from 'ember-animated/transitions/fade'; + +const isTest = Ember.testing; + +export const DURATION_NAMES = { +``` + +### Unknown Global + +**Global**: `Ember.testing` + +**Location**: `app/services/animation.js` at line 6 + +```js +import fade from 'ember-animated/transitions/fade'; + +const isTest = Ember.testing; + +export const DURATION_NAMES = { +``` + +### Unknown Global + **Global**: `Ember.Test` -**Location**: `tests/acceptance/owner/not-found-test.js` at line 22 +**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 16 ```js - // Ignore promise rejection. - // Original exception will fail test on promise rejection. + + hooks.beforeEach(function () { adapterException = Ember.Test.adapter.exception; loggerError = Ember.Logger.error; - Ember.Test.adapter.exception = () => null; + Ember.Test.adapter.exception = () => {}; ``` ### Unknown Global **Global**: `Ember.Logger` -**Location**: `tests/acceptance/owner/not-found-test.js` at line 23 +**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 17 ```js - // Original exception will fail test on promise rejection. + hooks.beforeEach(function () { adapterException = Ember.Test.adapter.exception; loggerError = Ember.Logger.error; - Ember.Test.adapter.exception = () => null; + Ember.Test.adapter.exception = () => {}; Ember.Logger.error = () => null; ``` @@ -297,12 +297,12 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/owner/not-found-test.js` at line 24 +**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 18 ```js adapterException = Ember.Test.adapter.exception; loggerError = Ember.Logger.error; - Ember.Test.adapter.exception = () => null; + Ember.Test.adapter.exception = () => {}; Ember.Logger.error = () => null; }); ``` @@ -311,11 +311,11 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/owner/not-found-test.js` at line 25 +**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 19 ```js loggerError = Ember.Logger.error; - Ember.Test.adapter.exception = () => null; + Ember.Test.adapter.exception = () => {}; Ember.Logger.error = () => null; }); @@ -325,7 +325,7 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/owner/not-found-test.js` at line 29 +**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 23 ```js @@ -339,7 +339,7 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/owner/not-found-test.js` at line 30 +**Location**: `tests/acceptance/builds/invalid-build-test.js` at line 24 ```js hooks.afterEach(function () { @@ -353,7 +353,7 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/job/invalid-log-test.js` at line 14 +**Location**: `tests/acceptance/job/invalid-log-test.js` at line 16 ```js @@ -367,7 +367,7 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/job/invalid-log-test.js` at line 15 +**Location**: `tests/acceptance/job/invalid-log-test.js` at line 17 ```js hooks.beforeEach(function () { @@ -381,7 +381,7 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/job/invalid-log-test.js` at line 16 +**Location**: `tests/acceptance/job/invalid-log-test.js` at line 18 ```js adapterException = Ember.Test.adapter.exception; @@ -395,7 +395,7 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/job/invalid-log-test.js` at line 17 +**Location**: `tests/acceptance/job/invalid-log-test.js` at line 19 ```js loggerError = Ember.Logger.error; @@ -409,7 +409,7 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/job/invalid-log-test.js` at line 21 +**Location**: `tests/acceptance/job/invalid-log-test.js` at line 23 ```js @@ -423,7 +423,7 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/job/invalid-log-test.js` at line 22 +**Location**: `tests/acceptance/job/invalid-log-test.js` at line 24 ```js hooks.afterEach(function () { @@ -437,7 +437,7 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/repo/not-found-test.js` at line 19 +**Location**: `tests/acceptance/owner/not-found-test.js` at line 24 ```js // Ignore promise rejection. @@ -451,7 +451,7 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/repo/not-found-test.js` at line 20 +**Location**: `tests/acceptance/owner/not-found-test.js` at line 25 ```js // Original exception will fail test on promise rejection. @@ -465,7 +465,7 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/repo/not-found-test.js` at line 21 +**Location**: `tests/acceptance/owner/not-found-test.js` at line 26 ```js adapterException = Ember.Test.adapter.exception; @@ -479,7 +479,7 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/repo/not-found-test.js` at line 22 +**Location**: `tests/acceptance/owner/not-found-test.js` at line 27 ```js loggerError = Ember.Logger.error; @@ -493,7 +493,7 @@ export default Component.extend({ **Global**: `Ember.Test` -**Location**: `tests/acceptance/repo/not-found-test.js` at line 26 +**Location**: `tests/acceptance/owner/not-found-test.js` at line 31 ```js @@ -507,7 +507,7 @@ export default Component.extend({ **Global**: `Ember.Logger` -**Location**: `tests/acceptance/repo/not-found-test.js` at line 27 +**Location**: `tests/acceptance/owner/not-found-test.js` at line 32 ```js hooks.afterEach(function () { @@ -516,3 +516,17 @@ export default Component.extend({ }); ``` + +### Unknown Global + +**Global**: `Ember.testing` + +**Location**: `app/controllers/dashboard/builds.js` at line 12 + +```js + init() { + this._super(...arguments); + if (!Ember.testing) { + Visibility.every(config.intervals.updateTimes, this.updateTimes.bind(this)); + } +``` diff --git a/app/adapters/v3.js b/app/adapters/v3.js index b5951a79b8..a9c75c69c8 100644 --- a/app/adapters/v3.js +++ b/app/adapters/v3.js @@ -2,7 +2,7 @@ import { assign } from '@ember/polyfills'; import { underscore } from '@ember/string'; import { pluralize } from 'ember-inflector'; import config from 'travis/config/environment'; -import RESTAdapter from 'ember-data/adapters/rest'; +import RESTAdapter from '@ember-data/adapter/rest'; import { inject as service } from '@ember/service'; export default RESTAdapter.extend({ diff --git a/app/components/billing-summary-status.js b/app/components/billing-summary-status.js index 827d1ebb7e..cb456a331e 100644 --- a/app/components/billing-summary-status.js +++ b/app/components/billing-summary-status.js @@ -11,6 +11,6 @@ export default Component.extend({ hasGithubTrialEnded: and('subscription.isGithub', 'trial.isEnded'), noSubscription: empty('subscription'), isDefaultEducationView: computed('subscription', 'account.education', 'subscription.plan_name', function () { - return this.get('subscription') && !isEmpty(this.get('subscription')) && this.get('account.education'); + return this.subscription && !isEmpty(this.subscription) && this.get('account.education'); }) }); diff --git a/app/components/billing/address.js b/app/components/billing/address.js index ad663ce6ae..26b1ea0c15 100644 --- a/app/components/billing/address.js +++ b/app/components/billing/address.js @@ -2,7 +2,10 @@ import Component from '@ember/component'; import { task } from 'ember-concurrency'; import { inject as service } from '@ember/service'; import { observer } from '@ember/object'; -import { countries, nonZeroVatThresholdCountries } from 'travis/utils/countries'; +import { + countries, + nonZeroVatThresholdCountries +} from 'travis/utils/countries'; export default Component.extend({ countries, diff --git a/app/components/billing/credits-calculator.js b/app/components/billing/credits-calculator.js index 7ee9a6e69a..d250d16ee5 100644 --- a/app/components/billing/credits-calculator.js +++ b/app/components/billing/credits-calculator.js @@ -18,12 +18,12 @@ export default Component.extend({ selectPlan: null, bestPlan: computed('totalCredits', 'plans.[]', function () { - return this.get('plans').find(item => item.annual === this.get('isAnnual') && item.get('privateCredits') > this.get('totalCredits')); + return this.plans.find(item => item.annual === this.isAnnual && item.get('privateCredits') > this.totalCredits); }), totalPrice: computed('configurations.[]', function () { let sum = 0; - for (const configuration of this.get('configurations')) { + for (const configuration of this.configurations) { sum += configuration.price; } @@ -32,7 +32,7 @@ export default Component.extend({ totalCredits: computed('configurations.[]', function () { let sum = 0; - for (const configuration of this.get('configurations')) { + for (const configuration of this.configurations) { sum += configuration.credits; } @@ -44,7 +44,7 @@ export default Component.extend({ users: this.users, executions: [] }; - for (const build of this.get('builds')) { + for (const build of this.builds) { if (build.os.value !== undefined && parseInt(build.minutes) > 0) { let execution = { os: build.os.value, @@ -65,7 +65,7 @@ export default Component.extend({ this.api.post('/credits_calculator', { data }) .then((result) => { - this.get('configurations').clear(); + this.configurations.clear(); for (const creditResult of result.credits_results) { let config = { credits: creditResult.credits, @@ -97,7 +97,7 @@ export default Component.extend({ } } - this.get('configurations').pushObject(config); + this.configurations.pushObject(config); } }); }, @@ -121,23 +121,23 @@ export default Component.extend({ } } - this.get('builds').clear(); - this.get('builds').pushObject({ os: selectedOs, vmSize: selectedVmSize, minutes: result.minutes }); + this.builds.clear(); + this.builds.pushObject({ os: selectedOs, vmSize: selectedVmSize, minutes: result.minutes }); this.set('users', result.users); this.calculate(); }); }, addBuild() { - this.get('builds').pushObject({ os: {}, vmSize: {}, minutes: '' }); + this.builds.pushObject({ os: {}, vmSize: {}, minutes: '' }); }, close() { this.hideCalculator(); - this.get('builds').clear(); + this.builds.clear(); this.addBuild(); this.set('users', ''); - this.get('configurations').clear(); + this.configurations.clear(); }, actions: { @@ -160,7 +160,7 @@ export default Component.extend({ }, selectPlan() { - this.set('selectedPlan', this.get('bestPlan')); + this.set('selectedPlan', this.bestPlan); this.close(); this.selectPlan(this.form); }, diff --git a/app/components/billing/first-plan.js b/app/components/billing/first-plan.js index b9d5e96fc2..105869daad 100644 --- a/app/components/billing/first-plan.js +++ b/app/components/billing/first-plan.js @@ -4,7 +4,13 @@ import { inject as service } from '@ember/service'; import { not, reads, filterBy, alias } from '@ember/object/computed'; import { computed } from '@ember/object'; import config from 'travis/config/environment'; -import { countries, states, zeroVatThresholdCountries, nonZeroVatThresholdCountries, stateCountries } from 'travis/utils/countries'; +import { + countries, + states, + zeroVatThresholdCountries, + nonZeroVatThresholdCountries, + stateCountries +} from 'travis/utils/countries'; export default Component.extend({ stripe: service(), diff --git a/app/components/billing/payment-details-tab.js b/app/components/billing/payment-details-tab.js index 8128a620fb..68215ae36c 100644 --- a/app/components/billing/payment-details-tab.js +++ b/app/components/billing/payment-details-tab.js @@ -5,7 +5,13 @@ import { empty, not, reads, and } from '@ember/object/computed'; import { computed } from '@ember/object'; import config from 'travis/config/environment'; import { underscore } from '@ember/string'; -import { countries, states, stateCountries, nonZeroVatThresholdCountries, zeroVatThresholdCountries } from 'travis/utils/countries'; +import { + countries, + states, + stateCountries, + nonZeroVatThresholdCountries, + zeroVatThresholdCountries +} from 'travis/utils/countries'; export default Component.extend({ api: service(), @@ -26,7 +32,7 @@ export default Component.extend({ couponId: null, options: computed('disableForm', function () { let configStripe = config.stripeOptions; - configStripe['disabled'] = this.get('disableForm'); + configStripe['disabled'] = this.disableForm; return configStripe; }), showSwitchToFreeModal: false, @@ -39,7 +45,7 @@ export default Component.extend({ isSubscriptionsEmpty: and('isSubscriptionEmpty', 'isV2SubscriptionEmpty'), hasV2Subscription: not('isV2SubscriptionEmpty'), subscription: computed('v1subscription', 'v2subscription', function () { - return this.isV2SubscriptionEmpty ? this.get('v1subscription') : this.get('v2subscription'); + return this.isV2SubscriptionEmpty ? this.v1subscription : this.v2subscription; }), invoices: computed('v1subscription.id', 'v2subscription.id', function () { const subscriptionId = this.isV2SubscriptionEmpty ? this.get('v1subscription.id') : this.get('v2subscription.id'); diff --git a/app/components/billing/postal-address.js b/app/components/billing/postal-address.js index 0b44ba7f0b..2b1185f855 100644 --- a/app/components/billing/postal-address.js +++ b/app/components/billing/postal-address.js @@ -1,7 +1,13 @@ import Component from '@ember/component'; import { reads } from '@ember/object/computed'; import { computed } from '@ember/object'; -import { countries, states, zeroVatThresholdCountries, nonZeroVatThresholdCountries, stateCountries } from 'travis/utils/countries'; +import { + countries, + states, + zeroVatThresholdCountries, + nonZeroVatThresholdCountries, + stateCountries +} from 'travis/utils/countries'; export default Component.extend({ countries, diff --git a/app/components/billing/user-usage.js b/app/components/billing/user-usage.js index 79fbf98c42..72422766f8 100644 --- a/app/components/billing/user-usage.js +++ b/app/components/billing/user-usage.js @@ -13,7 +13,7 @@ export default Component.extend({ usersUsageReceived: reads('account.allowance.isFulfilled'), usersUsageRejected: reads('account.allowance.isRejected'), usersUsage: computed('account.allowance.userUsage', 'addonUsage', function () { - const userUsage = this.get('account').get('allowance').get('userUsage'); + const userUsage = this.account.get('allowance').get('userUsage'); if (userUsage === undefined) { return true; } diff --git a/app/components/branch-row.js b/app/components/branch-row.js index 804dd211c5..77a6ff4adc 100644 --- a/app/components/branch-row.js +++ b/app/components/branch-row.js @@ -22,7 +22,7 @@ export default Component.extend({ commitUrl: computed('branch.repository.slug', 'branch.last_build.commit.sha', 'vcsType', function () { const [owner, repo] = this.get('branch.repository.slug').split('/'); - const vcsType = this.get('vcsType'); + const vcsType = this.vcsType; const commit = this.get('branch.last_build.commit.sha'); return this.externalLinks.commitUrl(vcsType, { owner, repo, commit }); }), @@ -33,7 +33,7 @@ export default Component.extend({ }), provider: computed('vcsType', function () { - return this.get('vcsType') && this.get('vcsType').toLowerCase().replace('repository', ''); + return this.vcsType && this.vcsType.toLowerCase().replace('repository', ''); }), rawCreatedBy: alias('branch.last_build.created_by'), diff --git a/app/components/build-messages-list.js b/app/components/build-messages-list.js index 15e5da6633..3a39f49956 100644 --- a/app/components/build-messages-list.js +++ b/app/components/build-messages-list.js @@ -21,7 +21,7 @@ export default Component.extend(WithConfigValidation, { messages: reads('request.messages'), toggleStatusClass: computed('isExpanded', function () { - return this.get('isExpanded') ? 'expanded' : 'collapsed'; + return this.isExpanded ? 'expanded' : 'collapsed'; }), sortedMessages: sort('request.messages', (lft, rgt) => @@ -33,11 +33,11 @@ export default Component.extend(WithConfigValidation, { }), iconClass: computed('maxLevel', function () { - return `icon icon-${this.get('maxLevel')}`; + return `icon icon-${this.maxLevel}`; }), summary: computed('sortedMessages', function () { - let counts = countBy(this.get('sortedMessages'), 'level'); + let counts = countBy(this.sortedMessages, 'level'); if (Object.entries(counts).length > 0) { return Object.entries(counts).map((entry) => formatLevel(...entry)).join(', '); } diff --git a/app/components/dialogs/user-management-modal.js b/app/components/dialogs/user-management-modal.js index dc03b284a7..8404a0d725 100644 --- a/app/components/dialogs/user-management-modal.js +++ b/app/components/dialogs/user-management-modal.js @@ -55,7 +55,7 @@ export default Component.extend({ }), isAllSelected: computed('selectedUserIds', 'buildPermissionsToShow', function () { - const selectedUserIds = this.get('selectedUserIds'); + const selectedUserIds = this.selectedUserIds; if (Object.keys(selectedUserIds).length === 0) { return false; } diff --git a/app/components/owner/wizard.js b/app/components/owner/wizard.js index 85064117dd..66b416c682 100644 --- a/app/components/owner/wizard.js +++ b/app/components/owner/wizard.js @@ -30,7 +30,7 @@ export default Component.extend({ actions: { nextStep() { this.updateStep.perform(1); - if (this.wizardStep > 3) this.get('onClose')(); + if (this.wizardStep > 3) this.onClose(); }, previousStep() { this.updateStep.perform(-1); diff --git a/app/components/plan-usage.js b/app/components/plan-usage.js index 7ff2bcf338..ba66a69301 100644 --- a/app/components/plan-usage.js +++ b/app/components/plan-usage.js @@ -169,7 +169,7 @@ export default Component.extend({ await this.owner.fetchExecutions.perform(moment(this.dateRange.start).format('YYYY-MM-DD'), moment(this.dateRange.end || this.dateRange.start).format('YYYY-MM-DD')); const header = ['Job Id', 'Started at', 'Finished at', 'OS', 'Credits consumed', 'Minutes consumed', 'Repository', 'Owner', 'Sender']; - const data = this.get('executionsDataForCsv'); + const data = this.executionsDataForCsv; this.download.asCSV(fileName, header, data); }, @@ -182,7 +182,7 @@ export default Component.extend({ await this.owner.fetchExecutions.perform(moment(this.dateRange.start).format('YYYY-MM-DD'), moment(this.dateRange.end || this.dateRange.start).format('YYYY-MM-DD')); const header = ['Job Id', 'Sender', 'Credits consumed', 'Date']; - const data = await this.get('userLicenseExecutionsDataForCsv'); + const data = await this.userLicenseExecutionsDataForCsv; this.download.asCSV(fileName, header, data); }, diff --git a/app/components/repository-layout.js b/app/components/repository-layout.js index 8a98668ef5..50357c8325 100644 --- a/app/components/repository-layout.js +++ b/app/components/repository-layout.js @@ -61,7 +61,7 @@ export default Component.extend({ }, didRender() { - const repo = this.get('repo'); + const repo = this.repo; if (repo.hasBuildBackups === undefined) { repo.fetchInitialBuildBackups.perform(); diff --git a/app/components/request-config.js b/app/components/request-config.js index 7dbb4fdf74..1334954a6d 100644 --- a/app/components/request-config.js +++ b/app/components/request-config.js @@ -15,7 +15,7 @@ export default Component.extend({ }), formattedConfig: computed('config', 'slug', function () { - const config = this.get('config'); + const config = this.config; try { return JSON.stringify(config, null, 2); } catch (e) { diff --git a/app/components/status-images.js b/app/components/status-images.js index 002ab34207..630e2d6248 100644 --- a/app/components/status-images.js +++ b/app/components/status-images.js @@ -2,7 +2,10 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; import { computed } from '@ember/object'; import { reads } from '@ember/object/computed'; -import { bindKeyboardShortcuts, unbindKeyboardShortcuts } from 'ember-keyboard-shortcuts'; +import { + bindKeyboardShortcuts, + unbindKeyboardShortcuts +} from 'ember-keyboard-shortcuts'; import { task } from 'ember-concurrency'; import { IMAGE_FORMATS } from 'travis/services/status-images'; import BranchSearching from 'travis/mixins/branch-searching'; diff --git a/app/components/ui-kit/link.js b/app/components/ui-kit/link.js index c53bb5a69a..3a45d59215 100644 --- a/app/components/ui-kit/link.js +++ b/app/components/ui-kit/link.js @@ -1,6 +1,10 @@ import Component from '@ember/component'; import { checkColor } from 'travis/utils/ui-kit/assertions'; -import { COLORS, TEXT_COLORS, DEFAULT_TEXT_COLOR } from 'travis/components/ui-kit/text'; +import { + COLORS, + TEXT_COLORS, + DEFAULT_TEXT_COLOR +} from 'travis/components/ui-kit/text'; import prefix from 'travis/utils/ui-kit/prefix'; import concat from 'travis/utils/ui-kit/concat'; diff --git a/app/controllers/account/settings.js b/app/controllers/account/settings.js index eed5cdf1d4..f82eeed2c1 100644 --- a/app/controllers/account/settings.js +++ b/app/controllers/account/settings.js @@ -116,11 +116,11 @@ export default Controller.extend({ this.toggleProperty('isShowingAddKeyModal'); }, customKeyDeleted(key) { - const keys = this.get('customKeysLoaded'); + const keys = this.customKeysLoaded; this.set('customKeysLoaded', keys.filter(obj => obj.id !== key.id)); }, customKeyAdded(key) { - this.get('customKeysLoaded').pushObject(key); + this.customKeysLoaded.pushObject(key); } }, diff --git a/app/controllers/builds.js b/app/controllers/builds.js index c31a36e3bb..4aeecfb783 100644 --- a/app/controllers/builds.js +++ b/app/controllers/builds.js @@ -35,7 +35,7 @@ export default Controller.extend(...mixins, { hasBuildBackups: reads('repo.hasBuildBackups'), displayShowMoreButton: computed('tab', 'loadMoreBuilds.isRunning', 'builds', function () { - const builds = this.get('builds'); + const builds = this.builds; let tab = this.tab; if (this.oldBuilds.length === builds.length) { diff --git a/app/controllers/organization/settings.js b/app/controllers/organization/settings.js index 28567531f4..d827970eda 100644 --- a/app/controllers/organization/settings.js +++ b/app/controllers/organization/settings.js @@ -81,7 +81,7 @@ export default Controller.extend({ }, customKeyDeleted(key) { - const keys = this.get('customKeys'); + const keys = this.customKeys; this.set('model.organization.customKeys', keys.filter(obj => obj.id !== key.id)); }, diff --git a/app/models/commit.js b/app/models/commit.js index 5f06f74a3a..0a1c5e2684 100644 --- a/app/models/commit.js +++ b/app/models/commit.js @@ -53,7 +53,7 @@ export default Model.extend({ const owner = this.get('build.repo.ownerName'); const repo = this.get('build.repo.vcsName'); const vcsType = this.get('build.repo.vcsType'); - const commit = this.get('sha'); + const commit = this.sha; return this.externalLinks.commitUrl(vcsType, { owner, repo, commit }); }), diff --git a/app/models/repo.js b/app/models/repo.js index 41bb6d98f2..a705b6dd20 100644 --- a/app/models/repo.js +++ b/app/models/repo.js @@ -53,7 +53,7 @@ const Repo = VcsEntity.extend({ serverType: attr('string', { defaultValue: 'git' }), currentScan: computed('scanFailedAt', function () { - let scanFailedAt = this.get('scanFailedAt'); + let scanFailedAt = this.scanFailedAt; return { icon: scanFailedAt ? 'errored' : 'passed', state: scanFailedAt ? 'issue' : 'passed' @@ -132,7 +132,7 @@ const Repo = VcsEntity.extend({ return false; const isPro = this.get('features.proVersion'); const enterprise = !!this.get('features.enterpriseVersion'); - const roMode = this.get('owner').ro_mode || false; + const roMode = this.owner.ro_mode || false; if (!isPro || enterprise) { return !roMode; @@ -279,7 +279,7 @@ const Repo = VcsEntity.extend({ cronJobs: computed('id', 'fetchCronJobs.lastSuccessful.value', function () { const crons = this.fetchCronJobs.get('lastSuccessful.value'); if (!crons) { - this.get('fetchCronJobs').perform(); + this.fetchCronJobs.perform(); } return crons || []; }), diff --git a/app/routes/legacy-repo-url.js b/app/routes/legacy-repo-url.js index 98e7ff6fa7..e5399aa761 100644 --- a/app/routes/legacy-repo-url.js +++ b/app/routes/legacy-repo-url.js @@ -1,5 +1,8 @@ import Route from '@ember/routing/route'; -import { vcsConfigByUrlPrefix, defaultVcsConfig } from 'travis/utils/vcs'; +import { + vcsConfigByUrlPrefix, + defaultVcsConfig +} from 'travis/utils/vcs'; import { isEmpty } from '@ember/utils'; export default Route.extend({ diff --git a/app/routes/provider.js b/app/routes/provider.js index daedd06b8e..6e730ab024 100644 --- a/app/routes/provider.js +++ b/app/routes/provider.js @@ -1,5 +1,8 @@ import Route from '@ember/routing/route'; -import { vcsConfigByUrlPrefix, defaultVcsConfig } from 'travis/utils/vcs'; +import { + vcsConfigByUrlPrefix, + defaultVcsConfig +} from 'travis/utils/vcs'; export default Route.extend({ beforeModel(transition) { diff --git a/app/serializers/repo.js b/app/serializers/repo.js index 4105f32a34..e6fd65d74c 100644 --- a/app/serializers/repo.js +++ b/app/serializers/repo.js @@ -1,5 +1,5 @@ import RepoV2FallbackSerializer from 'travis/serializers/repo_v2_fallback'; -import EmbeddedRecordsMixin from 'ember-data/serializers/embedded-records-mixin'; +import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest'; let Serializer = RepoV2FallbackSerializer.extend(EmbeddedRecordsMixin, { attrs: { diff --git a/app/serializers/v3.js b/app/serializers/v3.js index 6e547bd4d0..472d8daa27 100644 --- a/app/serializers/v3.js +++ b/app/serializers/v3.js @@ -2,7 +2,7 @@ import { underscore } from '@ember/string'; import { isArray } from '@ember/array'; import { assert } from '@ember/debug'; import { isNone, typeOf } from '@ember/utils'; -import JSONSerializer from 'ember-data/serializers/json'; +import JSONSerializer from '@ember-data/serializer/json'; import wrapWithArray from 'travis/utils/wrap-with-array'; import traverse from 'travis/utils/traverse-payload'; diff --git a/app/services/auth.js b/app/services/auth.js index a1874089ca..9b138f7d31 100644 --- a/app/services/auth.js +++ b/app/services/auth.js @@ -17,7 +17,10 @@ import { import { getOwner } from '@ember/application'; import config from 'travis/config/environment'; import { task, didCancel } from 'ember-concurrency'; -import { availableProviders, vcsConfigByUrlPrefixOrType } from 'travis/utils/vcs'; +import { + availableProviders, + vcsConfigByUrlPrefixOrType +} from 'travis/utils/vcs'; const { authEndpoint, apiEndpoint } = config; diff --git a/app/services/multi-vcs.js b/app/services/multi-vcs.js index 9fe7a7e842..dc7f4280eb 100644 --- a/app/services/multi-vcs.js +++ b/app/services/multi-vcs.js @@ -1,7 +1,11 @@ import Service, { inject as service } from '@ember/service'; import { computed } from '@ember/object'; import { not, or, reads } from '@ember/object/computed'; -import { defaultVcsConfig, vcsConfig, vcsConfigByUrlPrefix } from 'travis/utils/vcs'; +import { + defaultVcsConfig, + vcsConfig, + vcsConfigByUrlPrefix +} from 'travis/utils/vcs'; export default Service.extend({ auth: service(), diff --git a/app/services/store.js b/app/services/store.js index f082e1dd5a..d453ac53bc 100644 --- a/app/services/store.js +++ b/app/services/store.js @@ -1,5 +1,5 @@ /* eslint-disable camelcase */ -import Store from 'ember-data/store'; +import Store from '@ember-data/store'; import PaginatedCollectionPromise from 'travis/utils/paginated-collection-promise'; import { inject as service } from '@ember/service'; import FilteredArrayManager from 'travis/utils/filtered-array-manager'; diff --git a/app/templates/components/billing/payment-details-tab.hbs b/app/templates/components/billing/payment-details-tab.hbs index 51bdef1643..98984df16a 100644 --- a/app/templates/components/billing/payment-details-tab.hbs +++ b/app/templates/components/billing/payment-details-tab.hbs @@ -215,7 +215,7 @@ {{#if this.isLoading}} {{else}} - {{g-recaptcha onSuccess=(action "onCaptchaResolved") size="invisible"}} + diff --git a/app/templates/components/dialogs/user-management-modal.hbs b/app/templates/components/dialogs/user-management-modal.hbs index d89da6e342..203b560893 100644 --- a/app/templates/components/dialogs/user-management-modal.hbs +++ b/app/templates/components/dialogs/user-management-modal.hbs @@ -132,14 +132,7 @@ {{#if (gt this.filteredBuildPermissionsCount this.perPage)}} - {{pagination-links - currentPage=this.page - showFirstAndLast=false - lastPage=this.maxPages - prevPageIcon='Prev' - nextPageIcon='Next' - goToPage=(action 'setPage') - }} + {{/if}} diff --git a/app/templates/components/dialogs/user-statistics-modal.hbs b/app/templates/components/dialogs/user-statistics-modal.hbs index 39526d48fc..6188792d88 100644 --- a/app/templates/components/dialogs/user-statistics-modal.hbs +++ b/app/templates/components/dialogs/user-statistics-modal.hbs @@ -73,14 +73,7 @@ {{#if (gt this.usersCount this.perPage)}} - {{pagination-links - currentPage=this.page - showFirstAndLast=false - lastPage=this.maxPages - prevPageIcon='Prev' - nextPageIcon='Next' - goToPage=(action 'setPage') - }} + {{/if}} diff --git a/app/templates/components/insights-overlay.hbs b/app/templates/components/insights-overlay.hbs index 52a5d8a799..193d9b48e0 100644 --- a/app/templates/components/insights-overlay.hbs +++ b/app/templates/components/insights-overlay.hbs @@ -17,7 +17,7 @@ {{/if}}

{{! CTA }} - + {{#if this.canSync}}