Hiding popunder if challenge data is incomplete (#10284)

* removing file that only contained a reference to a missing folder

* fixing typo

* using full dates to avoid moment warning in tests

* more typos

* sending an empty string to vue bootstrap tooltip (disabling it) if no challenge short name is set
This commit is contained in:
Brian Fenton
2018-04-28 10:38:38 -05:00
committed by Matteo Pagliazzi
parent 403ac1ab7e
commit c6c9503e22
7 changed files with 13 additions and 11 deletions

View File

@@ -1,3 +0,0 @@
This folder contains the test files for the new client side that is being developed.
The old client side tests can be found in /test/client-old.

View File

@@ -966,7 +966,7 @@ describe('shouldDo', () => {
m: false,
};
let today = moment('2017-01-27');
let today = moment('2017-01-27:00:00.000-00:00');
let week = today.monthWeek();
let dayOfWeek = today.day();
dailyTask.startDate = today.toDate();
@@ -974,7 +974,7 @@ describe('shouldDo', () => {
dailyTask.repeat[DAY_MAPPING[dayOfWeek]] = true;
dailyTask.everyX = 1;
dailyTask.frequency = 'monthly';
day = moment('2017-02-24');
day = moment('2017-02-24:00:00.000-00:00');
expect(shouldDo(day, dailyTask, options)).to.equal(true);
});

View File

@@ -12,7 +12,7 @@ if (process.env.LOAD_SERVER === '0') { // when the server is in a different proc
nconf.set('NODE_DB_URI', nconf.get('TEST_DB_URI'));
nconf.set('NODE_ENV', 'test');
nconf.set('IS_TEST', true);
// We require src/server and npt src/index because
// We require src/server and not src/index because
// 1. nconf is already setup
// 2. we don't need clustering
require('../../website/server/server'); // eslint-disable-line global-require

View File

@@ -590,7 +590,7 @@ export default {
},
filterByTagList (taskList, tagList = []) {
let filteredTaskList = taskList;
// fitler requested tasks by tags
// filter requested tasks by tags
if (!isEmpty(tagList)) {
filteredTaskList = taskList.filter(
task => tagList.every(tag => task.tags.indexOf(tag) !== -1)

View File

@@ -81,7 +81,7 @@
span.m-0(v-if="task.up && task.down")  | 
span.m-0(v-if="task.down") -{{task.counterDown}}
.d-flex.align-items-center(v-if="task.challenge && task.challenge.id")
.svg-icon.challenge(v-html="icons.challenge", v-if='!task.challenge.broken', v-b-tooltip.hover.bottom="`${task.challenge.shortName}`")
.svg-icon.challenge(v-html="icons.challenge", v-if='!task.challenge.broken', v-b-tooltip.hover.bottom="shortName")
.svg-icon.challenge.broken(v-html="icons.brokenChallengeIcon", v-if='task.challenge.broken', @click='handleBrokenTask(task)', v-b-tooltip.hover.bottom="$t('brokenChaLink')")
.d-flex.align-items-center(v-if="hasTags", :id="`tags-icon-${task._id}`")
.svg-icon.tags(v-html="icons.tags")
@@ -627,6 +627,11 @@ export default {
hasTags () {
return this.task.tags && this.task.tags.length > 0;
},
shortName () {
if (this.task.challenge.broken) return '';
return this.task.challenge.shortName ? this.task.challenge.shortName.toString() : '';
},
},
methods: {
...mapActions({

View File

@@ -68,7 +68,7 @@ let api = {};
/**
* @apiDefine ChallengeSuccessExample
* @apiSuccessExample {json} Sucessfull response with single challenge
* @apiSuccessExample {json} Successful response with single challenge
{
"data": {
"group": {
@@ -112,7 +112,7 @@ let api = {};
/**
* @apiDefine ChallengeArrayExample
* @apiSuccessExample {json} Sucessful response with array of challenges
* @apiSuccessExample {json} Successful response with array of challenges
{
"data": [{
"group": {

View File

@@ -125,7 +125,7 @@ export async function createTasks (req, res, options = {}) {
await owner.update(taskOrderUpdateQuery).exec();
// tasks with aliases need to be validated asyncronously
// tasks with aliases need to be validated asynchronously
await _validateTaskAlias(toSave, res);
toSave = toSave.map(task => task.save({ // If all tasks are valid (this is why it's not in the previous .map()), save everything, withough running validation again