mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
Merge pull request #6244 from crookedneighbor/modularize-content
Modularize content
This commit is contained in:
commit
2b8cf178b0
7 changed files with 264 additions and 496 deletions
58
common/script/content/constants.js
Normal file
58
common/script/content/constants.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/* eslint-disable key-spacing */
|
||||
|
||||
export const CLASSES = [
|
||||
'warrior',
|
||||
'rogue',
|
||||
'healer',
|
||||
'wizard',
|
||||
];
|
||||
|
||||
// IMPORTANT: The end date should be one to two days AFTER the actual end of
|
||||
// the event, to allow people in different timezones to still buy the
|
||||
// event gear up until at least the actual end of the event.
|
||||
|
||||
export const EVENTS = {
|
||||
winter: { start: '2013-12-31', end: '2014-02-01' },
|
||||
birthday: { start: '2013-01-30', end: '2014-02-01' },
|
||||
spring: { start: '2014-03-21', end: '2014-05-01' },
|
||||
summer: { start: '2014-06-20', end: '2014-08-01' },
|
||||
gaymerx: { start: '2014-07-02', end: '2014-08-01' },
|
||||
fall: { start: '2014-09-21', end: '2014-11-01' },
|
||||
winter2015: { start: '2014-12-21', end: '2015-02-02' },
|
||||
spring2015: { start: '2015-03-20', end: '2015-05-02' },
|
||||
summer2015: { start: '2015-06-20', end: '2015-08-02' },
|
||||
fall2015: { start: '2015-09-21', end: '2015-11-01' },
|
||||
};
|
||||
|
||||
export const GEAR_TYPES = [
|
||||
'weapon',
|
||||
'armor',
|
||||
'head',
|
||||
'shield',
|
||||
'body',
|
||||
'back',
|
||||
'headAccessory',
|
||||
'eyewear',
|
||||
];
|
||||
|
||||
export const ITEM_LIST = {
|
||||
weapon: { localeKey: 'weapon', isEquipment: true },
|
||||
armor: { localeKey: 'armor', isEquipment: true },
|
||||
head: { localeKey: 'headgear', isEquipment: true },
|
||||
shield: { localeKey: 'offhand', isEquipment: true },
|
||||
back: { localeKey: 'back', isEquipment: true },
|
||||
body: { localeKey: 'body', isEquipment: true },
|
||||
headAccessory: { localeKey: 'headAccessory', isEquipment: true },
|
||||
eyewear: { localeKey: 'eyewear', isEquipment: true },
|
||||
hatchingPotions: { localeKey: 'hatchingPotion', isEquipment: false },
|
||||
eggs: { localeKey: 'eggSingular', isEquipment: false },
|
||||
quests: { localeKey: 'quest', isEquipment: false },
|
||||
food: { localeKey: 'foodText', isEquipment: false },
|
||||
Saddle: { localeKey: 'foodSaddleText', isEquipment: false },
|
||||
};
|
||||
|
||||
export const USER_CAN_OWN_QUEST_CATEGORIES = [
|
||||
'unlockable',
|
||||
'gold',
|
||||
'pet',
|
||||
];
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,133 +1,129 @@
|
|||
import {each, where} from 'lodash';
|
||||
import {flat as flattenedGear} from './gear/index';
|
||||
import { each } from 'lodash';
|
||||
|
||||
let mysterySets = {
|
||||
201402: {
|
||||
start: '2014-02-22',
|
||||
end: '2014-02-28',
|
||||
text: 'Winged Messenger Set'
|
||||
text: 'Winged Messenger Set',
|
||||
},
|
||||
201403: {
|
||||
start: '2014-03-24',
|
||||
end: '2014-04-02',
|
||||
text: 'Forest Walker Set'
|
||||
text: 'Forest Walker Set',
|
||||
},
|
||||
201404: {
|
||||
start: '2014-04-24',
|
||||
end: '2014-05-02',
|
||||
text: 'Twilight Butterfly Set'
|
||||
text: 'Twilight Butterfly Set',
|
||||
},
|
||||
201405: {
|
||||
start: '2014-05-21',
|
||||
end: '2014-06-02',
|
||||
text: 'Flame Wielder Set'
|
||||
text: 'Flame Wielder Set',
|
||||
},
|
||||
201406: {
|
||||
start: '2014-06-23',
|
||||
end: '2014-07-02',
|
||||
text: 'Octomage Set'
|
||||
text: 'Octomage Set',
|
||||
},
|
||||
201407: {
|
||||
start: '2014-07-23',
|
||||
end: '2014-08-02',
|
||||
text: 'Undersea Explorer Set'
|
||||
text: 'Undersea Explorer Set',
|
||||
},
|
||||
201408: {
|
||||
start: '2014-08-23',
|
||||
end: '2014-09-02',
|
||||
text: 'Sun Sorcerer Set'
|
||||
text: 'Sun Sorcerer Set',
|
||||
},
|
||||
201409: {
|
||||
start: '2014-09-24',
|
||||
end: '2014-10-02',
|
||||
text: 'Autumn Strider Set'
|
||||
text: 'Autumn Strider Set',
|
||||
},
|
||||
201410: {
|
||||
start: '2014-10-24',
|
||||
end: '2014-11-02',
|
||||
text: 'Winged Goblin Set'
|
||||
text: 'Winged Goblin Set',
|
||||
},
|
||||
201411: {
|
||||
start: '2014-11-24',
|
||||
end: '2014-12-02',
|
||||
text: 'Feast and Fun Set'
|
||||
text: 'Feast and Fun Set',
|
||||
},
|
||||
201412: {
|
||||
start: '2014-12-25',
|
||||
end: '2015-01-02',
|
||||
text: 'Penguin Set'
|
||||
text: 'Penguin Set',
|
||||
},
|
||||
201501: {
|
||||
start: '2015-01-26',
|
||||
end: '2015-02-02',
|
||||
text: 'Starry Knight Set'
|
||||
text: 'Starry Knight Set',
|
||||
},
|
||||
201502: {
|
||||
start: '2015-02-24',
|
||||
end: '2015-03-02',
|
||||
text: 'Winged Enchanter Set'
|
||||
text: 'Winged Enchanter Set',
|
||||
},
|
||||
201503: {
|
||||
start: '2015-03-25',
|
||||
end: '2015-04-02',
|
||||
text: 'Aquamarine Set'
|
||||
text: 'Aquamarine Set',
|
||||
},
|
||||
201504: {
|
||||
start: '2015-04-24',
|
||||
end: '2015-05-02',
|
||||
text: 'Busy Bee Set'
|
||||
text: 'Busy Bee Set',
|
||||
},
|
||||
201505: {
|
||||
start: '2015-05-25',
|
||||
end: '2015-06-02',
|
||||
text: 'Green Knight Set'
|
||||
text: 'Green Knight Set',
|
||||
},
|
||||
201506: {
|
||||
start: '2015-06-25',
|
||||
end: '2015-07-02',
|
||||
text: 'Neon Snorkeler Set'
|
||||
text: 'Neon Snorkeler Set',
|
||||
},
|
||||
201507: {
|
||||
start: '2015-07-24',
|
||||
end: '2015-08-02',
|
||||
text: 'Rad Surfer Set'
|
||||
text: 'Rad Surfer Set',
|
||||
},
|
||||
201508: {
|
||||
start: '2015-08-23',
|
||||
end: '2015-09-02',
|
||||
text: 'Cheetah Costume Set'
|
||||
text: 'Cheetah Costume Set',
|
||||
},
|
||||
201509: {
|
||||
start:'2015-09-24',
|
||||
end:'2015-10-02',
|
||||
text:'Werewolf Set'
|
||||
start: '2015-09-24',
|
||||
end: '2015-10-02',
|
||||
text: 'Werewolf Set',
|
||||
},
|
||||
201510: {
|
||||
start:'2015-10-26',
|
||||
end:'2015-11-02',
|
||||
text:'Horned Goblin Set'
|
||||
start: '2015-10-26',
|
||||
end: '2015-11-02',
|
||||
text: 'Horned Goblin Set',
|
||||
},
|
||||
301404: {
|
||||
start: '3014-03-24',
|
||||
end: '3014-04-02',
|
||||
text: 'Steampunk Standard Set'
|
||||
text: 'Steampunk Standard Set',
|
||||
},
|
||||
301405: {
|
||||
start: '3014-04-24',
|
||||
end: '3014-05-02',
|
||||
text: 'Steampunk Accessories Set'
|
||||
text: 'Steampunk Accessories Set',
|
||||
},
|
||||
wondercon: { // @TODO: extract this out of mystery items
|
||||
wondercon: {
|
||||
start: '2014-03-24',
|
||||
end: '2014-04-01'
|
||||
}
|
||||
end: '2014-04-01',
|
||||
},
|
||||
};
|
||||
|
||||
each(mysterySets, (objectSet, name) => {
|
||||
objectSet.key = name;
|
||||
objectSet.items = where(flattenedGear, {
|
||||
mystery: name
|
||||
});
|
||||
each(mysterySets, (value, key) => {
|
||||
value.key = key;
|
||||
});
|
||||
|
||||
export default mysterySets;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
let classes = ['warrior', 'rogue', 'healer', 'wizard'];
|
||||
|
||||
export default classes;
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
// IMPORTANT: The end date should be one to two days AFTER the actual end of
|
||||
// the event, to allow people in different timezones to still buy the
|
||||
// event gear up until at least the actual end of the event.
|
||||
|
||||
let events = {
|
||||
winter: {start:'2013-12-31',end:'2014-02-01'},
|
||||
birthday: {start:'2013-01-30',end:'2014-02-01'},
|
||||
spring: {start:'2014-03-21',end:'2014-05-01'},
|
||||
summer: {start:'2014-06-20',end:'2014-08-01'},
|
||||
gaymerx: {start:'2014-07-02',end:'2014-08-01'},
|
||||
fall: {start:'2014-09-21',end:'2014-11-01'},
|
||||
winter2015: {start:'2014-12-21',end:'2015-02-02'},
|
||||
spring2015: {start:'2015-03-20',end:'2015-05-02'},
|
||||
summer2015: {start:'2015-06-20',end:'2015-08-02'},
|
||||
fall2015: {start:'2015-09-21',end:'2015-11-01'},
|
||||
}
|
||||
|
||||
export default events;
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
let itemList = {
|
||||
'weapon': {
|
||||
localeKey: 'weapon',
|
||||
isEquipment: true
|
||||
},
|
||||
'armor': {
|
||||
localeKey: 'armor',
|
||||
isEquipment: true
|
||||
},
|
||||
'head': {
|
||||
localeKey: 'headgear',
|
||||
isEquipment: true
|
||||
},
|
||||
'shield': {
|
||||
localeKey: 'offhand',
|
||||
isEquipment: true
|
||||
},
|
||||
'back': {
|
||||
localeKey: 'back',
|
||||
isEquipment: true
|
||||
},
|
||||
'body': {
|
||||
localeKey: 'body',
|
||||
isEquipment: true
|
||||
},
|
||||
'headAccessory': {
|
||||
localeKey: 'headAccessory',
|
||||
isEquipment: true
|
||||
},
|
||||
'eyewear': {
|
||||
localeKey: 'eyewear',
|
||||
isEquipment: true
|
||||
},
|
||||
'hatchingPotions': {
|
||||
localeKey: 'hatchingPotion',
|
||||
isEquipment: false
|
||||
},
|
||||
'eggs': {
|
||||
localeKey: 'eggSingular',
|
||||
isEquipment: false
|
||||
},
|
||||
'quests': {
|
||||
localeKey: 'quest',
|
||||
isEquipment: false
|
||||
},
|
||||
'food': {
|
||||
localeKey: 'foodText',
|
||||
isEquipment: false
|
||||
},
|
||||
'Saddle': {
|
||||
localeKey: 'foodSaddleText',
|
||||
isEquipment: false
|
||||
}
|
||||
};
|
||||
|
||||
export default itemList;
|
||||
|
|
@ -1,22 +1,28 @@
|
|||
import { each } from 'lodash';
|
||||
import {
|
||||
expectValidTranslationString,
|
||||
describeEachItem
|
||||
} from '../helpers/content.helper';
|
||||
|
||||
import {questions, stillNeedHelp} from '../../common/script/src/content/faq';
|
||||
import {questions, stillNeedHelp} from '../../common/script/content/faq';
|
||||
|
||||
describe('FAQ Locales', () => {
|
||||
describeEachItem('Questions', questions, (question, index) => {
|
||||
it('has a valid question', () => {
|
||||
expectValidTranslationString(question.question);
|
||||
describe('Questions', () => {
|
||||
it('has a valid questions', () => {
|
||||
each(questions, (question, key) => {
|
||||
expectValidTranslationString(question.question);
|
||||
});
|
||||
});
|
||||
|
||||
it('has a valid ios answer', () => {
|
||||
expectValidTranslationString(question.ios);
|
||||
it('has a valid ios answers', () => {
|
||||
each(questions, (question, key) => {
|
||||
expectValidTranslationString(question.ios);
|
||||
});
|
||||
});
|
||||
|
||||
it('has a valid web answer', () => {
|
||||
expectValidTranslationString(question.web);
|
||||
it('has a valid web answers', () => {
|
||||
each(questions, (question, key) => {
|
||||
expectValidTranslationString(question.web);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue