Skip to content

Commit

Permalink
feat: support steel path fissure filtering (#865)
Browse files Browse the repository at this point in the history
* feat: support steel path fissure filtering

* nit: update keys for localization
  • Loading branch information
TobiTenno committed Sep 12, 2022
1 parent 7612869 commit 60e7630
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 24 deletions.
65 changes: 44 additions & 21 deletions components/panels/FissuresPanel.vue
Expand Up @@ -30,6 +30,14 @@
height="24px"
width="24px"
/>
<HubImg
v-if="fissure.isHard"
:src="steelPath"
:name="$t('fissures.steelPath')"
class="li-mission-decorator li-mission-decorator-lg no-invert"
height="24px"
width="24px"
/>
</span>
</b-list-group-item>

Expand Down Expand Up @@ -60,6 +68,7 @@ import HubPanelWrap from '@/components/HubPanelWrap';
import { cdn } from '@/services/utilities';
const archwing = cdn('svg/archwing.svg');
const steelPath = cdn('svg/arbitrations.svg');
const fissureIcons = [];
const lith = cdn('svg/fissures/1.svg');
Expand All @@ -71,14 +80,46 @@ fissureIcons.push(lith, meso, neo, axi, requiem);
export default {
name: 'FissurePanel',
props: ['fissures'],
components: {
TimeBadge,
HubImg,
NoDataItem,
HubPanelWrap,
},
props: {
fissures: {
type: Array,
default: () => [],
},
},
data() {
return {
styleObject: {
display: 'inline',
'vertical-align': 'middle',
},
archwing,
steelPath,
options: [
{ text: this.$t('fissures.header'), value: 'fissures' },
{ text: this.$t('fissures.voidstorm'), value: 'storms' },
{ text: this.$t('fissures.steelPath'), value: 'steelPath' },
{ text: this.$t('fissures.all'), value: 'fissures-storms-steelPath' },
],
};
},
computed: {
...mapGetters('worldstate', ['fissureDisplays', 'fissurePlanetStates']),
headertext() {
return this.$t('fissures.header');
},
check: {
get() {
if (this.fissureDisplays === 'fissures-storms') {
// update, in case the site data is outdate
this.$store.commit('worldstate/commitFissureDisplaysState', ['fissures-storms-steelPath']);
return 'fissures-storms-steelPath';
}
return this.fissureDisplays;
},
set(value) {
Expand All @@ -99,6 +140,8 @@ export default {
let include = !fissure.expired;
if (fissure.isStorm) {
include = include && this.check.includes('storms');
} else if (fissure.isHard) {
include = include && this.check.includes('steelPath');
} else {
include = include && this.check.includes('fissures');
}
Expand All @@ -114,25 +157,5 @@ export default {
return fissureIcons[fissure.tierNum - 1] || lith;
},
},
data() {
return {
styleObject: {
display: 'inline',
'vertical-align': 'middle',
},
archwing,
options: [
{ text: this.$t('fissures.header'), value: 'fissures' },
{ text: this.$t('fissures.both'), value: 'fissures-storms' },
{ text: this.$t('fissures.voidstorm'), value: 'storms' },
],
};
},
components: {
TimeBadge,
HubImg,
NoDataItem,
HubPanelWrap,
},
};
</script>
75 changes: 73 additions & 2 deletions cypress/e2e/timers/load.spec.js
Expand Up @@ -4,9 +4,80 @@ describe('Timers', () => {
cy.wait(1000);
});
describe('Fissures', () => {
let fissures;
it('should load', () => {
const fissures = cy.get('div.fissures');
fissures.children().should('have.length', 2);
cy.get('div.fissures').as('fissures');
cy.get('@fissures').children().should('have.length', 2);

cy.get('div.fissures .list-group-item.list-group-item-borderbottom').as('fissureSelection');
cy.get('@fissureSelection').find('.btn.btn-outline-primary.btn-sm').as('selectionButtons');

cy.get('@selectionButtons').should('have.length', 4);
cy.get('@selectionButtons').eq(0).should('have.text', 'Fissures');
cy.get('@selectionButtons').eq(1).should('have.text', 'Void Storm');
cy.get('@selectionButtons').eq(2).should('have.text', 'Steel Path');
cy.get('@selectionButtons').eq(3).should('have.text', 'All');

cy.get('div.fissures>.list-group>.list-group-item.list-group-item-borderless.pb-0').then(($el) => {
// eslint-disable-next-line no-undef
fissures = Cypress.dom.wrap($el);
cy.get('@fissures')
.find('.list-group .list-group-item')
.should('have.length', fissures.length + 2);
});
});
it('should filter Steel Path', () => {
cy.get('div.fissures .list-group .list-group-item').as('fissures');
cy.get('div.fissures .list-group-item.list-group-item-borderbottom').as('fissureSelection');
cy.get('@fissureSelection').find('.btn.btn-outline-primary.btn-sm').as('selectionButtons');
cy.get('@selectionButtons').eq(2).click();

cy.get('div.fissures>.list-group>.list-group-item.list-group-item-borderless.pb-0').then(($el) => {
// eslint-disable-next-line no-undef
const steelFissures = Cypress.dom.wrap($el);
cy.get('@fissures')
.should('have.length', steelFissures.length + 2)
.and('have.length.lessThan', fissures.length);
});
});
it('should filter Void Storms', () => {
cy.get('div.fissures .list-group .list-group-item').as('fissures');
cy.get('div.fissures .list-group-item.list-group-item-borderbottom').as('fissureSelection');
cy.get('@fissureSelection').find('.btn.btn-outline-primary.btn-sm').as('selectionButtons');
cy.get('@selectionButtons').eq(2).click();

cy.get('div.fissures>.list-group>.list-group-item.list-group-item-borderless.pb-0').then(($el) => {
// eslint-disable-next-line no-undef
const stormFissures = Cypress.dom.wrap($el);
cy.get('@fissures')
.should('have.length', stormFissures.length + 2)
.and('have.length.lessThan', fissures.length);
});
});
it('should show icons for specialty types', () => {
cy.get('div.fissures .list-group .list-group-item.pb-0').as('fissures');
cy.get('div.fissures .list-group-item.list-group-item-borderbottom').as('fissureSelection');
cy.get('@fissureSelection').find('.btn.btn-outline-primary.btn-sm').as('selectionButtons');

// select Void Fissures
cy.get('@selectionButtons').eq(1).click();
cy.get('@fissures').each(($fissureRow) => {
cy.wrap($fissureRow)
.find('.li-mission-decorator.li-mission-decorator-lg')
.each(($img, idx) => {
if (idx === 1) cy.wrap($img).should('have.attr', 'title', 'Void Storm');
});
});

// select Steel Path
cy.get('@selectionButtons').eq(2).click();
cy.get('@fissures').each(($fissureRow) => {
cy.wrap($fissureRow)
.find('.li-mission-decorator.li-mission-decorator-lg')
.each(($img, idx) => {
if (idx === 1) cy.wrap($img).should('have.attr', 'title', 'Steel Path');
});
});
});
});
describe('Nightwave', () => {
Expand Down
3 changes: 2 additions & 1 deletion static/lang/en.json
Expand Up @@ -93,7 +93,8 @@
"header": "Fissures",
"voidstorm": "Void Storm",
"choice": "Choose which fissures to show",
"both": "Both"
"all": "All",
"steelPath": "Steel Path"
},
"invasions": {
"header": "Invasions",
Expand Down
4 changes: 4 additions & 0 deletions static/less/common.less
Expand Up @@ -241,6 +241,10 @@ div.modal-body {
width: 32px;
}

.no-invert {
filter: none !important;
}

/* Leaflet overrides */
#app .leaflet-container {
background: transparent;
Expand Down

1 comment on commit 60e7630

@vercel
Copy link

@vercel vercel bot commented on 60e7630 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

warframe-hub – ./

warframe-hub-wfcd.vercel.app
warframe-hub-git-dev-wfcd.vercel.app
hub.warframestat.us

Please sign in to comment.