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

[FEATURE] introducing wave info to expansion #496

Merged
merged 2 commits into from
Mar 13, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ describe('Expedition creation and run through', () => {
cy.get('p').contains('Oblivium Resin').should('be.visible')
cy.get('p').contains('Transmogrifier').should('be.visible')
cy.get('p').contains('Breach Extractor').should('be.visible')
cy.get('p').contains('Amplify Vision').scrollIntoView()
cy.get('p').contains('Amplify Vision').should('be.visible')
cy.get('p').contains('Feral Lightning').should('be.visible')
cy.get('p').contains('Celestial Spire').should('be.visible')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { ExpansionContentStateSlice } from './types'
import { createSelector } from 'reselect'
import * as Languages from '../../Languages'
import * as Ids from '../ids'
import * as types from 'aer-types/types'

import { selectors as LanguageSelectors } from '../../Languages'
import { ContentStruct } from '../../helpers'
import { Expansion } from 'aer-types/types'

const getContent = (state: ExpansionContentStateSlice) =>
state.Settings.Expansions.Expansions.content
Expand All @@ -13,7 +14,7 @@ const getId = (_: unknown, props: { expansionId: string }) => props.expansionId

export const getContentWithLanguageFallback = (
languages: Languages.State,
content: ContentStruct<Expansion>,
content: ContentStruct<types.Expansion>,
id: string
) => {
// Just get the corresponding expansion id from the english version
Expand All @@ -22,12 +23,25 @@ export const getContentWithLanguageFallback = (
return content[language][id] || content.ENG[id]
}

const getExpansionsWithLanguageFallback = createSelector(
[getContent, Ids.selectors.getIds, LanguageSelectors.getLanguagesByExpansion],
(content, ids, languages) => {
let result: types.Expansions = {}
ids.forEach(
(id) =>
(result[id] = getContentWithLanguageFallback(languages, content, id))
)
return result
}
)

const getExpansionById = createSelector(
[LanguageSelectors.getLanguagesByExpansion, getContent, getId],
getContentWithLanguageFallback
)

export const selectors = {
getContent,
getExpansionsWithLanguageFallback,
getExpansionById,
}
1 change: 1 addition & 0 deletions src/aer-data/src/DE/aeonsEnd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const aeonsEndData: IExpansion = {
id: 'AE',
name: 'Aeons End',
wave: 'W1-BA - Aeons End',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/DE/outerDark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const outerDarkData: IExpansion = {
id: 'OD',
name: 'Hinter der Finsternis',
wave: 'W2-E1 - Für die Ewigkeit',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/DE/promos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { upgradedBasicNemesisCards } from './upgradedBasicNemesisCards'
export const promosData: IExpansion = {
id: 'promos',
name: 'Promos',
wave: 'Weitere',
type: 'promo',
mages,
nemeses,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/DE/theDepths/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theDepthsData: IExpansion = {
id: 'Depths',
name: 'Aus den Tiefen',
wave: 'W1-E1 - Aeons End',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/DE/theNameless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theNamelessData: IExpansion = {
id: 'Nameless',
name: 'Das Namenlose',
wave: 'W1-E2 - Aeons End',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/DE/theVoid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theVoidData: IExpansion = {
id: 'TV',
name: 'Die Leere',
wave: 'W2-E2 - Für die Ewigkeit',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/DE/warEternal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const warEternalData: IExpansion = {
id: 'WE',
name: 'Für die Ewigkeit',
wave: 'W2-BA - Für die Ewigkeit',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/aeonsEnd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const aeonsEndData: IExpansion = {
id: 'AE',
name: 'Aeons End',
wave: 'W1 - Aeons End',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/buriedSecrets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const buriedSecretsData: IExpansion = {
id: 'BS',
name: 'Buried Secrets',
wave: 'W3 - Legacy',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/community/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const communityData: IExpansion = {
id: 'community',
name: 'Community',
wave: 'Others',
type: 'promo',
mages,
nemeses,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/intoTheWild/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { treasures } from './treasures'
export const intoTheWildData: IExpansion = {
id: 'IW',
name: 'Into The Wild',
wave: 'W4 - The New Age',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/legacy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const legacyData: IExpansion = {
id: 'Legacy',
name: 'Legacy',
wave: 'W3 - Legacy',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/legacyOfGravehold/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { upgradedBasicNemesisCards } from './upgradedBasicNemesisCards'
export const legacyOfGraveholdData: IExpansion = {
id: 'LOG',
name: 'Legacy of Gravehold',
wave: 'W6 - The Legacy of Gravehold',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/outcasts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { upgradedBasicNemesisCards } from './upgradedBasicNemesisCards'
export const outcastsData: IExpansion = {
id: 'O',
name: 'Outcasts',
wave: 'W5 - Outcasts',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/outerDark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const outerDarkData: IExpansion = {
id: 'OD',
name: 'Outer Dark',
wave: 'W2 - War Eternal',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/promos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { upgradedBasicNemesisCards } from './upgradedBasicNemesisCards'
export const promosData: IExpansion = {
id: 'promos',
name: 'Promos',
wave: 'Others',
type: 'promo',
mages,
nemeses,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/returnToGravehold/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { treasures } from './treasures'
export const returnToGraveholdData: IExpansion = {
id: 'RTG',
name: 'Return To Gravehold',
wave: 'W5 - Outcasts',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/shatteredDreams/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { treasures } from './treasures'
export const shatteredDreamsData: IExpansion = {
id: 'SD',
name: 'Shattered Dreams',
wave: 'W4 - The New Age',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/southernVillage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { treasures } from './treasures'
export const southernVillageData: IExpansion = {
id: 'SV',
name: 'Southern Village',
wave: 'W5 - Outcasts',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/theAncients/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { upgradedBasicNemesisCards } from './upgradedBasicNemesisCards'
export const theAncientsData: IExpansion = {
id: 'TA',
name: 'The Ancients',
wave: 'W4 - The New Age',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/theDepths/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theDepthsData: IExpansion = {
id: 'Depths',
name: 'The Depths',
wave: 'W1 - Aeons End',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/theNameless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theNamelessData: IExpansion = {
id: 'Nameless',
name: 'The Nameless',
wave: 'W1 - Aeons End',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/theNewAge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { upgradedBasicNemesisCards } from './upgradedBasicNemesisCards'
export const newAgeData: IExpansion = {
id: 'NA',
name: 'The New Age',
wave: 'W4 - The New Age',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/theRuins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theRuinsData: IExpansion = {
id: 'RU',
name: 'The Ruins',
wave: 'W6 - The Legacy of Gravehold',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/theVoid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theVoidData: IExpansion = {
id: 'TV',
name: 'The Void',
wave: 'W2 - War Eternal',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/ENG/warEternal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const warEternalData: IExpansion = {
id: 'WE',
name: 'War Eternal',
wave: 'W2 - War Eternal',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/FR/aeonsEnd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const aeData: IExpansion = {
id: 'AE',
name: "Aeon's End",
wave: "W1 - Aeon's End",
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/FR/theDepths/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const depthsData: IExpansion = {
id: 'Depths',
name: 'Les Profondeurs',
wave: "W1 - Aeon's End",
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/FR/theNameless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const namelessData: IExpansion = {
id: 'Nameless',
name: 'Les Sans-Noms',
wave: "W1 - Aeon's End",
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/FR/warEternal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const weData: IExpansion = {
id: 'WE',
name: 'Guerre éternelle',
wave: 'W2 - Guerre éternelle',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/aeonsEnd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const aeonsEndData: IExpansion = {
id: 'AE',
name: 'Aeons End',
wave: 'W1 - Aeons End',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/buriedSecrets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const buriedSecretsData: IExpansion = {
id: 'BS',
name: 'Pogrzebane Sekrety',
wave: 'W3 - Legacy',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/intoTheWild/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { treasures } from './treasures'
export const intoTheWildData: IExpansion = {
id: 'IW',
name: 'Tajemnica Dziczy',
wave: 'W4 - Nowy Początek',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/legacy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const legacyData: IExpansion = {
id: 'Legacy',
name: 'Legacy',
wave: 'W3 - Legacy',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/outerDark/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const outerDarkData: IExpansion = {
id: 'OD',
name: 'Niezbadany Mrok',
wave: 'W2 - Wieczna Wojna',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/promos/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const promosData: IExpansion = {
id: 'promos',
name: 'Promos',
wave: 'Dalej',
type: 'promo',
mages,
nemeses,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/theDepths/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theDepthsData: IExpansion = {
id: 'Depths',
name: 'Czeluście',
wave: 'W1 - Aeons End',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/theNameless/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theNamelessData: IExpansion = {
id: 'Nameless',
name: 'Bezimienni',
wave: 'W1 - Aeons End',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/theNewAge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { upgradedBasicNemesisCards } from './upgradedBasicNemesisCards'
export const newAgeData: IExpansion = {
id: 'NA',
name: 'Nowy Początek',
wave: 'W4 - Nowy Początek',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/theVoid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { cards } from './cards'
export const theVoidData: IExpansion = {
id: 'TV',
name: 'Otchłań',
wave: 'W2 - Wieczna Wojna',
type: 'mini',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/PL/warEternal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { basicNemesisCards } from './basicNemesisCards'
export const warEternalData: IExpansion = {
id: 'WE',
name: 'Wieczna Wojna',
wave: 'W2 - Wieczna Wojna',
type: 'standalone',
nemeses,
mages,
Expand Down
1 change: 1 addition & 0 deletions src/aer-data/src/createNormalizedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const createNormalizedData = (
[id]: {
id,
name: expansion.name,
wave: expansion.wave,
type: expansion.type,
},
},
Expand Down
Loading