-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Yuqiang/arenas sort by difficulty #7753
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
Conversation
WalkthroughThe pull request includes significant modifications across several files, primarily focusing on localization updates, schema enhancements, and UI improvements. The Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Outside diff range and nitpick comments (4)
app/schemas/models/level.js (1)
429-430
: LGTM! Consider adding URL validation.The addition of the
arenaCurriculumUrl
property is well-implemented and properly documented. It's correctly placed within the schema and its purpose is clearly defined.Consider adding URL validation to ensure the entered value is a valid URL. You can use the
format: 'url'
property in the schema definition, like this:- arenaCurriculumUrl: c.url({ title: 'Arena Curriculum URL', description: 'Needed for arena levels only. Relevant for teacher dashboard (ai league page)', inEditor: 'codecombat' }), + arenaCurriculumUrl: c.url({ title: 'Arena Curriculum URL', description: 'Needed for arena levels only. Relevant for teacher dashboard (ai league page)', inEditor: 'codecombat', format: 'url' }),This will ensure that only valid URLs are accepted for this field.
app/views/ladder/components/LadderPanel.vue (1)
263-276
: Ensure color contrast meets accessibility standardsThe background and text colors defined for difficulty levels should have sufficient contrast to meet accessibility guidelines. For example, the colors for
.difficulty__color__advanced
might not provide enough contrast for visually impaired users.Consider adjusting the colors to enhance readability:
&.difficulty__color { &__beginner { background-color: #d4edbc; color: #4f8a10; } &__intermediate { background-color: #ffe5a0; color: #9f6000; } &__advanced { - background-color: #ffcfc9; - color: #9f6000; + background-color: #f8d7da; + color: #721c24; } }app/locale/en.js (2)
Line range hint
4-4
: Reminder: Address the TODO comment.The TODO comment indicates that tests are missing for this function. Please ensure that the additional parameter change is thoroughly tested to confirm that it behaves as expected.
Do you want me to generate the unit testing code or open a GitHub issue to track this task?
Line range hint
12-24
: Consider adjusting the fee structure or discount policy.The implementation of a flat $20 fee on discounted bills could negate the benefit of the discount, especially for smaller purchases or marginal loyalty tiers. This might lead to customer dissatisfaction, as the intent to reward loyalty paradoxically increases the bill.
Consider revising either the discount percentages or the flat fee application to better align with customer incentives.
Would you like assistance in generating a revised implementation?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (4)
- app/locale/en.js (1 hunks)
- app/schemas/models/level.js (1 hunks)
- app/views/ladder/MainLadderViewV2.vue (11 hunks)
- app/views/ladder/components/LadderPanel.vue (5 hunks)
🧰 Additional context used
🔇 Additional comments (6)
app/views/ladder/components/LadderPanel.vue (3)
13-24
: Component structure and bindings look goodThe additions to the template, including the dynamic class bindings and computed properties for difficulty display, are well-structured and correctly implemented.
258-262
: Adjust the position of.tournament__difficulty
classThe CSS rule for
.tournament__difficulty
setsbottom: 100%
, which might cause layout issues if the parent element doesn't have a defined height. Ensure that this positioning achieves the desired visual effect across different screen sizes and browsers.Test the layout on various devices to confirm the styling behaves as expected.
170-171
: Check compatibility of the optional chaining operatorThe use of the optional chaining operator
?.
inarenaCurriculum
might not be compatible with older browsers if not properly transpiled. Ensure that your build process includes transpilation for optional chaining to maintain browser compatibility.Run the following script to check if the project’s Babel configuration includes the necessary plugin:
✅ Verification successful
Optional Chaining Transpilation Verified
Confirmed that
@babel/plugin-proposal-optional-chaining
is included in Babel configurations (package.json
and.babelrc
), ensuring compatibility with older browsers.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if @babel/plugin-proposal-optional-chaining is included in the Babel configuration. # Test: Search for the optional chaining plugin in Babel config files. # Expected result: The plugin should be listed in the Babel configuration. rg "@babel/plugin-proposal-optional-chaining" babel.config.jsLength of output: 117
Script:
#!/bin/bash # Description: Verify if @babel/plugin-proposal-optional-chaining is included in any Babel configuration files. # Search in package.json rg "@babel/plugin-proposal-optional-chaining" package.json # Search in .babelrc rg "@babel/plugin-proposal-optional-chaining" .babelrc # Search in any babel configuration files within the config directory rg "@babel/plugin-proposal-optional-chaining" config/*.js # Search in any other possible Babel config files rg "@babel/plugin-proposal-optional-chaining" **/babel.config.*Length of output: 455
app/views/ladder/MainLadderViewV2.vue (2)
287-302
:sortArenaFn
method correctly sorts arenas by difficulty and curriculum URLThe
sortArenaFn
function effectively sorts arenas first by difficulty in ascending order and then prioritizes arenas with aarenaCurriculumUrl
. This logic aligns with the intended sorting criteria outlined in the PR objectives.
407-416
: CSS adjustments for.two-col
class implement proper two-column layoutThe styling changes to the
.two-col
class correctly establish a responsive two-column layout for the arenas. The use of flex properties ensures that the columns are evenly spaced and adaptable.app/locale/en.js (1)
Line range hint
1-2
: LGTM!The function logic is correct, and the implementation is accurate.
}, | ||
}, | ||
tournament: { | ||
type: Object, | ||
default () { | ||
return undefined | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remove unnecessary default value for the tournament
prop
Since the default value for an Object prop is undefined
, you can omit the default function. This cleans up the code.
Apply this diff to remove the unnecessary default function:
tournament: {
type: Object,
- default () {
- return undefined
- },
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
}, | |
}, | |
tournament: { | |
type: Object, | |
default () { | |
return undefined | |
} | |
}, | |
}, | |
}, | |
tournament: { | |
type: Object, | |
}, |
window.open(this.arenaCurriculum, '_blank') | ||
} | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure openCurriculum
method handles undefined URLs
In the openCurriculum
m
8000
ethod, if this.arenaCurriculum
is undefined or null, window.open
may open a blank page. It's good practice to check if the URL is valid before attempting to open it.
Add a check before opening the URL:
openCurriculum () {
+ if (this.arenaCurriculum) {
window.open(this.arenaCurriculum, '_blank')
+ }
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
window.open(this.arenaCurriculum, '_blank') | |
} | |
} | |
}, | |
openCurriculum () { | |
if (this.arenaCurriculum) { | |
window.open(this.arenaCurriculum, '_blank') | |
} | |
}, |
championship: { | ||
type: Boolean, | ||
default () { | ||
return false | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Simplify the default value assignment for the championship
prop
For Boolean props, you can assign the default value directly without using a function. This simplifies the code and makes it more readable.
Apply this diff to simplify the default value assignment:
championship: {
type: Boolean,
- default () {
- return false
- },
+ default: false,
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
championship: { | |
type: Boolean, | |
default () { | |
return false | |
}, | |
}, | |
championship: { | |
type: Boolean, | |
default: false, | |
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can we make Regular and Championship Heading center aligned?
- Instead of blank space at top when we don't have championship, just show
Coming Soon...
. - Add some more space between Regular and Championship columns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- app/views/ladder/MainLadderViewV2.vue (13 hunks)
🧰 Additional context used
🔇 Additional comments (1)
app/views/ladder/MainLadderViewV2.vue (1)
415-419
: Verify vertical centering in '.coming-soon' classThe
.coming-soon
class usesmargin-top: auto
andmargin-bottom: auto
to center content vertically. However, vertical centering withauto
margins requires the parent container to havedisplay: flex
andflex-direction: column
.Ensure the parent container has the appropriate flex properties:
.parent-container { display: flex; flex-direction: column; }If the parent container isn’t a flex container with
flex-direction: column
, the vertical centering will not work as intended.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- app/views/ladder/MainLadderViewV2.vue (14 hunks)
- app/views/ladder/components/LadderPanel.vue (5 hunks)
🧰 Additional context used
🔇 Additional comments (5)
app/views/ladder/MainLadderViewV2.vue (1)
Line range hint
1-561
: Overall improvements in arena organization and presentationThe changes in this file significantly enhance the organization and presentation of arenas. The introduction of a two-column layout, separation of regular and championship arenas, and improved sorting mechanisms contribute to a better user experience.
Key improvements:
- Two-column layout for better visual organization
- Separation of regular and championship arenas
- New computed properties for efficient sorting and filtering of arenas
- Updated styling to support the new layout
While these changes are positive, consider implementing the suggested optimizations to further improve:
- Accessibility through semantic HTML
- Code readability and performance in the
sortArenaFn
- Responsiveness of the two-column layout
These enhancements will result in a more robust and user-friendly implementation.
app/views/ladder/components/LadderPanel.vue (4)
195-198
: Great job handling undefined curriculum URLsThe added check for
this.arenaCurriculum
before callingwindow.open
in theopenCurriculum
method ensures that attempts to open undefined or null URLs are prevented. This enhances the robustness of the code.
92-95
: Consistent prop definition forchampionship
The new
championship
prop is correctly defined as a Boolean with a default value offalse
. This maintains consistency and clarity in the component's API.
168-169
: Correct usage of optional chaining inarenaCurriculum
The use of optional chaining in:
return ARENA_CURRICULUM?.[this.arena.slug] || this.arena.arenaCurriculumUrlis appropriate and helps prevent errors when
ARENA_CURRICULUM
might be undefined.
258-276
: Verify CSS class nesting for difficulty stylingIn the SCSS code for difficulty styling, the nested classes under
&.difficulty__color
may not generate the intended CSS selectors.Run the following script to verify the generated CSS class names:
Ensure that the classes match those used in the template.
✅ Verification successful
CSS class nesting for difficulty styling is correctly implemented.
All expected nested classes under
.difficulty__color
are present and correctly defined.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the compiled CSS for correct class names related to difficulty levels. # Expected: Class names like 'difficulty__color__beginner' should be correctly generated. # Since we cannot compile SCSS here, please ensure that the nesting structure produces the correct class names in the compiled CSS.Length of output: 0
Script:
#!/bin/bash # Description: Verify the nesting of difficulty__color classes in LadderPanel.vue SCSS. # Search for .difficulty__color and its nested classes in LadderPanel.vue rg '\.difficulty__color(?:__\w+)?' app/views/ladder/components/LadderPanel.vueLength of output: 106
Script:
#!/bin/bash # Description: Verify the presence of nested difficulty__color classes in LadderPanel.vue SCSS. # Search for nested classes &__beginner, &__intermediate, &__advanced under .difficulty__color rg '\.difficulty__color\s*\{\s*(?:&__\w+\s*\{)' app/views/ladder/components/LadderPanel.vueLength of output: 93
Script:
#!/bin/bash # Description: Verify the presence of nested difficulty__color classes in LadderPanel.vue SCSS. # Search for each nested class under .difficulty__color rg '&__beginner' app/views/ladder/components/LadderPanel.vue rg '&__intermediate' app/views/ladder/components/LadderPanel.vue rg '&__advanced' app/views/ladder/components/LadderPanel.vueLength of output: 256
sortArenaFn (a, b) { | ||
// Compare difficulties, defaulting to 999 if undefined | ||
const difficultyA = a.difficulty ?? 999 | ||
const difficultyB = b.difficulty ?? 999 | ||
|
||
if (difficultyA !== difficultyB) { | ||
return difficultyA - difficultyB | ||
} | ||
|
||
// Prioritize arenas with a curriculum URL | ||
const hasCurriculumA = Boolean(a.arenaCurriculumUrl) | ||
const hasCurriculumB = Boolean(b.arenaCurriculumUrl) | ||
|
||
if (hasCurriculumA && !hasCurriculumB) { | ||
return -1 | ||
} | ||
if (!hasCurriculumA && hasCurriculumB) { | ||
return 1 | ||
} | ||
|
||
// If all else is equal | ||
return 0 | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Optimize sortArenaFn
for better readability and performance
The sortArenaFn
method can be optimized for better readability and performance.
Consider the following optimizations:
sortArenaFn (a, b) {
// Compare difficulties
const diffA = a.difficulty ?? Infinity;
const diffB = b.difficulty ?? Infinity;
if (diffA !== diffB) return diffA - diffB;
// Prioritize arenas with a curriculum URL
const hasUrlA = Boolean(a.arenaCurriculumUrl);
const hasUrlB = Boolean(b.arenaCurriculumUrl);
return hasUrlB - hasUrlA;
}
This optimization:
- Uses
Infinity
instead of999
for undefined difficulties, which is more semantically correct. - Simplifies the curriculum URL comparison using subtraction of boolean values.
- Removes unnecessary
if
statements, making the function more concise.
.current-tournaments { | ||
width: 70%; | ||
margin-bottom: 2rem; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Improve responsiveness of the two-column layout
The current implementation of the two-column layout might not be responsive on smaller screens.
Consider using flexbox with a media query for better responsiveness:
.ladder-view {
// ... existing styles ...
.current-tournaments {
width: 100%;
max-width: 70%;
margin-bottom: 2rem;
margin-left: auto;
margin-right: auto;
}
.two-col {
display: flex;
flex-wrap: wrap;
align-items: stretch;
justify-content: space-between;
margin-bottom: 2rem;
> * {
flex-basis: 100%;
margin-bottom: 1rem;
}
@media (min-width: 768px) {
> * {
flex-basis: 48%;
}
}
}
}
This change ensures that the layout adapts to smaller screens while maintaining the two-column layout on larger screens.
Also applies to: 434-443
currentRegularArena () { | ||
return this.usableArenas.find(a => a.slug === this.currentRegular?.slug) | ||
}, | ||
currentChampionshipArena () { | ||
return this.usableArenas.find(a => a.slug === this.currentChampionship?.slug) | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Use optional chaining consistently
The use of optional chaining is inconsistent in the currentRegularArena
and currentChampionshipArena
computed properties.
Apply optional chaining consistently:
currentRegularArena () {
- return this.usableArenas.find(a => a.slug === this.currentRegular?.slug)
+ return this.usableArenas?.find(a => a.slug === this.currentRegular?.slug)
},
currentChampionshipArena () {
- return this.usableArenas.find(a => a.slug === this.currentChampionship?.slug)
+ return this.usableArenas?.find(a => a.slug === this.currentChampionship?.slug)
},
This change ensures that the code handles potential undefined
values consistently.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
currentRegularArena () { | |
return this.usableArenas.find(a => a.slug === this.currentRegular?.slug) | |
}, | |
currentChampionshipArena () { | |
return this.usableArenas.find(a => a.slug === this.currentChampionship?.slug) | |
}, | |
currentRegularArena () { | |
return this.usableArenas?.find(a => a.slug === this.currentRegular?.slug) | |
}, | |
currentChampionshipArena () { | |
return this.usableArenas?.find(a => a.slug === this.currentChampionship?.slug) | |
}, |
<div class="two-col"> | ||
<div class="ladder-view__text center-text"> | ||
{{ $t('league.regular') }} | ||
</div> | ||
<div class="ladder-view__text center-text"> | ||
{{ $t('league.championship') }} | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Improve accessibility with semantic HTML
The use of div
elements for headings in the two-column layout could be improved for better accessibility.
Consider using semantic HTML elements for better structure and accessibility:
- <div class="ladder-view__text center-text">
- {{ $t('league.regular') }}
- </div>
- <div class="ladder-view__text center-text">
- {{ $t('league.championship') }}
- </div>
+ <h4 class="ladder-view__text center-text">
+ {{ $t('league.regular') }}
+ </h4>
+ <h4 class="ladder-view__text center-text">
+ {{ $t('league.championship') }}
+ </h4>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<div class="two-col"> | |
<div class="ladder-view__text center-text"> | |
{{ $t('league.regular') }} | |
</div> | |
<div class="ladder-view__text center-text"> | |
{{ $t('league.championship') }} | |
</div> | |
<div class="two-col"> | |
<h4 class="ladder-view__text center-text"> | |
{{ $t('league.regular') }} | |
</h4> | |
<h4 class="ladder-view__text center-text"> | |
{{ $t('league.championship') }} | |
</h4> |
<ladder-panel | ||
v-if="currentChampionship" | ||
:championship="true" | ||
:arena="currentChampionshipArena" | ||
:clan-id="currentSelectedClan?._id" | ||
:can-create="canUseArenaHelpers && tournamentsLeft > 0" | ||
:can-edit="false" | ||
:disabled="tournamentsLeft <= 0" | ||
@create-tournament="handleCreateTournament(currentChampionshipArena)" | ||
/> | ||
<div | ||
v-else | ||
class="ladder-view__text center-text coming-soon" | ||
> | ||
{{ $t('common.coming_soon') }} | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Simplify conditional rendering for championship panel
The current implementation uses an v-if
and v-else
block for the championship panel, which can be simplified.
Consider simplifying the conditional rendering:
- <ladder-panel
- v-if="currentChampionship"
- :championship="true"
- :arena="currentChampionshipArena"
- :clan-id="currentSelectedClan?._id"
- :can-create="canUseArenaHelpers && tournamentsLeft > 0"
- :can-edit="false"
- :disabled="tournamentsLeft <= 0"
- @create-tournament="handleCreateTournament(currentChampionshipArena)"
- />
- <div
- v-else
- class="ladder-view__text center-text coming-soon"
- >
- {{ $t('common.coming_soon') }}
- </div>
+ <ladder-panel
+ v-if="currentChampionship"
+ :championship="true"
+ :arena="currentChampionshipArena"
+ :clan-id="currentSelectedClan?._id"
+ :can-create="canUseArenaHelpers && tournamentsLeft > 0"
+ :can-edit="false"
+ :disabled="tournamentsLeft <= 0"
+ @create-tournament="handleCreateTournament(currentChampionshipArena)"
+ />
+ <div
+ v-else-if="!currentChampionship"
+ class="ladder-view__text center-text coming-soon"
+ >
+ {{ $t('common.coming_soon') }}
+ </div>
This change makes the condition more explicit and easier to understand.
Committable suggestion was skipped due to low confidence.
:class="`difficulty__color__${difficulty} ${tournament ? 'tournament__difficulty' : ''}`" | ||
> | ||
{{ $t('play.level_difficulty') }} <span class="arena__stars">{{ difficultyStars(arena.difficulty) }}</span> | ||
{{ difficultyI18n }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle potential undefined difficulty
in class binding
In the template, when binding the class for difficulty:
:class="`difficulty__color__${difficulty} ${tournament ? 'tournament__difficulty' : ''}`"
Ensure that the difficulty
computed property always returns a valid string. If difficulty
is undefined, it could result in incorrect class names and styling issues.
Consider setting a default value or adjusting the computation to handle unexpected arena.difficulty
values.
difficulty () { | ||
const difficulties = ['beginner', 'intermediate', 'advanced'] | ||
const index = this.championship ? this.arena.difficulty - 3 : this.arena.difficulty - 1 | ||
return difficulties[index] | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure difficulty
index is within bounds
In the difficulty
computed property, the calculation of index
may result in an out-of-bounds error if this.arena.difficulty
doesn't fall within the expected range. This could cause runtime errors.
Apply this diff to add validation and default handling:
difficulty () {
const difficulties = ['beginner', 'intermediate', 'advanced']
const index = this.championship ? this.arena.difficulty - 3 : this.arena.difficulty - 1
+ if (index < 0 || index >= difficulties.length) {
+ return 'beginner' // or an appropriate default value
+ }
return difficulties[index]
},
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
difficulty () { | |
const difficulties = ['beginner', 'intermediate', 'advanced'] | |
const index = this.championship ? this.arena.difficulty - 3 : this.arena.difficulty - 1 | |
return difficulties[index] | |
}, | |
difficulty () { | |
const difficulties = ['beginner', 'intermediate', 'advanced'] | |
const index = this.championship ? this.arena.difficulty - 3 : this.arena.difficulty - 1 | |
if (index < 0 || index >= difficulties.length) { | |
return 'beginner' // or an appropriate default value | |
} | |
return difficulties[index] | |
}, |
tournament still use 1 col to show enough info



avaliable arenas show in 2 cols
order by -- current league arenas first, then difficulty low first, finally with curriculum URL first.
fix ENG-1236
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Improvements