Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temp banner #2807

Open
wants to merge 7 commits into
base: production_stable_01_03_24
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
require: rubocop-performance

Documentation:
Enabled: false
Metrics/ClassLength:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Metrics/LineLength:
Enabled: false
Metrics/MethodLength:
Max: 40
Style/AsciiComments:
Enabled: false
Metrics/AbcSize:
Enabled: false
Style/GuardClause:
Enabled: false
Style/FormatStringToken:
Enabled: false
Lint/AssignmentInCondition:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
Naming/MemoizedInstanceVariableName:
EnforcedStyleForLeadingUnderscores: required
Style/MultilineBlockChain:
Enabled: false
Lint/ConstantDefinitionInBlock:
Enabled: false
Naming/VariableNumber:
Enabled: false
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.2
3.2.2
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.4
FROM ruby:3.2.2

LABEL maintainer Travis CI GmbH <[email protected]>

Expand Down
27 changes: 17 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
ruby "~> 2.4.2"
# frozen_string_literal: true

ruby '~> 3.2.2'

source 'https://rubygems.org'

gem 'travis-web', path: 'waiter'
gem 'puma', '~> 3.12.4'
gem 'rack-ssl', '~> 1.4'
gem 'rack-protection', '~> 1.4'
gem 'rack-mobile-detect'
gem 'sinatra'
gem 'hashr'
gem 'puma', '~> 6'
gem 'rack-mobile-detect'
gem 'rack-protection', '~> 3.0'
gem 'rack-ssl', '~> 1.4'
gem 'sanitize'
gem 'sinatra'
gem 'travis-web', path: 'waiter'

group :development, :test do
gem 'rake'
end


group :development do
# gem 'debugger'
gem 'foreman'
gem 'rubocop'
gem 'rubocop-performance'
gem 'rubocop-rspec'
gem 'simplecov'
gem 'simplecov-console'
end

group :test do
gem 'rspec', '~> 2.11'
gem 'test-unit'
gem 'rspec', '~> 3.12'
gem 'rack-test'
gem 'sinatra-contrib'
gem 'test-unit'
end
156 changes: 108 additions & 48 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,78 +6,138 @@ PATH
GEM
remote: https://rubygems.org/
specs:
backports (3.6.8)
ansi (1.5.0)
ast (2.4.2)
crass (1.0.6)
diff-lcs (1.2.5)
foreman (0.82.0)
thor (~> 0.19.1)
hashr (2.0.0)
mini_portile2 (2.4.0)
multi_json (1.12.1)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
nokogumbo (2.0.2)
nokogiri (~> 1.8, >= 1.8.4)
power_assert (0.4.1)
puma (3.12.6)
rack (1.6.12)
diff-lcs (1.5.0)
docile (1.4.0)
foreman (0.87.2)
hashr (2.0.1)
json (2.6.3)
language_server-protocol (3.17.0.3)
multi_json (1.15.0)
mustermann (3.0.0)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.9)
nokogiri (1.15.2-x86_64-linux)
racc (~> 1.4)
parallel (1.23.0)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
power_assert (2.0.3)
puma (6.3.0)
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.7)
rack-mobile-detect (0.4.0)
rack
rack-protection (1.5.5)
rack-protection (3.0.6)
rack
rack-ssl (1.4.1)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (12.3.3)
rspec (2.99.0)
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
rspec-core (2.99.2)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.99.4)
sanitize (5.2.1)
rack-test (2.1.0)
rack (>= 1.3)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.8.1)
rexml (3.2.5)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
rubocop (1.54.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.23.1)
rubocop (~> 1.33)
rubocop-performance (1.18.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rspec (2.22.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
sanitize (6.0.1)
crass (~> 1.0.2)
nokogiri (>= 1.8.0)
nokogumbo (~> 2.0)
sinatra (1.4.8)
rack (~> 1.5)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
sinatra-contrib (1.4.7)
backports (>= 2.0)
nokogiri (>= 1.12.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-console (0.9.1)
ansi
simplecov
terminal-table
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sinatra (3.0.6)
mustermann (~> 3.0)
rack (~> 2.2, >= 2.2.4)
rack-protection (= 3.0.6)
tilt (~> 2.0)
sinatra-contrib (3.0.6)
multi_json
rack-protection
rack-test
sinatra (~> 1.4.0)
tilt (>= 1.3, < 3)
test-unit (3.2.3)
mustermann (~> 3.0)
rack-protection (= 3.0.6)
sinatra (= 3.0.6)
tilt (~> 2.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
test-unit (3.6.1)
power_assert
thor (0.19.1)
tilt (2.0.8)
tilt (2.2.0)
unicode-display_width (2.4.2)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
foreman
hashr
puma (~> 3.12.4)
puma (~> 6)
rack-mobile-detect
rack-protection (~> 1.4)
rack-protection (~> 3.0)
rack-ssl (~> 1.4)
rack-test
rake
rspec (~> 2.11)
rspec (~> 3.12)
rubocop
rubocop-performance
rubocop-rspec
sanitize
simplecov
simplecov-console
sinatra
sinatra-contrib
test-unit
travis-web!

RUBY VERSION
ruby 2.4.2p198
ruby 3.2.2p53

BUNDLED WITH
1.17.3
2.4.14
21 changes: 21 additions & 0 deletions app/components/account-token.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import Component from '@ember/component';
import { reads } from '@ember/object/computed';
import { inject as service } from '@ember/service';

export default Component.extend({
classNames: ['account-token'],

api: service(),
auth: service(),

localStorage: service('storage'),
authStorage: reads('localStorage.auth'),

flashes: service(),

tokenIsVisible: false,
showCopySuccess: false,
showRegenerateButton: false,

actions: {
tokenVisibility() {
Expand All @@ -19,5 +30,15 @@ export default Component.extend({
this.toggleProperty('showCopySuccess');
}
},

regenerateToken() {
this.api.patch('/access_token').then((data) => {
this.auth.handleTokenRegeneration(data['token']);

this.flashes.success('Token successfully regenerated!');
}).catch(() => {
this.flashes.error('There was an error regenerating the token.');
});
}
},
});
5 changes: 4 additions & 1 deletion app/components/billing/authorization.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export default Component.extend({
requiresSource: equal('subscription.paymentIntent.status', 'requires_source'),
lastPaymentIntentError: reads('subscription.paymentIntent.last_payment_error'),
retryAuthorizationClientSecret: reads('subscription.paymentIntent.client_secret'),
hasSubscriptionPermissions: reads('account.hasSubscriptionPermissions'),
notChargeInvoiceSubscription: not('subscription.chargeUnpaidInvoices.lastSuccessful.value'),
freeV2Plan: equal('subscription.plan.startingPrice', 0),
isSubscribed: reads('subscription.isSubscribed'),
Expand All @@ -32,6 +31,10 @@ export default Component.extend({
canCancelSubscription: computed('isSubscribed', 'hasSubscriptionPermissions', 'freeV2Plan', 'isTrial', function () {
return this.isSubscribed && this.hasSubscriptionPermissions && !this.freeV2Plan && !this.isTrial;
}),

hasSubscriptionPermissions: computed('account.hasSubscriptionPermissions', 'account.permissions', function () {
return this.account.hasSubscriptionPermissions && (!this.account.isOrganization || this.account.permissions.plan_create);
}),
cancelSubscriptionLoading: reads('subscription.cancelSubscription.isRunning'),
isTrial: reads('subscription.plan.isTrial'),
isLoading: or('accounts.fetchSubscriptions.isRunning', 'accounts.fetchV2Subscriptions.isRunning',
Expand Down
9 changes: 9 additions & 0 deletions app/components/billing/payment-details-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export default Component.extend({
metrics: service(),

countries,

model: reads('activeModel'),
states: computed('country', function () {
const { country } = this;

Expand All @@ -37,6 +39,12 @@ export default Component.extend({
isV2SubscriptionEmpty: empty('v2subscription'),
isSubscriptionEmpty: empty('v1subscription'),
isSubscriptionsEmpty: and('isSubscriptionEmpty', 'isV2SubscriptionEmpty'),
canViewBilling: computed('model', function () {
return !this.account.isOrganization || this.account.permissions.billing_view;
}),
canEditBilling: computed('model', function () {
return !this.account.isOrganization || this.account.permissions.billing_update;
}),
hasV2Subscription: not('isV2SubscriptionEmpty'),
subscription: computed('v1subscription', 'v2subscription', function () {
return this.isV2SubscriptionEmpty ? this.get('v1subscription') : this.get('v2subscription');
Expand Down Expand Up @@ -91,6 +99,7 @@ export default Component.extend({
});
if (token) {
paymentDetails['token'] = token.id;
paymentDetails['fingerprint'] = token.card.fingerprint;
}
const endpoint = this.isV2SubscriptionEmpty ? 'subscription' : 'v2_subscription';
yield this.api.patch(`/${endpoint}/${subscription.id}/payment_details`, {
Expand Down
3 changes: 3 additions & 0 deletions app/components/billing/select-plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export default Component.extend({
return false;
}
}),
hasPlanChangePermission: computed('account', function () {
return !this.account.isOrganization || this.account.permissions.plan_create;
}),

save: task(function* () {
if (this.next.perform) {
Expand Down
Loading