DEV: Update linting (#269)

This commit is contained in:
Jarek Radosz 2025-03-17 12:41:43 +01:00 committed by GitHub
parent 9e38a69dbb
commit 854b3f223f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 1266 additions and 1349 deletions

View File

@ -7,80 +7,93 @@ GIT
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
activesupport (7.1.3.3) activesupport (8.0.2)
base64 base64
benchmark (>= 0.3)
bigdecimal bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5) connection_pool (>= 2.2.5)
drb drb
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1) minitest (>= 5.1)
mutex_m securerandom (>= 0.3)
tzinfo (~> 2.0) tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2) ast (2.4.2)
base64 (0.2.0) base64 (0.2.0)
bigdecimal (3.1.8) benchmark (0.4.0)
concurrent-ruby (1.2.3) bigdecimal (3.1.9)
connection_pool (2.4.1) concurrent-ruby (1.3.5)
connection_pool (2.5.0)
drb (2.2.1) drb (2.2.1)
i18n (1.14.5) i18n (1.14.7)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
json (2.7.2) json (2.10.2)
language_server-protocol (3.17.0.3) language_server-protocol (3.17.0.4)
minitest (5.23.1) lint_roller (1.1.0)
mutex_m (0.2.0) logger (1.6.6)
parallel (1.24.0) minitest (5.25.5)
parser (3.3.1.0) parallel (1.26.3)
parser (3.3.7.1)
ast (~> 2.4.1) ast (~> 2.4.1)
racc racc
prettier_print (1.2.1) prettier_print (1.2.1)
racc (1.8.0) racc (1.8.1)
rack (3.0.12) rack (3.1.12)
rainbow (3.1.1) rainbow (3.1.1)
regexp_parser (2.9.2) regexp_parser (2.10.0)
rexml (3.3.9) rubocop (1.74.0)
rubocop (1.64.0)
json (~> 2.3) json (~> 2.3)
language_server-protocol (>= 3.17.0) language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.3.0.2) parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0) regexp_parser (>= 2.9.3, < 3.0)
rexml (>= 3.2.5, < 4.0) rubocop-ast (>= 1.38.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0) unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.31.3) rubocop-ast (1.38.1)
parser (>= 3.3.1.0) parser (>= 3.3.1.0)
rubocop-capybara (2.20.0) rubocop-capybara (2.22.1)
rubocop (~> 1.41) lint_roller (~> 1.1)
rubocop-discourse (3.8.0) rubocop (~> 1.72, >= 1.72.1)
rubocop-discourse (3.12.1)
activesupport (>= 6.1) activesupport (>= 6.1)
rubocop (>= 1.59.0) lint_roller (>= 1.1.0)
rubocop-capybara (>= 2.0.0) rubocop (>= 1.73.2)
rubocop-factory_bot (>= 2.0.0) rubocop-capybara (>= 2.22.0)
rubocop-rails (>= 2.25.0) rubocop-factory_bot (>= 2.27.0)
rubocop-rspec (>= 2.25.0) rubocop-rails (>= 2.30.3)
rubocop-factory_bot (2.25.1) rubocop-rspec (>= 3.0.1)
rubocop (~> 1.41) rubocop-rspec_rails (>= 2.31.0)
rubocop-rails (2.25.0) rubocop-factory_bot (2.27.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.30.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0) rubocop (>= 1.72.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0) rubocop-ast (>= 1.38.0, < 2.0)
rubocop-rspec (2.29.2) rubocop-rspec (3.5.0)
rubocop (~> 1.40) lint_roller (~> 1.1)
rubocop-capybara (~> 2.17) rubocop (~> 1.72, >= 1.72.1)
rubocop-factory_bot (~> 2.22) rubocop-rspec_rails (2.31.0)
rubocop-rspec_rails (~> 2.28) lint_roller (~> 1.1)
rubocop-rspec_rails (2.28.3) rubocop (~> 1.72, >= 1.72.1)
rubocop (~> 1.40) rubocop-rspec (~> 3.5)
ruby-progressbar (1.13.0) ruby-progressbar (1.13.0)
securerandom (0.4.1)
syntax_tree (6.2.0) syntax_tree (6.2.0)
prettier_print (>= 1.2.0) prettier_print (>= 1.2.0)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0) unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
PLATFORMS PLATFORMS
ruby ruby
@ -91,4 +104,4 @@ DEPENDENCIES
translations-manager! translations-manager!
BUNDLED WITH BUNDLED WITH
2.5.10 2.6.6

View File

@ -9,6 +9,7 @@ import { i18n } from "discourse-i18n";
export default class AdminPluginsDiscourseSubscriptionsController extends Controller { export default class AdminPluginsDiscourseSubscriptionsController extends Controller {
@service dialog; @service dialog;
loading = false; loading = false;
@discourseComputed @discourseComputed

View File

@ -1,3 +1,4 @@
/* stylelint-disable scss/no-global-function-names */
.subscription-campaign-sidebar { .subscription-campaign-sidebar {
#main-outlet #main-outlet
.container.list-container .container.list-container
@ -9,23 +10,19 @@
grid-template-columns: 78% calc(22% - 2em); grid-template-columns: 78% calc(22% - 2em);
grid-template-areas: "content sidebar"; grid-template-areas: "content sidebar";
grid-column-gap: 2em; grid-column-gap: 2em;
span:first-of-type { span:first-of-type {
grid-area: sidebar; grid-area: sidebar;
} }
} }
} }
// All
.campaign-banner {
box-shadow: 5px 5px
var(--discourse_subscriptions_campaign_banner_shadow_color);
}
// Sidebar Version // Sidebar Version
.subscriptions-campaign-sidebar .campaign-banner { .subscriptions-campaign-sidebar .campaign-banner {
width: 100%; width: 100%;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
.btn.close { .btn.close {
position: absolute; position: absolute;
top: 1em; top: 1em;
@ -33,6 +30,7 @@
font-size: 10px; font-size: 10px;
z-index: 1; z-index: 1;
} }
.campaign-banner-info { .campaign-banner-info {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -40,11 +38,13 @@
width: calc(100% - 2em); width: calc(100% - 2em);
padding: 1em 1em 2em 1em; padding: 1em 1em 2em 1em;
position: relative; position: relative;
&-header { &-header {
font-size: $font-up-5; font-size: $font-up-5;
margin: 0 !important; margin: 0 !important;
text-align: center; text-align: center;
} }
&-description { &-description {
width: 100%; width: 100%;
font-size: $font-down-1; font-size: $font-down-1;
@ -52,10 +52,12 @@
margin-bottom: 1em; margin-bottom: 1em;
} }
} }
.campaign-banner-progress { .campaign-banner-progress {
width: calc(100% - 2em); width: calc(100% - 2em);
margin: 1em 0; margin: 1em 0;
padding: 1em; padding: 1em;
&-users { &-users {
align-items: stretch; align-items: stretch;
display: flex; display: flex;
@ -64,18 +66,22 @@
&-title { &-title {
font-size: $font-down-1; font-size: $font-down-1;
strong { strong {
font-weight: bold; font-weight: bold;
} }
} }
} }
} }
.campaign-banner-info-button { .campaign-banner-info-button {
height: 2em; height: 2em;
} }
progress[value] { progress[value] {
height: 1.5em; height: 1.5em;
} }
.campaign-banner-progress-description { .campaign-banner-progress-description {
font-size: $font-down-1; font-size: $font-down-1;
} }
@ -97,10 +103,14 @@ body.archetype-regular {
border: 1px solid var(--primary-low); border: 1px solid var(--primary-low);
position: relative; position: relative;
align-items: stretch; align-items: stretch;
box-shadow: 5px 5px
var(--discourse_subscriptions_campaign_banner_shadow_color);
@media screen and (max-width: 400px) { @media screen and (max-width: 400px) {
width: 98%; width: 98%;
flex-direction: column; flex-direction: column;
} }
.btn.close { .btn.close {
position: absolute; position: absolute;
top: 1em; top: 1em;
@ -108,16 +118,19 @@ body.archetype-regular {
font-size: 10px; font-size: 10px;
background-color: transparent; background-color: transparent;
padding: 0; padding: 0;
&:hover { &:hover {
.d-icon { .d-icon {
color: var(--primary); color: var(--primary);
} }
} }
} }
&-info { &-info {
width: 30%; width: 30%;
padding: 0.5em 2em 0.5em; padding: 0.5em 2em 0.5em;
background-color: var(--primary-very-low); background-color: var(--primary-very-low);
@media screen and (min-width: 1000px) { @media screen and (min-width: 1000px) {
width: 40%; width: 40%;
display: grid; display: grid;
@ -125,6 +138,7 @@ body.archetype-regular {
grid-template-areas: "left right" "left right"; grid-template-areas: "left right" "left right";
align-items: center; align-items: center;
} }
@media screen and (max-width: 400px) { @media screen and (max-width: 400px) {
width: calc(100% - 4em); width: calc(100% - 4em);
display: flex; display: flex;
@ -132,23 +146,29 @@ body.archetype-regular {
align-items: center; align-items: center;
padding-bottom: 1em; padding-bottom: 1em;
} }
&-header { &-header {
font-size: $font-up-6; font-size: $font-up-6;
margin: 0; margin: 0;
@media screen and (max-width: 750px) { @media screen and (max-width: 750px) {
font-size: $font-up-3; font-size: $font-up-3;
} }
} }
&-success { &-success {
width: 100%; width: 100%;
margin: 0; margin: 0;
} }
&-description { &-description {
width: 100%; width: 100%;
margin: 0.25em 0 1em 0; margin: 0.25em 0 1em 0;
@media screen and (max-width: 750px) { @media screen and (max-width: 750px) {
font-size: $font-down-1; font-size: $font-down-1;
} }
@media screen and (max-width: 400px) { @media screen and (max-width: 400px) {
text-align: center; text-align: center;
} }
@ -159,14 +179,17 @@ body.archetype-regular {
height: 2.5em; height: 2.5em;
padding: 0.75em 1.5em 0.75em 2.75em; padding: 0.75em 1.5em 0.75em 2.75em;
position: relative; position: relative;
.d-icon { .d-icon {
position: absolute; position: absolute;
left: 1em; left: 1em;
&.hover-heart { &.hover-heart {
opacity: 0; opacity: 0;
transition: opacity 0.2s ease-in-out; transition: opacity 0.2s ease-in-out;
} }
} }
&:hover { &:hover {
.d-icon.hover-heart { .d-icon.hover-heart {
opacity: 1; opacity: 1;
@ -174,12 +197,15 @@ body.archetype-regular {
} }
} }
} }
&-progress { &-progress {
width: 60%; width: 60%;
padding: 1.5em 2em 1.5em; padding: 1.5em 2em 1.5em;
@media screen and (max-width: 400px) { @media screen and (max-width: 400px) {
width: calc(100% - 4em); width: calc(100% - 4em);
} }
&-success { &-success {
height: 32px; height: 32px;
background: linear-gradient( background: linear-gradient(
@ -194,13 +220,16 @@ body.archetype-regular {
background-size: 400% 100%; background-size: 400% 100%;
animation: gradient 15s ease infinite; animation: gradient 15s ease infinite;
} }
&-description { &-description {
margin: 0.5em 0 0; margin: 0.5em 0 0;
font-weight: 300; font-weight: 300;
strong { strong {
font-weight: bold; font-weight: bold;
} }
} }
&-users { &-users {
align-items: center; align-items: center;
display: inline-flex; display: inline-flex;
@ -211,13 +240,13 @@ body.archetype-regular {
font-weight: bold; font-weight: bold;
} }
} }
&-avatars { &-avatars {
margin: 0 0 0 0.5em; margin: 0 0 0 0.5em;
} }
} }
progress[value] { progress[value] {
-webkit-appearance: none;
appearance: none; appearance: none;
height: 2.5em; height: 2.5em;
width: 100%; width: 100%;
@ -264,28 +293,36 @@ html:not(.mobile-view) .subscriptions-campaign-topic-footer .campaign-banner {
margin-top: 2em; margin-top: 2em;
height: min-content; height: min-content;
width: calc(100% + 14em); width: calc(100% + 14em);
.btn.close { .btn.close {
top: 1em; top: 1em;
right: 1em; right: 1em;
} }
.campaign-banner-info { .campaign-banner-info {
width: 65%; width: 65%;
&-header { &-header {
font-size: $font-up-6; font-size: $font-up-6;
} }
&-description { &-description {
font-size: $font-down-1; font-size: $font-down-1;
margin: 0.25em 0.25em 1em 0 !important; margin: 0.25em 0.25em 1em 0 !important;
} }
} }
.campaign-banner-progress { .campaign-banner-progress {
padding: 1.5em 2.5em 1em; padding: 1.5em 2.5em 1em;
progress[value] { progress[value] {
height: 2em; height: 2em;
} }
.campaign-banner-progress-users { .campaign-banner-progress-users {
margin-top: 1em; margin-top: 1em;
} }
.campaign-banner-progress-users-title { .campaign-banner-progress-users-title {
margin: 0; margin: 0;
} }
@ -297,9 +334,11 @@ html:not(.mobile-view) .subscriptions-campaign-topic-footer .campaign-banner {
0% { 0% {
background-position: 0% 50%; background-position: 0% 50%;
} }
50% { 50% {
background-position: 100% 50%; background-position: 100% 50%;
} }
100% { 100% {
background-position: 0% 50%; background-position: 0% 50%;
} }
@ -322,7 +361,8 @@ $heightpartial: calc($height / 1.2);
$box-shadow: (); $box-shadow: ();
@for $i from 0 through $particles { @for $i from 0 through $particles {
$box-shadow: $box-shadow, $box-shadow:
$box-shadow,
random($width) - random($width) -
$halfwidth + $halfwidth +
px px
@ -333,19 +373,19 @@ $box-shadow: ();
} }
@mixin keyframes($animationName) { @mixin keyframes($animationName) {
@-webkit-keyframes #{$animationName} { @keyframes #{$animationName} {
@content; @content;
} }
@-moz-keyframes #{$animationName} { @keyframes #{$animationName} {
@content; @content;
} }
@-o-keyframes #{$animationName} { @keyframes #{$animationName} {
@content; @content;
} }
@-ms-keyframes #{$animationName} { @keyframes #{$animationName} {
@content; @content;
} }
@ -355,44 +395,29 @@ $box-shadow: ();
} }
@mixin animation-delay($settings) { @mixin animation-delay($settings) {
-moz-animation-delay: $settings;
-webkit-animation-delay: $settings;
-o-animation-delay: $settings;
-ms-animation-delay: $settings;
animation-delay: $settings; animation-delay: $settings;
} }
@mixin animation-duration($settings) { @mixin animation-duration($settings) {
-moz-animation-duration: $settings;
-webkit-animation-duration: $settings;
-o-animation-duration: $settings;
-ms-animation-duration: $settings;
animation-duration: $settings; animation-duration: $settings;
} }
@mixin animation($settings) { @mixin animation($settings) {
-moz-animation: $settings;
-webkit-animation: $settings;
-o-animation: $settings;
-ms-animation: $settings;
animation: $settings; animation: $settings;
} }
@mixin transform($settings) { @mixin transform($settings) {
transform: $settings; transform: $settings;
-moz-transform: $settings;
-webkit-transform: $settings;
-o-transform: $settings;
-ms-transform: $settings;
} }
body:not(.archetype-regular):not(.success-animation-off) { body:not(.archetype-regular, .success-animation-off) {
.fireworks > .before, .fireworks > .before,
.fireworks > .after { .fireworks > .after {
position: absolute; position: absolute;
width: 5px; width: 5px;
height: 5px; height: 5px;
border-radius: 50%; border-radius: 50%;
@include animation( @include animation(
( (
1s bang ease-out 1s 2 backwards, 1s bang ease-out 1s 2 backwards,
@ -427,21 +452,25 @@ body:not(.archetype-regular):not(.success-animation-off) {
margin-top: -2%; margin-top: -2%;
margin-left: -43%; margin-left: -43%;
} }
20%, 20%,
39.9% { 39.9% {
margin-top: 2%; margin-top: 2%;
margin-left: -18%; margin-left: -18%;
} }
40%, 40%,
59.9% { 59.9% {
margin-top: 0%; margin-top: 0%;
margin-left: 0%; margin-left: 0%;
} }
60%, 60%,
79.9% { 79.9% {
margin-top: 4%; margin-top: 4%;
margin-left: 18%; margin-left: 18%;
} }
80%, 80%,
99.9% { 99.9% {
margin-top: 6%; margin-top: 6%;

View File

@ -1,7 +1,6 @@
.discourse-subscriptions-section-columns { .discourse-subscriptions-section-columns {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin: 20px; margin: 20px;
padding: 20px; padding: 20px;
@ -55,15 +54,19 @@
.product-description { .product-description {
flex-grow: 1; flex-grow: 1;
} }
.product-purchase { .product-purchase {
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
justify-content: space-between; justify-content: space-between;
.purchased { .purchased {
color: var(--success); color: var(--success);
} }
.billing-link { .billing-link {
align-self: flex-end; align-self: flex-end;
@include breakpoint(large) { @include breakpoint(large) {
margin-top: 1em; margin-top: 1em;
} }

View File

@ -18,6 +18,7 @@ textarea[readonly] {
.btn-right { .btn-right {
text-align: right; text-align: right;
} }
.align-buttons { .align-buttons {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
@ -36,6 +37,7 @@ textarea[readonly] {
position: relative; position: relative;
top: 2px; top: 2px;
} }
.plan-currency { .plan-currency {
width: 70px; width: 70px;
} }
@ -46,12 +48,14 @@ textarea[readonly] {
table.discourse-subscriptions-user-table { table.discourse-subscriptions-user-table {
width: 100%; width: 100%;
th, th,
td { td {
padding-top: 8px; padding-top: 8px;
padding-bottom: 8px; padding-bottom: 8px;
padding-left: 8px; padding-left: 8px;
} }
th:first-child, th:first-child,
td:first-child { td:first-child {
padding-left: 0; padding-left: 0;

View File

@ -23,14 +23,11 @@
.StripeElement { .StripeElement {
box-sizing: border-box; box-sizing: border-box;
padding: 10px; padding: 10px;
height: 40px; height: 40px;
margin-bottom: 9px; margin-bottom: 9px;
border: 1px solid var(--primary-medium); border: 1px solid var(--primary-medium);
background-color: var(--secondary); background-color: var(--secondary);
font-size: $base-font-size; font-size: $base-font-size;
font-family: $base-font-family; font-family: $base-font-family;
} }
@ -68,6 +65,7 @@
.address-fields { .address-fields {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
& > input, & > input,
& > .select-kit { & > .select-kit {
width: calc(50% - 4.5px); width: calc(50% - 4.5px);

View File

@ -1,6 +1,7 @@
.mobile-view { .mobile-view {
.product-list { .product-list {
flex-flow: column nowrap; flex-flow: column nowrap;
.product { .product {
width: unset; width: unset;
} }

View File

@ -1,10 +1,11 @@
{ {
"private": true, "private": true,
"devDependencies": { "devDependencies": {
"@discourse/lint-configs": "2.4.0", "@discourse/lint-configs": "2.11.1",
"ember-template-lint": "6.1.0", "ember-template-lint": "7.0.1",
"eslint": "9.19.0", "eslint": "9.22.0",
"prettier": "2.8.8" "prettier": "3.5.3",
"stylelint": "16.16.0"
}, },
"engines": { "engines": {
"node": ">= 22", "node": ">= 22",

2364
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

3
stylelint.config.mjs Normal file
View File

@ -0,0 +1,3 @@
export default {
extends: ["@discourse/lint-configs/stylelint"],
};

View File

@ -35,12 +35,14 @@ module("Subscriptions | payment-options", function (hooks) {
const testState = new State(); const testState = new State();
await render(<template> await render(
<PaymentOptions <template>
@plans={{plans}} <PaymentOptions
@selectedPlan={{testState.selectedPlan}} @plans={{plans}}
/> @selectedPlan={{testState.selectedPlan}}
</template>); />
</template>
);
assert.dom(".btn-discourse-subscriptions-subscribe").exists({ count: 2 }); assert.dom(".btn-discourse-subscriptions-subscribe").exists({ count: 2 });

View File

@ -16,9 +16,11 @@ module("Subscriptions | payment-plan", function (hooks) {
}; };
let selectedPlan; let selectedPlan;
await render(<template> await render(
<PaymentPlan @plan={{plan}} @selectedPlan={{selectedPlan}} /> <template>
</template>); <PaymentPlan @plan={{plan}} @selectedPlan={{selectedPlan}} />
</template>
);
assert assert
.dom(".btn-discourse-subscriptions-subscribe") .dom(".btn-discourse-subscriptions-subscribe")
@ -46,9 +48,11 @@ module("Subscriptions | payment-plan", function (hooks) {
const testState = new State(); const testState = new State();
await render(<template> await render(
<PaymentPlan @plan={{plan}} @selectedPlan={{testState.selectedPlan}} /> <template>
</template>); <PaymentPlan @plan={{plan}} @selectedPlan={{testState.selectedPlan}} />
</template>
);
assert assert
.dom(".btn-discourse-subscriptions-subscribe:first-child .interval") .dom(".btn-discourse-subscriptions-subscribe:first-child .interval")