diff --git a/parser_setup/.eslintrc.json b/parser_setup/.eslintrc.json deleted file mode 100644 index f9b22b7..0000000 --- a/parser_setup/.eslintrc.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "rules": { - "@typescript-eslint/naming-convention": "warn", - "@typescript-eslint/semi": "warn", - "curly": "warn", - "eqeqeq": "warn", - "no-throw-literal": "warn", - "semi": "off" - }, - "ignorePatterns": [ - "out", - "dist", - "**/*.d.ts" - ] -} diff --git a/parser_setup/__tests__/itsquiz-wall/client/app.js b/parser_setup/__tests__/itsquiz-wall/client/app.js deleted file mode 100644 index a181c7f..0000000 --- a/parser_setup/__tests__/itsquiz-wall/client/app.js +++ /dev/null @@ -1,50 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import { Provider } from 'react-redux'; -import { Router } from 'react-router'; -import fetch from 'isomorphic-fetch'; -import cookie from 'cookie'; - -import configureStore from '../shared/store/configureStore'; -import routes from '../shared/routes.jsx'; -import history from '../shared/history.js'; -import i18n from '../shared/i18n'; - -const DEFAULT_LOCALE = 'en'; - -const initialState = window.__INITIAL_STATE__ || {}; -const store = configureStore(initialState); -const locale = cookie.parse(document.cookie).locale || DEFAULT_LOCALE; - -function loadLocale(localeToLoad) { - if (localeToLoad === 'en') { - // No need to load as UI already in English - return Promise.resolve({}); - } - - - // "": { "domain": "messages", "lang": "" } - return fetch(`/static/lang/${localeToLoad}.json`).then(res => { - if (res.status >= 400) { - throw new Error('Bad response from server'); - } - - return res.json(); - }); -} - -loadLocale(locale).then(localeData => { - const i18nTools = new i18n.Tools({ localeData, locale }); - - ReactDOM.render( - - - - - , - - document.getElementById('react-view') - ); -}).catch(error => { - console.error(error); -}); diff --git a/parser_setup/__tests__/itsquiz-wall/shared/actions/accounts.js b/parser_setup/__tests__/itsquiz-wall/shared/actions/accounts.js deleted file mode 100644 index 6c5f244..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/actions/accounts.js +++ /dev/null @@ -1,50 +0,0 @@ -import api from '../apiSingleton'; -import apiResponseFormatter from '../utils/apiResponseFormatter'; - -export const LOAD_ACCOUNTS_SUCCESS = 'LOAD_ACCOUNTS_SUCCESS'; - -export function loadAccounts() { - return (dispatch) => { - return api.accounts.list().then((response) => { - // TODO Move formatting to a reducer - const accounts = response.data.entities.map(apiResponseFormatter.formatAuthorProfileData); - - dispatch({ - type: LOAD_ACCOUNTS_SUCCESS, - accounts - }); - }); - }; -} - -export const LOAD_ACCOUNT_SUCCESS = 'LOAD_ACCOUNT_SUCCESS'; -export const LOAD_ACCOUNT_FAIL = 'LOAD_ACCOUNT_FAIL'; -export const LOAD_ACCOUNT_REQUEST = 'LOAD_ACCOUNT_REQUEST'; -export const SET_SESSION_TYPE = 'SET_SESSION_TYPE'; - -export function loadAccount({ id }) { - return (dispatch) => { - return api.accounts.show(id).then((response) => { - const account = apiResponseFormatter.formatAuthorProfileData(response.data); - - dispatch({ - type: LOAD_ACCOUNT_SUCCESS, - account - }); - }).catch(error => { - dispatch({ - type: LOAD_ACCOUNT_FAIL, - error - }); - }); - }; -} - -export function loadAccountType({ query }) { - return (dispatch) => { - dispatch({ - type: SET_SESSION_TYPE, - isOrganization: query.isOrganization === 'true' - }); - }; -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/actions/activations.js b/parser_setup/__tests__/itsquiz-wall/shared/actions/activations.js deleted file mode 100644 index 1fc15ef..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/actions/activations.js +++ /dev/null @@ -1,151 +0,0 @@ -import api from '../apiSingleton'; - -import { loadAssessmentSystem } from './assessmentSystems'; - -export const LOAD_ACTIVATIONS_SUCCESS = 'LOAD_ACTIVATIONS_SUCCESS'; -export const LOAD_ACTIVATIONS_FAIL = 'LOAD_ACTIVATIONS_FAIL'; -export const LOAD_ACTIVATIONS_REQUEST = 'LOAD_ACTIVATIONS_REQUEST'; - -const LIMIT_PER_QUERY = 24; - -export function loadActivations({ query = {}, offset = 0 }) { - return (dispatch) => { - dispatch({ - type : LOAD_ACTIVATIONS_REQUEST, - category : query.category || 'ALL', - sortType : query.sortType || 'new', - search : query.search || '' - }); - - return api.activations.list({ - offset, - include : 'accounts', - limit : LIMIT_PER_QUERY, - search : query.search || '', - category : query.category !== 'SPECIAL' ? query.category : '', - isSponsored : query.category === 'SPECIAL' ? true : '', - sortBy : query.sortType || '', - assigneeId : query.assigneeId || '' - - }).then(({ data, linked }) => { - dispatch({ - offset, - category : query.category || 'ALL', - sortType : query.sortType || 'new', - search : query.search || '', - type : LOAD_ACTIVATIONS_SUCCESS, - activations : data.entities, - totalAmount : data.total, - accounts : linked.accounts - }); - }); - }; -} - -export const LOAD_ACTIVATION_REQUEST = 'LOAD_ACTIVATION_REQUEST'; -export const LOAD_ACTIVATION_SUCCESS = 'LOAD_ACTIVATION_SUCCESS'; -export const LOAD_ACTIVATION_FAIL = 'LOAD_ACTIVATION_FAIL'; - -export function loadActivation({ params = {}, query = {}, locale }) { - const assigneeId = params.accountId || query.assigneeId || ''; - - return dispatch => { - dispatch({ type : LOAD_ACTIVATION_REQUEST, activationId : params.id }); - - return api.activations.show(params.id, { - assigneeId, - include: 'accounts', - digest: query.digest, - accountfromemail: query.accountId - }).then(response => { - const accountId = response.data.links.owner.id; - - const authorActivationsPromise = dispatch(loadAuthorActivations({ - accountId, - assigneeId, - openedActivationId: response.data.id, - limit: 8 - })); - - const activationPromise = dispatch({ - type : LOAD_ACTIVATION_SUCCESS, - activation : response.data, - author : response.linked.accounts.find(account => account.id === accountId) - }); - - let assessmentSystemPromise; - - if (assigneeId) { - assessmentSystemPromise = dispatch(loadAssessmentSystem(response.data, locale)); - } - - return Promise.all([assessmentSystemPromise, activationPromise, authorActivationsPromise]); - }).catch(error => { - dispatch({ - type: LOAD_ACTIVATION_FAIL, - error - }); - }); - }; -} - -export const LOAD_SIMILAR_ACTIVATIONS_REQUEST = 'LOAD_SIMILAR_ACTIVATIONS_REQUEST'; -export const LOAD_SIMILAR_ACTIVATIONS_SUCCESS = 'LOAD_SIMILAR_ACTIVATIONS_SUCCESS'; -export const LOAD_SIMILAR_ACTIVATIONS_FAIL = 'LOAD_SIMILAR_ACTIVATIONS_FAIL'; - -export function loadSimilarActivations({ params = {}, query = {} }) { - const assigneeId = query.assigneeId || params.accountId || ''; - const similarTo = params.id; - - return dispatch => { - dispatch({ type : LOAD_SIMILAR_ACTIVATIONS_REQUEST }); - - return api.activations.list({ - similarTo, assigneeId, limit: 8, include: 'accounts' - }).then(({ data, linked }) => { - dispatch({ - similarTo, - type : LOAD_SIMILAR_ACTIVATIONS_SUCCESS, - accounts : linked.accounts, - activations : data.entities - }); - }).catch(error => { - dispatch({ - type: LOAD_SIMILAR_ACTIVATIONS_FAIL, - error - }); - }); - }; -} - -export const LOAD_AUTHOR_ACTIVATIONS_SUCCESS = 'LOAD_AUTHOR_ACTIVATIONS_SUCCESS'; -export const LOAD_AUTHOR_ACTIVATIONS_FAIL = 'LOAD_AUTHOR_ACTIVATIONS_FAIL'; - -export function loadAuthorActivations(params) { - const { - accountId = '', - assigneeId = '', - openedActivationId = '', - limit = 0, - isAllActivationsLoaded = false - } = params; - - return (dispatch, getState) => { - const authorId = accountId || getState().currentActivation.activation.author.id; - const activationId = openedActivationId || getState().currentActivation.activation.id; - - return api.activations.list({ accountId: authorId, assigneeId, limit }).then((response) => { - dispatch({ - isAllActivationsLoaded, - type : LOAD_AUTHOR_ACTIVATIONS_SUCCESS, - openedActivationId : activationId, - authorActivations : response.data.entities - }); - }).catch(error => { - dispatch({ - type: LOAD_AUTHOR_ACTIVATIONS_FAIL, - error - }); - }); - }; -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/actions/assessmentSystems.js b/parser_setup/__tests__/itsquiz-wall/shared/actions/assessmentSystems.js deleted file mode 100644 index dabd49d..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/actions/assessmentSystems.js +++ /dev/null @@ -1,39 +0,0 @@ -import api from '../apiSingleton'; - -import standardAssessmentSystems from '../utils/LocaleUtil/assessmentSystems.json'; - -export const LOAD_ASSESSMENT_SYSTEM_SUCCESS = 'LOAD_ASSESSMENT_SYSTEM_SUCCESS'; -export const LOAD_ASSESSMENT_SYSTEM_FAIL = 'LOAD_ASSESSMENT_SYSTEM_FAIL'; - -export function loadAssessmentSystem(activation, locale) { - return (dispatch) => { - if (activation.assessmentSystemType === 'GLOBAL') { - const localizedStandardSystems = standardAssessmentSystems[locale.toUpperCase()]; - - for (const standardSystemName in localizedStandardSystems) { - if (localizedStandardSystems[standardSystemName].id === activation.assessmentSystemId) { - dispatch({ - type : LOAD_ASSESSMENT_SYSTEM_SUCCESS, - assessmentSystem : localizedStandardSystems[standardSystemName].assessmentSystem - }); - - return Promise.resolve(); - } - } - } else { - return api.assessmentSystems.show( - activation.assessmentSystemId - ).then((response) => { - dispatch({ - type : LOAD_ASSESSMENT_SYSTEM_SUCCESS, - assessmentSystem : response.assessmentSystem - }); - }).catch(error => { - dispatch({ - type: LOAD_ASSESSMENT_SYSTEM_FAIL, - error - }); - }); - } - }; -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/api/Accounts.js b/parser_setup/__tests__/itsquiz-wall/shared/api/Accounts.js deleted file mode 100644 index 9fdcda5..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/api/Accounts.js +++ /dev/null @@ -1,11 +0,0 @@ -import Base from './Base'; - -export default class AccountsAPI extends Base { - list(params) { - return this.apiClient.get('quizwall/accounts', {}, params); - } - - show(id, params) { - return this.apiClient.get(`quizwall/accounts/${id}`, {}, params); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/api/Activations.js b/parser_setup/__tests__/itsquiz-wall/shared/api/Activations.js deleted file mode 100644 index d1bb961..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/api/Activations.js +++ /dev/null @@ -1,11 +0,0 @@ -import Base from './Base'; - -export default class ActivationsAPI extends Base { - list(params) { - return this.apiClient.get('quizwall/activations', {}, params); - } - - show(id, params) { - return this.apiClient.get(`quizwall/activations/${id}`, {}, params); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/api/ApiClient.js b/parser_setup/__tests__/itsquiz-wall/shared/api/ApiClient.js deleted file mode 100644 index 073cf20..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/api/ApiClient.js +++ /dev/null @@ -1,94 +0,0 @@ -import fetch from 'isomorphic-fetch'; -import queryString from 'query-string'; -import Promise from 'bluebird'; - -export default class ApiClient { - constructor({ prefix = 'api/v1' } = {}) { - this.prefix = prefix; - } - - get(requestUrl, payload = {}, params = {}) { - return this.request({ - url: requestUrl, - method: 'get', - body: payload, - params - }); - } - - put(requestUrl, payload = {}) { - return this.request({ - url: requestUrl, - method: 'put', - body: payload - }); - } - - patch(requestUrl, payload = {}) { - return this.request({ - url: requestUrl, - method: 'put', - body: payload - }); - } - - post(requestUrl, payload = {}) { - return this.request({ - url: requestUrl, - method: 'post', - body: payload - }); - } - - delete(requestUrl) { - return this.request({ - url: requestUrl, - method: 'delete' - }); - } - - request({ url, method, params = {}, body }) { - if (this.authToken) { - /* eslint-disable */ - params.token = this.authToken; - /* eslint-enable */ - } - - const urlWithQuery = `${url}?${queryString.stringify(params)}`; - - const init = { - method, - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', - 'x-real-ip': this.XRealIP - } - }; - - if (method !== 'get' && method !== 'head') { - init.body = JSON.stringify(body); - } - - return fetch(`${this.prefix}/${urlWithQuery}`, init).then(res => { - if (res.status >= 400) { - throw new Error('Bad response from server'); - } - - return res.json(); - }).then(data => { - if (data && data.status === 1) { - return data; - } - - return Promise.reject(data.error); - }); - } - - setAuthToken(authToken) { - this.authToken = authToken; - } - - setXRealIP(XRealIP) { - this.XRealIP = XRealIP; - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/api/AssessmentSystems.js b/parser_setup/__tests__/itsquiz-wall/shared/api/AssessmentSystems.js deleted file mode 100644 index fed0fc2..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/api/AssessmentSystems.js +++ /dev/null @@ -1,7 +0,0 @@ -import Base from './Base'; - -export default class AssessmentSystemsAPI extends Base { - show(id, params) { - return this.apiClient.get(`quizwall/assessmentsystems/${id}`, {}, params); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/api/Base.js b/parser_setup/__tests__/itsquiz-wall/shared/api/Base.js deleted file mode 100644 index dd45229..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/api/Base.js +++ /dev/null @@ -1,6 +0,0 @@ -export default class Base { - constructor({ apiClient }) { - if (!apiClient) throw new Error('[apiClient] required'); - this.apiClient = apiClient; - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/api/index.js b/parser_setup/__tests__/itsquiz-wall/shared/api/index.js deleted file mode 100644 index b252915..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/api/index.js +++ /dev/null @@ -1,19 +0,0 @@ -import ApiClient from './ApiClient'; -import ActivationsAPI from './Activations'; -import AccountsAPI from './Accounts'; -import AssessmentSystemsAPI from './AssessmentSystems'; - -export default function ({ apiPrefix } = {}) { - if (!apiPrefix) { - throw new Error('[apiPrefix] required'); - } - - const api = new ApiClient({ prefix: apiPrefix }); - - return { - apiClient : api, - activations : new ActivationsAPI({ apiClient: api }), - accounts : new AccountsAPI({ apiClient: api }), - assessmentSystems : new AssessmentSystemsAPI({ apiClient: api }) - }; -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/apiSingleton.js b/parser_setup/__tests__/itsquiz-wall/shared/apiSingleton.js deleted file mode 100644 index 9336bdc..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/apiSingleton.js +++ /dev/null @@ -1,6 +0,0 @@ -import config from './config'; -import apiFactory from './api'; - -export default apiFactory({ - apiPrefix: config.apiPrefix -}); diff --git a/parser_setup/__tests__/itsquiz-wall/shared/assets/colors.less b/parser_setup/__tests__/itsquiz-wall/shared/assets/colors.less deleted file mode 100644 index af3e6bb..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/assets/colors.less +++ /dev/null @@ -1,303 +0,0 @@ -// Red -@red-50: #FFEBEE; -@red-100: #FFCDD2; -@red-200: #EF9A9A; -@red-300: #E57373; -@red-400: #EF5350; -@red-500: #F44336; -@red-600: #E53935; -@red-700: #D32F2F; -@red-800: #C62828; -@red-900: #B71C1C; -@red-A100: #FF8A80; -@red-A200: #FF5252; -@red-A400: #FF1744; -@red-A700: #D50000; - -// Pink -@pink-50: #FCE4EC; -@pink-100: #F8BBD0; -@pink-200: #F48FB1; -@pink-300: #F06292; -@pink-400: #EC407A; -@pink-500: #E91E63; -@pink-600: #D81B60; -@pink-700: #C2185B; -@pink-800: #AD1457; -@pink-900: #880E4F; -@pink-A100: #FF80AB; -@pink-A200: #FF4081; -@pink-A400: #F50057; -@pink-A700: #C51162; - -// Purple -@purple-50: #F3E5F5; -@purple-100: #E1BEE7; -@purple-200: #CE93D8; -@purple-300: #BA68C8; -@purple-400: #AB47BC; -@purple-500: #9C27B0; -@purple-600: #8E24AA; -@purple-700: #7B1FA2; -@purple-800: #6A1B9A; -@purple-900: #4A148C; -@purple-A100: #EA80FC; -@purple-A200: #E040FB; -@purple-A400: #D500F9; -@purple-A700: #AA00FF; - -// Deep Purple -@deep-purple-50: #EDE7F6; -@deep-purple-100: #D1C4E9; -@deep-purple-200: #B39DDB; -@deep-purple-300: #9575CD; -@deep-purple-400: #7E57C2; -@deep-purple-500: #673AB7; -@deep-purple-600: #5E35B1; -@deep-purple-700: #512DA8; -@deep-purple-800: #4527A0; -@deep-purple-900: #311B92; -@deep-purple-A100: #B388FF; -@deep-purple-A200: #7C4DFF; -@deep-purple-A400: #651FFF; -@deep-purple-A700: #6200EA; - -// Indigo -@indigo-50: #E8EAF6; -@indigo-100: #C5CAE9; -@indigo-200: #9FA8DA; -@indigo-300: #7986CB; -@indigo-400: #5C6BC0; -@indigo-500: #3F51B5; -@indigo-600: #3949AB; -@indigo-700: #303F9F; -@indigo-800: #283593; -@indigo-900: #1A237E; -@indigo-A100: #8C9EFF; -@indigo-A200: #536DFE; -@indigo-A400: #3D5AFE; -@indigo-A700: #304FFE; - -// Blue -@blue-50: #E3F2FD; -@blue-100: #BBDEFB; -@blue-200: #90CAF9; -@blue-300: #64B5F6; -@blue-400: #42A5F5; -@blue-500: #2196F3; -@blue-600: #1E88E5; -@blue-700: #1976D2; -@blue-800: #1565C0; -@blue-900: #0D47A1; -@blue-A100: #82B1FF; -@blue-A200: #448AFF; -@blue-A400: #2979FF; -@blue-A700: #2962FF; - -// Light Blue -@light-blue-50: #E1F5FE; -@light-blue-100: #B3E5FC; -@light-blue-200: #81D4FA; -@light-blue-300: #4FC3F7; -@light-blue-400: #29B6F6; -@light-blue-500: #03A9F4; -@light-blue-600: #039BE5; -@light-blue-700: #0288D1; -@light-blue-800: #0277BD; -@light-blue-900: #01579B; -@light-blue-A100: #80D8FF; -@light-blue-A200: #40C4FF; -@light-blue-A400: #00B0FF; -@light-blue-A700: #0091EA; - -// Cyan -@cyan-50: #E0F7FA; -@cyan-100: #B2EBF2; -@cyan-200: #80DEEA; -@cyan-300: #4DD0E1; -@cyan-400: #26C6DA; -@cyan-500: #00BCD4; -@cyan-600: #00ACC1; -@cyan-700: #0097A7; -@cyan-800: #00838F; -@cyan-900: #006064; -@cyan-A100: #84FFFF; -@cyan-A200: #18FFFF; -@cyan-A400: #00E5FF; -@cyan-A700: #00B8D4; - -// Teal -@teal-50: #E0F2F1; -@teal-100: #B2DFDB; -@teal-200: #80CBC4; -@teal-300: #4DB6AC; -@teal-400: #26A69A; -@teal-500: #009688; -@teal-600: #00897B; -@teal-700: #00796B; -@teal-800: #00695C; -@teal-900: #004D40; -@teal-A100: #A7FFEB; -@teal-A200: #64FFDA; -@teal-A400: #1DE9B6; -@teal-A700: #00BFA5; - -// Green -@green-50: #E8F5E9; -@green-100: #C8E6C9; -@green-200: #A5D6A7; -@green-300: #81C784; -@green-400: #66BB6A; -@green-500: #4CAF50; -@green-600: #43A047; -@green-700: #388E3C; -@green-800: #2E7D32; -@green-900: #1B5E20; -@green-A100: #B9F6CA; -@green-A200: #69F0AE; -@green-A400: #00E676; -@green-A700: #00C853; - -// Light Green -@light-green-50: #F1F8E9; -@light-green-100: #DCEDC8; -@light-green-200: #C5E1A5; -@light-green-300: #AED581; -@light-green-400: #9CCC65; -@light-green-500: #8BC34A; -@light-green-600: #7CB342; -@light-green-700: #689F38; -@light-green-800: #558B2F; -@light-green-900: #33691E; -@light-green-A100: #CCFF90; -@light-green-A200: #B2FF59; -@light-green-A400: #76FF03; -@light-green-A700: #64DD17; - -// Lime -@lime-50: #F9FBE7; -@lime-100: #F0F4C3; -@lime-200: #E6EE9C; -@lime-300: #DCE775; -@lime-400: #D4E157; -@lime-500: #CDDC39; -@lime-600: #C0CA33; -@lime-700: #AFB42B; -@lime-800: #9E9D24; -@lime-900: #827717; -@lime-A100: #F4FF81; -@lime-A200: #EEFF41; -@lime-A400: #C6FF00; -@lime-A700: #AEEA00; - -// Yellow -@yellow-50: #FFFDE7; -@yellow-100: #FFF9C4; -@yellow-200: #FFF59D; -@yellow-300: #FFF176; -@yellow-400: #FFEE58; -@yellow-500: #FFEB3B; -@yellow-600: #FDD835; -@yellow-700: #FBC02D; -@yellow-800: #F9A825; -@yellow-900: #F57F17; -@yellow-A100: #FFFF8D; -@yellow-A200: #FFFF00; -@yellow-A400: #FFEA00; -@yellow-A700: #FFD600; - -// Amber -@amber-50: #FFF8E1; -@amber-100: #FFECB3; -@amber-200: #FFE082; -@amber-300: #FFD54F; -@amber-400: #FFCA28; -@amber-500: #FFC107; -@amber-600: #FFB300; -@amber-700: #FFA000; -@amber-800: #FF8F00; -@amber-900: #FF6F00; -@amber-A100: #FFE57F; -@amber-A200: #FFD740; -@amber-A400: #FFC400; -@amber-A700: #FFAB00; - -// Orange -@orange-50: #FFF3E0; -@orange-100: #FFE0B2; -@orange-200: #FFCC80; -@orange-300: #FFB74D; -@orange-400: #FFA726; -@orange-500: #FF9800; -@orange-600: #FB8C00; -@orange-700: #F57C00; -@orange-800: #EF6C00; -@orange-900: #E65100; -@orange-A100: #FFD180; -@orange-A200: #FFAB40; -@orange-A400: #FF9100; -@orange-A700: #FF6D00; - -// Deep Orange -@deep-orange-50: #FBE9E7; -@deep-orange-100: #FFCCBC; -@deep-orange-200: #FFAB91; -@deep-orange-300: #FF8A65; -@deep-orange-400: #FF7043; -@deep-orange-500: #FF5722; -@deep-orange-600: #F4511E; -@deep-orange-700: #E64A19; -@deep-orange-800: #D84315; -@deep-orange-900: #BF360C; -@deep-orange-A100: #FF9E80; -@deep-orange-A200: #FF6E40; -@deep-orange-A400: #FF3D00; -@deep-orange-A700: #DD2C00; - -// Brown -@brown-50: #EFEBE9; -@brown-100: #D7CCC8; -@brown-200: #BCAAA4; -@brown-300: #A1887F; -@brown-400: #8D6E63; -@brown-500: #795548; -@brown-600: #6D4C41; -@brown-700: #5D4037; -@brown-800: #4E342E; -@brown-900: #3E2723; - -// Grey -@grey-50: #FAFAFA; -@grey-100: #F5F5F5; -@grey-200: #EEEEEE; -@grey-300: #E0E0E0; -@grey-400: #BDBDBD; -@grey-500: #9E9E9E; -@grey-600: #757575; -@grey-700: #616161; -@grey-800: #424242; -@grey-900: #212121; - -// Blue Grey -@blue-grey-50: #ECEFF1; -@blue-grey-100: #CFD8DC; -@blue-grey-200: #B0BEC5; -@blue-grey-300: #90A4AE; -@blue-grey-400: #78909C; -@blue-grey-500: #607D8B; -@blue-grey-600: #546E7A; -@blue-grey-700: #455A64; -@blue-grey-800: #37474F; -@blue-grey-900: #263238; - -// White -@white-lighter: rgba(255,255,255,.12); // Dividers -@white-light: rgba(255,255,255,.30); // Disabled / Hint Text -@white-dark: rgba(255,255,255,.70); // Secondary Text -@white-darker: rgba(255,255,255, 1); // Text / Icons - -// Black -@black-lighter: rgba(0,0,0,.12); // Dividers -@black-light: rgba(0,0,0,.26); // Disabled / Hint Text -@black-dark: rgba(0,0,0,.54); // Secondary text / Icons -@black-darker: rgba(0,0,0,.87); // Text \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/assets/index.js b/parser_setup/__tests__/itsquiz-wall/shared/assets/index.js deleted file mode 100644 index e982e93..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/assets/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import './normalize.css'; -import './typography.less'; diff --git a/parser_setup/__tests__/itsquiz-wall/shared/assets/media.less b/parser_setup/__tests__/itsquiz-wall/shared/assets/media.less deleted file mode 100644 index 14723f9..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/assets/media.less +++ /dev/null @@ -1,13 +0,0 @@ -@xs-min : 480px; -@sm-min : 768px; -@md-min : 992px; -@lg-min : 1200px; - -@xs-max : (@sm-min - 1); -@sm-max : (@md-min - 1); -@md-max : (@lg-min - 1); - -@phone : ~"only screen and (max-width: @{xs-max})"; -@tablet : ~"only screen and (min-width: @{sm-min}) and (max-width: @{sm-max})"; -@desktop : ~"only screen and (min-width: @{md-min}) and (max-width: @{md-max})"; -@large : ~"only screen and (min-width: @{lg-min})"; diff --git a/parser_setup/__tests__/itsquiz-wall/shared/assets/mixins.less b/parser_setup/__tests__/itsquiz-wall/shared/assets/mixins.less deleted file mode 100644 index 0b4ebea..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/assets/mixins.less +++ /dev/null @@ -1,6 +0,0 @@ -.text-ellipsis { - width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/assets/normalize.css b/parser_setup/__tests__/itsquiz-wall/shared/assets/normalize.css deleted file mode 100644 index 5e5e3c8..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/assets/normalize.css +++ /dev/null @@ -1,424 +0,0 @@ -/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ - -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS and IE text size adjust after device orientation change, - * without disabling user zoom. - */ - -html { - font-family: sans-serif; /* 1 */ - -ms-text-size-adjust: 100%; /* 2 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/** - * Remove default margin. - */ - -body { - margin: 0; -} - -/* HTML5 display definitions - ========================================================================== */ - -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 - * and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} - -/** - * 1. Correct `inline-block` display not defined in IE 8/9. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ - -audio, -canvas, -progress, -video { - display: inline-block; /* 1 */ - vertical-align: baseline; /* 2 */ -} - -/** - * Prevent modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22. - */ - -[hidden], -template { - display: none; -} - -/* Links - ========================================================================== */ - -/** - * Remove the gray background color from active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * Improve readability of focused elements when they are also in an - * active/hover state. - */ - -a:active, -a:hover { - outline: 0; -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -/** - * Address styling not present in Safari and Chrome. - */ - -dfn { - font-style: italic; -} - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/** - * Address styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - -/** - * Address inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove border when inside `a` element in IE 8/9/10. - */ - -img { - border: 0; -} - -/** - * Correct overflow not hidden in IE 9/10/11. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* Grouping content - ========================================================================== */ - -/** - * Address margin not present in IE 8/9 and Safari. - */ - -figure { - margin: 1em 40px; -} - -/** - * Address differences between Firefox and other browsers. - */ - -hr { - box-sizing: content-box; - height: 0; -} - -/** - * Contain overflow in all browsers. - */ - -pre { - overflow: auto; -} - -/** - * Address odd `em`-unit font size rendering in all browsers. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} - -/* Forms - ========================================================================== */ - -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ - -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - */ - -button, -input, -optgroup, -select, -textarea { - color: inherit; /* 1 */ - font: inherit; /* 2 */ - margin: 0; /* 3 */ -} - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ - -button { - overflow: visible; -} - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ - -button, -select { - text-transform: none; -} - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ -} - -/** - * Re-set default cursor for disabled elements. - */ - -button[disabled], -html input[disabled] { - cursor: default; -} - -/** - * Remove inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -input { - line-height: normal; -} - -/** - * It's recommended that you don't attempt to style these elements. - * Firefox's implementation doesn't respect box-sizing, padding, or width. - * - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Fix the cursor style for Chrome's increment/decrement buttons. For certain - * `font-size` values of the `input`, it causes the cursor style of the - * decrement button to change from `default` to `text`. - */ - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome. - */ - -input[type="search"] { - -webkit-appearance: textfield; /* 1 */ - box-sizing: content-box; /* 2 */ -} - -/** - * Remove inner padding and search cancel button in Safari and Chrome on OS X. - * Safari (but not Chrome) clips the cancel button when the search input has - * padding (and `textfield` appearance). - */ - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ - -textarea { - overflow: auto; -} - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ - -optgroup { - font-weight: bold; -} - -/* Tables - ========================================================================== */ - -/** - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} - -td, -th { - padding: 0; -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/assets/palette.less b/parser_setup/__tests__/itsquiz-wall/shared/assets/palette.less deleted file mode 100644 index 45cca61..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/assets/palette.less +++ /dev/null @@ -1,32 +0,0 @@ -@import 'colors.less'; - -//App colors -@primary-1-color : @cyan-500; -@primary-2-color : @cyan-700; -@primary-3-color : @cyan-100; -@accent-1-color : @pink-A200; -@accent-2-color : @pink-A400; -@accent-3-color : @pink-A100; - -@text-color : rgba(0,0,0,0.87); -@additional-text-color : rgba(0,0,0,0.67); -@secondary-text-color : rgba(0,0,0,0.54); -@hint-text-color : rgba(0,0,0,0.26); -@divider-color : rgba(0,0,0,0.12); -@background-color : #eaeaea; -@cards-color : #ffffff; - -@green-app : @green-500; -@pink-app : @pink-500; -@red-app : @red-500; -@purple-app : @purple-500; -@indigo-app : @indigo-500; -@blue-app : @blue-500; -@teal-app : @teal-500; -@cyan-app : @cyan-500; -@lime-app : @lime-500; -@amber-app : @amber-500; -@yellow-app : @yellow-500; -@orange-app : @orange-500; -@brown-app : @brown-500; -@grey-app : @grey-500; diff --git a/parser_setup/__tests__/itsquiz-wall/shared/assets/typography.less b/parser_setup/__tests__/itsquiz-wall/shared/assets/typography.less deleted file mode 100644 index 0d0fa1f..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/assets/typography.less +++ /dev/null @@ -1,120 +0,0 @@ -html, body { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-size: 14px; - font-weight: 400; - line-height: 20px; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - text-rendering: optimizeLegibility; -} - -h1, h2, h3, h4, h5, h6, p { - margin: 0; - padding: 0; } - -h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-size: 56px; - font-weight: 400; - line-height: 1.35; - letter-spacing: -0.02em; - opacity: 0.54; - font-size: 0.6em; } - -h1 { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-size: 56px; - font-weight: 400; - line-height: 1.35; - letter-spacing: -0.02em; - margin-top: 24px; - margin-bottom: 24px; } - -h2 { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-size: 45px; - font-weight: 400; - line-height: 48px; - margin-top: 24px; - margin-bottom: 24px; } - -h3 { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-size: 34px; - font-weight: 400; - line-height: 40px; - margin-top: 24px; - margin-bottom: 24px; } - -h4 { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-size: 24px; - font-weight: 400; - line-height: 32px; - -moz-osx-font-smoothing: grayscale; - margin-top: 24px; - margin-bottom: 16px; } - -h5 { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-size: 20px; - font-weight: 500; - line-height: 1; - letter-spacing: 0.02em; - margin-top: 24px; - margin-bottom: 16px; } - -h6 { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - font-size: 16px; - font-weight: 400; - line-height: 24px; - letter-spacing: 0.04em; - margin-top: 24px; - margin-bottom: 16px; } - -p { - font-size: 14px; - font-weight: 400; - line-height: 24px; - letter-spacing: 0; - margin-bottom: 16px; } - -a { - color: rgb(255,64,129); - font-weight: 500; } - -blockquote { - font-family: "Roboto", "Helvetica", "Arial", sans-serif; - position: relative; - font-size: 24px; - font-weight: 300; - font-style: italic; - line-height: 1.35; - letter-spacing: 0.08em; } - blockquote:before { - position: absolute; - left: -0.5em; - content: '“'; } - blockquote:after { - content: '”'; - margin-left: -0.05em; } - -mark { - background-color: #f4ff81; } - -dt { - font-weight: 700; } - -address { - font-size: 12px; - font-weight: 400; - line-height: 1; - letter-spacing: 0; - font-style: normal; } - -ul, ol { - font-size: 14px; - font-weight: 400; - line-height: 24px; - letter-spacing: 0; } diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/AppBar.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/AppBar.jsx deleted file mode 100644 index 2a383c8..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/AppBar.jsx +++ /dev/null @@ -1,166 +0,0 @@ -import React, { Component, PropTypes } from 'react'; -import cx from 'classnames'; - -import IconButton from 'react-mdl/lib/IconButton'; - -import config from '../config'; - -import LanguageSwitch from '../containers/LanguageSwitch.jsx'; -import LoginDialog from '../containers/LoginDialog.jsx'; -import SearchBox from './SearchBox.jsx'; - -import './AppBar.less'; - -const LOGO_SRC = '/static/logo.png'; - - -export default class AppBar extends Component { - static propTypes = { - className : PropTypes.string, - title : PropTypes.string, - search : PropTypes.string, - rightIconName : PropTypes.string, - displayRightMenu : PropTypes.bool, - displaySearch : PropTypes.bool, - isOrganization : PropTypes.bool, - fixOnScroll : PropTypes.bool, - hideGoBackBtn : PropTypes.bool, - scrollOffset : PropTypes.number, - onRightIconClick : PropTypes.func, - onSearch : PropTypes.func - }; - - static contextTypes = { i18n: PropTypes.object }; - - static defaultProps = { - title : '', - search : '', - fixOnScroll : true, - displaySearch : false, - displayRightMenu : true, - rightIconName : '', - scrollOffset : 0 - }; - - state = { - isFixedToTop : false, - isLoggingIn : false - }; - - componentDidMount() { - if (this.props.fixOnScroll) { - window.addEventListener('scroll', this.handleScroll); - } - } - - componentWillUnmount() { - if (this.props.fixOnScroll) { - window.removeEventListener('scroll', this.handleScroll); - } - } - - handleScroll = () => { - const scrollTop = (window.pageYOffset !== undefined) - ? window.pageYOffset - : (document.documentElement || document.body.parentNode || document.body).scrollTop; - - const isFixedToTop = scrollTop > this.props.scrollOffset; - - if (isFixedToTop !== this.state.isFixedToTop) { - this.setState({ isFixedToTop }); - } - }; - - handleLogin = () => { - this.setState({ - isLoggingIn: true - }); - }; - - handleLoginDialogClose = () => { - this.setState({ - isLoggingIn: false - }); - }; - - render() { - const { - title, - search, - className, - displaySearch, - displayRightMenu, - rightIconName, - hideGoBackBtn, - onRightIconClick, - onSearch, - isOrganization - } = this.props; - - const { l } = this.context.i18n; - - const { isLoggingIn, isFixedToTop } = this.state; - - const rootClassNames = cx('AppBar', className, { - 'AppBar--fixed' : isFixedToTop, - 'AppBar--with-search' : displaySearch - }); - - return ( -
- - - { - !isOrganization && !hideGoBackBtn - ? -
- { - rightIconName - ? - : - Testing platform - - } - -

{title}

-
- : - null - } - { - displaySearch - ?
- -
- : null - } - - { - displayRightMenu - ?
- - - {l('Sign up / Sign in')} - -
- : null - } -
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/AppBar.less b/parser_setup/__tests__/itsquiz-wall/shared/components/AppBar.less deleted file mode 100644 index cce7517..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/AppBar.less +++ /dev/null @@ -1,100 +0,0 @@ -@import "../assets/mixins.less"; -@import "../assets/palette.less"; -@import "../assets/media.less"; - -.AppBar { - height: 65px; - max-width: 100vw; - width: 100%; - box-sizing: border-box; - padding: 16px; - background-color: @primary-1-color; - color: @white-darker; - z-index: 99; - transition-duration: .3s; - display: flex; - top: 0; - align-items: center; - - @media @phone, @tablet { - justify-content: space-between; - } - - &.AppBar--with-search { - .AppBar__left { - flex: 2; - - @media @phone { - flex: 3; - } - } - - .AppBar__right { - @media @phone { - flex: auto !important; - } - - } - } -} - -.AppBar__title { - font-size: 20px; - margin-left: 16px; - font-weight: 400; - - .text-ellipsis; -} - -.AppBar__left { - display: flex; - align-items: center; - flex: 4; -} - -.AppBar__right { - display: flex; - height: 40px; - align-items: center; - justify-content: flex-end; - flex: 2; - - @media @phone { - max-width: 50px; - flex: 0; - - .AppBar__menu-item { - display: none; - } - } -} - -.AppBar__center { - display: flex; - align-items: center; - flex: 3; - - @media @phone { - justify-content: flex-end; - flex: 2; - } - - @media @large { - flex: 4; - } -} - -.AppBar__menu-item { - padding: 10px; - margin-left: 5px; - height: 20px; - cursor: pointer; - font-weight: 400; - font-size: 14px; - color: @white-darker; -} - -&.AppBar--fixed { - position: fixed; - box-shadow: 0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.2),0 1px 8px 0 rgba(0,0,0,.12); -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/AppBarWithBackground.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/AppBarWithBackground.jsx deleted file mode 100644 index 53942de..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/AppBarWithBackground.jsx +++ /dev/null @@ -1,40 +0,0 @@ -import React, { Component, PropTypes } from 'react'; - -import AppBar from './AppBar.jsx'; - -import './AppBarWithBackground.less'; - -export default class AppBarWithBackground extends Component { - static propTypes = { - backgroundURL : PropTypes.string, - height : PropTypes.number, - onLogin : PropTypes.func, - isOrganization: PropTypes.bool - }; - - static defaultProps = { - backgroundURL : '', - height : 0 - }; - - render() { - const { backgroundURL, height, onLogin, isOrganization } = this.props; - - const appBarStyle = { - background: `url(${backgroundURL}) center / cover` - }; - - return ( -
- -
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/AppBarWithBackground.less b/parser_setup/__tests__/itsquiz-wall/shared/components/AppBarWithBackground.less deleted file mode 100644 index cb73166..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/AppBarWithBackground.less +++ /dev/null @@ -1,22 +0,0 @@ -@import "../assets/palette.less"; - -.AppBarWithBackground { - height: 300px; - width: 100vw; - background-color: @primary-1-color; - position: absolute; - top: 0; -} - -.AppBarWithBackground__fixed { - background-color: transparent; - - &.AppBar--fixed { - background-color: @white-darker; - color: @text-color; - - .AppBar__title { - color: @text-color; - } - } -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/CompanyCard.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/CompanyCard.jsx deleted file mode 100644 index e01d589..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/CompanyCard.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import React, { Component, PropTypes } from 'react'; -import Button from 'react-mdl/lib/Button'; - -export class CompanyCard extends Component { - static propTypes = { - companyName : PropTypes.string, - country : PropTypes.string, - city : PropTypes.string, - onClick : PropTypes.string - }; - - render() { - const { companyName, country, city, onClick } = this.props; - - return ( -
- Company {companyName} from {country} {city} - - -
- ); - } -} - diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/Dialog.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/Dialog.jsx deleted file mode 100644 index d72ba5b..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/Dialog.jsx +++ /dev/null @@ -1,43 +0,0 @@ -import React, { Component, PropTypes } from 'react'; -import ReactModal from 'react-modal'; - -import './Dialog.less'; - - -export default class Dialog extends Component { - static propTypes = { - title : PropTypes.string, - isOpen : PropTypes.bool, - children : PropTypes.any, - onRequestClose : PropTypes.func - }; - - render() { - const { isOpen, title, children, onRequestClose } = this.props; - - const styles = { - overlay : { - backgroundColor : 'rgba(0, 0, 0, 0.5)' - }, - content : { - position : 'static', - outline : 'none' - } - }; - - return ( - - { - title - ?

{title}

- : null - } - {children} -
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/Dialog.less b/parser_setup/__tests__/itsquiz-wall/shared/components/Dialog.less deleted file mode 100644 index 18dd655..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/Dialog.less +++ /dev/null @@ -1,51 +0,0 @@ -@import '../assets/palette.less'; -@import "../assets/media.less"; - -.ReactModalPortal { - .ReactModal__Overlay { - z-index: 1000; - display: flex; - background-color: rgba(0,0,0,0.5); - overflow-y: auto !important; - } - - .ReactModal__Content { - padding-top: 16px; - padding-right: 16px; - padding-left: 16px; - padding-bottom: 8px; - margin: auto; - border: 0; - border-radius: 2px !important; - max-width: 800px; - overflow: visible !important; - min-width: 300px; - box-sizing: border-box; - box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); - opacity: 0; - transition: all 0.2s ease-in-out; - transform: scale(0.6); - display: flex; - flex-direction: column; - - @media @phone { - border-radius: 0 !important; - } - - &.ReactModal__Content--after-open { - opacity: 1; - transform: scale(1); - } - - &.ReactModal__Content--before-close { - transform: scale(0.4); - } - } -} - -.Dialog__title { - margin: 8px 0; - font-size: 18px; - color: black; - font-weight: 500; -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/ExpandableText.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/ExpandableText.jsx deleted file mode 100644 index caea850..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/ExpandableText.jsx +++ /dev/null @@ -1,80 +0,0 @@ -import React, { Component, PropTypes } from 'react'; - -import cx from 'classnames'; - -import Button from 'react-mdl/lib/Button'; -import Markdown from './Markdown.jsx'; - -import './ExpandableText.less'; - -const MAX_CHAR_NUMBER = 300; - -export default class ExpandableText extends Component { - static propTypes = { - text : PropTypes.string, - markdownPreset : PropTypes.string, - isMarkdownEnabled : PropTypes.bool - }; - - static contextTypes = { i18n: React.PropTypes.object }; - - state = { - expanded: false - }; - - handleClick = () => { - this.setState({ - expanded: !this.state.expanded - }); - }; - - renderedText = () => { - const { text, markdownPreset, isMarkdownEnabled } = this.props; - - return isMarkdownEnabled - ? - :

{text}

; - } - - render() { - const { l } = this.context.i18n; - - const { text, markdownPreset } = this.props; - - const classes = cx('ExpandableText__text', { - 'minimized': !this.state.expanded - }); - - return ( -
- { - text.length > MAX_CHAR_NUMBER - ? -
-
- -
- -
- : -
- -
- } -
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/ExpandableText.less b/parser_setup/__tests__/itsquiz-wall/shared/components/ExpandableText.less deleted file mode 100644 index 102e3db..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/ExpandableText.less +++ /dev/null @@ -1,32 +0,0 @@ -@import "../assets/media.less"; - -@line-height: 22px; - -.ExpandableText { - padding: 24px; - font-weight: 200; - - @media @phone { - margin-top: 20px; - padding: 16px; - } -} - -.ExpandableText__text { - p { - white-space: pre-wrap; - word-wrap: break-word; - line-height: @line-height; - margin-bottom: @line-height; - } - - &.minimized { - height: @line-height * 3; - overflow: hidden; - } -} - -.ExpandableText__expand-button { - display: block; - margin: 0 auto; -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/Footer.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/Footer.jsx deleted file mode 100644 index 0025770..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/Footer.jsx +++ /dev/null @@ -1,139 +0,0 @@ -import React, { Component, PropTypes } from 'react'; - -import ShareDialog from '../containers/ShareDialog.jsx'; - -import './Footer.less'; - -export default class Footer extends Component { - static propTypes = { - links : PropTypes.object, - linkToShare : PropTypes.string, - showShareDialog : PropTypes.bool, - onLinkClick : PropTypes.func, - onShareClick : PropTypes.func, - onShareClose : PropTypes.func - }; - - static contextTypes = { i18n: PropTypes.object }; - - render() { - const { l } = this.context.i18n; - - const { links, linkToShare, showShareDialog, onLinkClick, onShareClick, onShareClose } = this.props; - - return ( -
- -
-
- - - - - -
-
-
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/Footer.less b/parser_setup/__tests__/itsquiz-wall/shared/components/Footer.less deleted file mode 100644 index 0bdfe7a..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/Footer.less +++ /dev/null @@ -1,72 +0,0 @@ -@footer-color: #343434; - -.Footer { - margin-top: 20px; - background-color: @footer-color; - width: 100%; - display: flex; -} - -.Footer__menus-container { - padding: 20px; - display: flex; - flex-wrap: wrap; - justify-content: flex-start; -} - -.Footer__menu { - width: 200px; - flex-grow: 1; - padding: 0 15px; -} - -.Footer__menu-header { - color: lighten(@footer-color, 60%); - text-transform: uppercase; - margin: 0; - font-size: 14px; -} - -.Footer__menu-items { - list-style-type: none; - margin: 0; - padding: 0; - - a { - text-decoration: none; - color: lighten(@footer-color, 40%); - transition: .4s; - font-weight: 300; - cursor: pointer; - - &:hover { - text-decoration: underline; - } - } -} - -.Footer__content { - max-width: 900px; - margin: auto; - display: flex; - flex-direction: column; - justify-content: center; -} - -.Footer__socials { - margin-top: 10px; - width: 100%; - text-align: center; -} - -.Footer__social-icon { - cursor: pointer; - font-size: 32px; - margin: 5px; - color: lighten(@footer-color, 50%); - transition: .4s; - - &:hover { - color: lighten(@footer-color, 70%); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/Icon.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/Icon.jsx deleted file mode 100644 index c076891..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/Icon.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import React, { Component, PropTypes } from 'react'; -import cx from 'classnames'; - -export default class Icon extends Component { - static propTypes = { - type : PropTypes.string.isRequired, - className : PropTypes.string - }; - - render() { - const { type, className, ...otherProps } = this.props; - - return ( - - ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/LanguageSwitch.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/LanguageSwitch.jsx deleted file mode 100644 index 38724fa..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/LanguageSwitch.jsx +++ /dev/null @@ -1,41 +0,0 @@ -import React, { Component, PropTypes } from 'react'; -import cx from 'classnames'; - -import './LanguageSwitch.less'; - -export default class LanguageSwitch extends Component { - static propTypes = { - languages : PropTypes.arrayOf(PropTypes.string), - selectedLanguage : PropTypes.string, - className : PropTypes.func, - onSelect : PropTypes.func.isRequired - }; - - handleSelectValueChange = (e) => { - this.props.onSelect(e.target.value); - }; - - render() { - const { className, selectedLanguage, languages } = this.props; - - const classes = cx('LanguageSwitch__select', className); - - return ( -
- -
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/LanguageSwitch.less b/parser_setup/__tests__/itsquiz-wall/shared/components/LanguageSwitch.less deleted file mode 100644 index bc71594..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/LanguageSwitch.less +++ /dev/null @@ -1,28 +0,0 @@ -@import "../assets/mixins.less"; -@import "../assets/palette.less"; - -.LanguageSwitch__select { - background-color: transparent; - cursor: pointer; - border: none; - height: 40px; - padding: 10px; - font-size: 14px; - font-weight: 400; - color: @white-darker; - -webkit-appearance: none; - appearance: none; - - &:focus{ - outline: 0; - } - - &::-ms-expand { display: none; } -} - -.LanguageSwitch__option { - color: @black-darker; - background-color: @white-darker; - border: none; - box-shadow: none; -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/LoginDialog.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/LoginDialog.jsx deleted file mode 100644 index 401fd9d..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/LoginDialog.jsx +++ /dev/null @@ -1,77 +0,0 @@ -import React, { Component, PropTypes } from 'react'; - -import Dialog from './Dialog.jsx'; -import Icon from './Icon.jsx'; - -import './LoginDialog.less'; - -export default class LoginDialog extends Component { - static propTypes = { - isOpen : PropTypes.bool.isRequired, - title : PropTypes.string, - onSocialLogin : PropTypes.func.isRequired, - onEmailLogin : PropTypes.func.isRequired, - onRequestClose : PropTypes.func.isRequired - }; - - static contextTypes = { i18n: PropTypes.object }; - - render() { - const { l } = this.context.i18n; - const { title, onSocialLogin, onEmailLogin } = this.props; - - return ( -
- -

- {l('Sign in with your social network account to continue')} -

- -
-
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
- -

- {l('or use your e-mail')} -

-
-
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/LoginDialog.less b/parser_setup/__tests__/itsquiz-wall/shared/components/LoginDialog.less deleted file mode 100644 index bab2f9a..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/LoginDialog.less +++ /dev/null @@ -1,71 +0,0 @@ -.LoginDialog { - display: flex; - flex-direction: column; - align-items: center; -} - -.LoginDialog__buttons-container { - display: flex; - width: 350px; - margin: auto; - padding: 8px 0; - max-width: 100%; - justify-content: space-around; -} - -.LoginDialog__button { - width: 50px; - height: 50px; - border-radius: 50px; - background-color: grey; - display: flex; - cursor: pointer; - - &.LoginDialog__button--facebook { - background-color: #47639E; - } - - &.LoginDialog__button--google { - background-color: #DB4437; - } - - &.LoginDialog__button--github { - background-color: #333333; - - .LoginDialog__icon { - font-size: 30px; - } - } - - &.LoginDialog__button--vkontakte { - background-color: #4E7094; - } - - &.LoginDialog__button--linkedin { - background-color: #0075B2; - } -} - -.LoginDialog__title { - font-size: 15px; - color: rgba(0,0,0,.54); - padding-top: 10px; - padding-bottom: 10px; - text-align: center; - margin: 0 auto; - cursor: default; -} - -.LoginDialog__title--clickable { - cursor: pointer; - - &:hover { - color: rgba(0,0,0,.74); - } -} - -.LoginDialog__icon { - font-size: 25px; - color: white; - margin: auto; -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/Markdown.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/Markdown.jsx deleted file mode 100644 index dabc219..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/Markdown.jsx +++ /dev/null @@ -1,81 +0,0 @@ - /* eslint - react/no-danger: 0, - max-params: 0, - func-style: 0, - camelcase: 0 -*/ - -import React, { Component, PropTypes } from 'react'; - -import MarkdownIt from 'markdown-it'; -import sanitizeHtml from 'sanitize-html'; - -import { activationDescriptionPreset } from './Markdown/presets.js'; - -const MAX_LINK_LENGTH = 35; - -class Markdown extends Component { - static propTypes = { - source : PropTypes.string.isRequired, - preset : PropTypes.oneOf([ 'activationDescription' ]) - }; - - componentWillMount() { - this.md = new MarkdownIt(); - - const { preset } = this.props; - - switch (preset) { - case 'activationDescription': { - this.md.configure(activationDescriptionPreset).enable('linkify').enable(['link', 'list', 'emphasis']); - - break; - } - - default: { - this.md.enable('linkify'); - } - } - - const customRenderer = (tokens, idx, options, env, self) => self.renderToken(tokens, idx, options); - const rules = this.md.renderer.rules; - - const defaultRender = rules.link_open || customRenderer; - - rules.link_open = (tokens, idx, options, env, self) => { - const newTokens = tokens; - const aIndex = newTokens[idx].attrIndex('target'); - - if (aIndex < 0) { - newTokens[idx].attrPush(['target', '_blank']); - } else { - newTokens[idx].attrs[aIndex][1] = '_blank'; - } - - if (newTokens[idx].info === 'auto') { - let href = newTokens[idx].attrs[0][1]; - - if (href.length > MAX_LINK_LENGTH) { - href = `${href.slice(0, MAX_LINK_LENGTH)}...`; - newTokens[idx + 1].content = href; - } - } - - return defaultRender(newTokens, idx, options, env, self); - }; - } - - getMarkdownMarkup = () => { - const renderedMarkdown = this.md.render(sanitizeHtml(this.props.source)); - - return { - __html : renderedMarkdown - }; - }; - - render() { - return
; - } -} - -export default Markdown; diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/Markdown/presets.js b/parser_setup/__tests__/itsquiz-wall/shared/components/Markdown/presets.js deleted file mode 100644 index 42602fa..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/Markdown/presets.js +++ /dev/null @@ -1,39 +0,0 @@ -export const activationDescriptionPreset = { - options: { - html : false, - xhtmlOut : false, - breaks : false, - langPrefix : 'language-', - linkify : true, - typographer : false, - quotes : '\u201c\u201d\u2018\u2019', - highlight : null, - maxNesting : 20 - }, - - components: { - core: { - rules: [ - 'normalize', - 'block', - 'inline' - ] - }, - - block: { - rules: [ - 'paragraph' - ] - }, - - inline: { - rules: [ - 'text' - ], - rules2: [ - 'balance_pairs', - 'text_collapse' - ] - } - } -}; diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/QuizCard.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/QuizCard.jsx deleted file mode 100644 index 33b8550..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/QuizCard.jsx +++ /dev/null @@ -1,191 +0,0 @@ -import React, { Component, PropTypes } from 'react'; -import cx from 'classnames'; - -import IconButton from 'react-mdl/lib/IconButton'; -import { Card, CardTitle, CardActions } from 'react-mdl/lib/Card'; -import Button from 'react-mdl/lib/Button'; - -import { makeSlug } from '../utils/urlUtil'; -import { sprintf } from '../utils'; - -import MdiIcon from './Icon.jsx'; - -import './QuizCard.less'; - -export default class QuizCard extends Component { - static propTypes = { - id : PropTypes.string, - name : PropTypes.string, - message : PropTypes.string, - timeToPass : PropTypes.number, - numberOfQuestions : PropTypes.number, - pictureURL : PropTypes.string, - author : PropTypes.object, - isSponsored : PropTypes.bool, - isSurvey : PropTypes.bool, - className : PropTypes.string, - category : PropTypes.string, - isPassed : PropTypes.bool, - accountQuizSession : PropTypes.object, - onShare : PropTypes.func, - onAuthorAvatarClick : PropTypes.func, - onClick : PropTypes.func - }; - - static contextTypes = { i18n: PropTypes.object }; - - handleClick = (e) => { - e.preventDefault(); - this.props.onClick(); - }; - - getCategoryLabel = (category) => { - const { l } = this.context.i18n; - - const categoryLabels = { - 'EDUCATION': l('Education'), - 'ENTERTAINMENT': l('Entertainment'), - 'VACANCY': l('Vacancy') - }; - - return categoryLabels[category]; - }; - - render() { - const { - id, - name, - message, - className, - category, - timeToPass, - numberOfQuestions, - pictureURL, - author, - isSponsored, - isPassed, - isSurvey, - accountQuizSession, - onClick, - onShare, - onAuthorAvatarClick - } = this.props; - - const { l, nl, humanizeDuration } = this.context.i18n; - - const classes = cx('QuizCard', className, { - 'QuizCard--sponsored': isSponsored - }); - - const classesForActionBlock = cx('QuizCard__actions', { - 'QuizCard__actions--survey': isSurvey - }); - - return ( - - -
- -
- - {name} - - -
- {author.fullName} -
-
-
-
- -
- { - isPassed - ?
- { - !isSurvey - ? - - {accountQuizSession.score}% - - : - - } -
- : null - } - -
- {this.getCategoryLabel(category)} -
-
- -
- { - isSponsored - ?
- {l('Special proposition!')} -
- :
- - { - sprintf( - nl('%d question', '%d questions', numberOfQuestions), - numberOfQuestions - ) - } - - - {humanizeDuration(timeToPass, 'second')} -
- } - -

{message}

-
- - - { - !isSurvey - ? -
- -
- : - null - } - - -
-
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/QuizCard.less b/parser_setup/__tests__/itsquiz-wall/shared/components/QuizCard.less deleted file mode 100644 index 43df35a..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/QuizCard.less +++ /dev/null @@ -1,184 +0,0 @@ -@import "../assets/mixins.less"; -@import "../assets/palette.less"; - -@AVATAR_SIZE : 45px; - -.QuizCard { - width: 100%; - text-decoration: none; - color: @text-color; -} - -.QuizCard__head { - color: @text-color; - height: 60px; - padding: 10px; - display: flex; - - .mdl-card__title-text { - marhin: auto 0; - font-size: 19px; - } -} - -.QuizCard__media { - min-height: 200px; - cursor: default; - padding: 0; - position: relative; -} - -.QuizCard__overlay { - opacity: 1; - height: 100%; - width: 100%; - position: absolute; - top: 0; - left:0; - display: flex; - transition: .3s; - background-color: rgba(0, 0, 0, 0.35); - - &:hover { - opacity: 0; - } -} - -.QuizCard__category { - background-color: @black-dark; - color: @white-darker; - padding: 3px 5px; - position: absolute; - bottom: 4px; - left: 4px; - font-size: 13px; - font-weight: 500; - border-radius: 2px; -} - -.QuizCard__account-score { - margin: auto; - font-size: 60px; - color: white; -} - -.QuizCard__survey--passed { - font-size: 100px; - color: white; - display: block; - margin: auto; -} - -@font-size: 14px; -@line-height: 1.4; -@lines-to-show: 2; - -.QuizCard__content { - margin: 0; - padding: 8px; -} - -.QuizCard__text { - color: @secondary-text-color; - display: block; - display: -webkit-box; - max-width: 400px; - height: @font-size*@line-height*@lines-to-show; - margin: 0 auto; - font-size: @font-size; - line-height: @line-height; - -webkit-line-clamp: @lines-to-show; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; -} - -.QuizCard__title { - color: @text-color; - font-size: 19px; -} - -.QuizCard__info { - display: flex; - width: 100%; - align-items: center; - - .QuizCard__avatar { - width: @AVATAR_SIZE; - height: @AVATAR_SIZE; - border-radius: 50%; - cursor: pointer; - } - - .QuizCard__name-author { - margin-left: 10px; - width: calc(~"100% -" @AVATAR_SIZE ~"- 20px"); - } - - .QuizCard__name { - font-size: 14px; - color: @text-color; - text-decoration: none; - display: block; - width: 100%; - font-weight: 600; - cursor: pointer; - - .text-ellipsis; - - &:hover { - text-decoration: underline; - } - } - - .QuizCard__author { - margin-top: 3px; - font-size: 12px; - color: @secondary-text-color; - font-weight: 500; - - .text-ellipsis; - } -} - -.QuizCard__details { - font-size: 14px; - margin-bottom: 5px; - - .QuizCard__span-divider { - margin: 0 5px; - } -} - -.QuizCard__special { - font-size: 14px; - cursor: pointer; - margin-bottom: 5px; - font-weight: 600; - color: @primary-1-color; -} - -.QuizCard__actions { - display: flex; - justify-content: space-between; -} - -.QuizCard__actions--survey { - display: flex; - justify-content: flex-end; -} - -.QuizCard--sponsored { - .QuizCard__share-button { - color: @accent-1-color; - } - - .QuizCard__more-button { - color: white; - background-color: @accent-1-color; - - &:hover { - background-color: @accent-2-color; - } - } -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/QuizTile.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/QuizTile.jsx deleted file mode 100644 index 6867032..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/QuizTile.jsx +++ /dev/null @@ -1,83 +0,0 @@ -import React, { Component, PropTypes } from 'react'; - -import { Card, CardTitle, CardActions } from 'react-mdl/lib/Card'; - -import { makeSlug } from '../utils/urlUtil'; - -import MdiIcon from './Icon.jsx'; - -import './QuizTile.less'; - -export default class QuizTile extends Component { - static propTypes = { - id : PropTypes.string, - name : PropTypes.string, - message : PropTypes.string, - pictureURL : PropTypes.string, - author : PropTypes.object, - accountQuizSession : PropTypes.object, - isPassed : PropTypes.bool, - onClick : PropTypes.func - }; - - static contextTypes = { i18n: PropTypes.object }; - - handleClick = (e) => { - e.preventDefault(); - this.props.onClick(); - }; - - render() { - const { - id, - name, - pictureURL, - author, - accountQuizSession, - isPassed, - onClick - } = this.props; - - const isSurvey = accountQuizSession ? accountQuizSession.maxPoints === 0 : false; - - return ( - - - - { - isPassed - ?
- { - !isSurvey - ? - - {accountQuizSession.score}% - - : - - } -
- : null - } -
- - - - {name} - - -
- {author.fullName} -
-
-
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/QuizTile.less b/parser_setup/__tests__/itsquiz-wall/shared/components/QuizTile.less deleted file mode 100644 index bfbf247..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/QuizTile.less +++ /dev/null @@ -1,76 +0,0 @@ -@import "../assets/mixins.less"; -@import "../assets/palette.less"; - -.QuizTile { - width: 100%; - height: calc(~"100% + 50px"); - position: relative; - background-color: @white-darker; -} - -.QuizTile__text { - background-color: @white-darker; - height: 50px; - width: 100%; - - .QuizTile__name { - font-size: 14px; - color: @text-color; - text-decoration: none; - display: block; - width: 100%; - font-weight: 600; - cursor: pointer; - - .text-ellipsis; - - &:hover { - text-decoration: underline; - } - } - - .QuizTile__author { - margin-top: 3px; - font-size: 12px; - color: @secondary-text-color; - font-weight: 500; - - .text-ellipsis; - } -} - -.QuizTile__title { - color: @white-darker; - padding: 0; - position: relative; - cursor: default; -} - -.QuizTile__overlay { - opacity: 1; - height: 100%; - width: 100%; - position: absolute; - top: 0; - left:0; - background-color: rgba(0, 0, 0, 0.35); - display: flex; - transition: .3s; - - &:hover { - opacity: 0; - } -} - -.QuizTile__account-score { - margin: auto; - font-size: 60px; - color: white; -} - -.QuizTile__survey--passed { - display: block; - margin: auto; - font-size: 90px; - color: white; -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/SearchBox.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/SearchBox.jsx deleted file mode 100644 index e885d9c..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/SearchBox.jsx +++ /dev/null @@ -1,98 +0,0 @@ -import React, { Component, PropTypes } from 'react'; -import cx from 'classnames'; - -import Icon from 'react-mdl/lib/Icon'; -import Textfield from 'react-mdl/lib/Textfield'; - -import './SearchBox.less'; - -const ENTER_KEY = 13; - -export default class SearchBox extends Component { - static propTypes = { - search : PropTypes.string, - onSearch : PropTypes.func - }; - - static contextTypes = { i18n: PropTypes.object }; - - state = { - isFocused: false - }; - - handleKeyDown = (e) => { - if (e.keyCode === ENTER_KEY) { - this.props.onSearch(e.target.value); - } - }; - - handleSearchChange = (e) => { - const value = e.target.value; - - if (!value) { - this.props.onSearch(value); - } - }; - - handleBoxClick = () => { - this._input.focus(); - }; - - handleFocus = () => { - this.setState({ - isFocused: true - }); - }; - - handleBlur = () => { - this.setState({ - isFocused: false - }); - }; - - render() { - const { search } = this.props; - const { l } = this.context.i18n; - - const rootClassNames = cx('SearchBox', { - 'SearchBox--focused' : this.state.isFocused - }); - - return ( -
-
- - - this._input = ref} - placeholder = {l('Search')} - defaultValue = {search} - onChange = {this.handleSearchChange} - onKeyDown = {this.handleKeyDown} - onFocus = {this.handleFocus} - onBlur = {this.handleBlur} - /> -
- - -
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/SearchBox.less b/parser_setup/__tests__/itsquiz-wall/shared/components/SearchBox.less deleted file mode 100644 index 3e4a68a..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/SearchBox.less +++ /dev/null @@ -1,133 +0,0 @@ -@import "../assets/mixins.less"; -@import "../assets/palette.less"; -@import "../assets/media.less"; - -.SearchBox { - width: 100%; - - &.SearchBox--focused { - .SearchBox__box { - background-color: @white-darker; - box-shadow: 0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.2),0 1px 8px 0 rgba(0,0,0,.12); - } - - .SearchBox__input { - color: @black-dark; - - &::-webkit-input-placeholder { - color: @black-light; - } - - &:-moz-placeholder { - color: @black-light; - } - - &::-moz-placeholder { - color: @black-light; - } - - &:-ms-input-placeholder { - color: @black-light; - } - } - - .SearchBox__search-icon { - color: @black-light; - } - } - - @media @phone { - width: auto; - - .SearchBox__box { - display: none; - } - - .SearchBox__input-expandable { - display: block; - } - } -} - -.SearchBox__input-expandable { - position: relative; - top: 3px; - display: none; - - .mdl-textfield__input { - font-weight: 300; - margin-left: 5px; - - &::-webkit-input-placeholder { - color: @white-dark; - } - - &:-moz-placeholder { - color: @white-dark; - } - - &::-moz-placeholder { - color: @white-dark; - } - - &:-ms-input-placeholder { - color: @white-dark; - } - } - - .mdl-button--icon i { - font-size: 28px; - } -} - -.SearchBox__box { - min-width: 100px; - box-sizing: border-box; - width: 100%; - background-color: @white-light; - display: flex; - flex-direction: row; - height: 45px; - padding: 3px 16px; - border-radius: 3px; - margin: 0; - align-items: center; - transition: .3s; - cursor: default; -} - -.SearchBox__input { - border: none; - box-shadow: none; - background-color: transparent; - font-size: 16px; - margin-left: 16px; - font-family: 'Roboto', sans-serif; - font-weight: 300; - width: 100%; - color: @white-darker; - - &::-webkit-input-placeholder { - color: @white-dark; - } - - &:-moz-placeholder { - color: @white-dark; - } - - &::-moz-placeholder { - color: @white-dark; - } - - &:-ms-input-placeholder { - color: @white-dark; - } - - &:focus { - outline: 0; - } -} - -.SearchBox__search-icon { - color: @white-darker; -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/ShareDialog.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/ShareDialog.jsx deleted file mode 100644 index 2337de0..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/ShareDialog.jsx +++ /dev/null @@ -1,67 +0,0 @@ -import React, { Component, PropTypes } from 'react'; - -import Dialog from './Dialog.jsx'; -import Icon from './Icon.jsx'; - -import './ShareDialog.less'; - -export default class ShareDialog extends Component { - static propTypes = { - title : PropTypes.string.isRequired, - isOpen : PropTypes.bool.isRequired, - onShare : PropTypes.func.isRequired, - onRequestClose : PropTypes.func.isRequired - }; - - static contextTypes = { i18n: PropTypes.object }; - - render() { - const { title, onShare } = this.props; - - return ( -
- -
-
- -
- -
- -
- -
- -
- -
- -
- -
- -
-
-
-
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/ShareDialog.less b/parser_setup/__tests__/itsquiz-wall/shared/components/ShareDialog.less deleted file mode 100644 index 66151e5..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/ShareDialog.less +++ /dev/null @@ -1,42 +0,0 @@ -.ShareDialog__buttons-container { - display: flex; - width: 350px; - padding: 8px 0; - max-width: 100%; - justify-content: space-around; -} - -.ShareDialog__button { - width: 50px; - height: 50px; - border-radius: 50%; - background-color: red; - display: flex; - cursor: pointer; - - &.ShareDialog__button--facebook { - background-color: #47639E; - } - - &.ShareDialog__button--google { - background-color: #DB4437; - } - - &.ShareDialog__button--twitter { - background-color: #53A9EA; - } - - &.ShareDialog__button--vk { - background-color: #4E7094; - } - - &.ShareDialog__button--linkedin { - background-color: #0075B2; - } -} - -.ShareDialog__icon { - font-size: 25px; - color: white; - margin: auto; -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/WelcomeDialog.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/WelcomeDialog.jsx deleted file mode 100644 index 7ff048c..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/WelcomeDialog.jsx +++ /dev/null @@ -1,190 +0,0 @@ -import React, { Component, PropTypes } from 'react'; - -import Button from 'react-mdl/lib/Button'; -import IconButton from 'react-mdl/lib/IconButton'; -import Checkbox from 'react-mdl/lib/Checkbox'; - -import Dialog from './Dialog.jsx'; - -import './WelcomeDialog.less'; - -export default class WelcomeDialog extends Component { - static propTypes = { - isOpen : PropTypes.bool.isRequired, - onCreateTest : PropTypes.func, - onDiscoverTests : PropTypes.func, - onEnglishCampaign : PropTypes.func, - onLearnMoreAboutItsquiz : PropTypes.func, - onDismiss : PropTypes.func.isRequired - }; - - static contextTypes = { i18n: PropTypes.object }; - - state = { - currentSlide: 0, - needToSkip: false - }; - - handleNextSlide = () => { - const { currentSlide } = this.state; - - this.setState({ - currentSlide: currentSlide + 1 - }); - }; - - handlePrevSlide = () => { - const { currentSlide } = this.state; - - this.setState({ - currentSlide: currentSlide - 1 - }); - }; - - handleSkipToggle = () => { - const { needToSkip } = this.state; - - this.setState({ - needToSkip: !needToSkip - }); - }; - - handleClose = () => { - const { needToSkip } = this.state; - - this.props.onDismiss(needToSkip); - }; - - render() { - const { l } = this.context.i18n; - const { onCreateTest, onDiscoverTests } = this.props; - const { currentSlide, needToSkip } = this.state; - - const slides = [ -
-
- -
- -
-

{l('Welcome to It\'s quiz!')}

-

{l('Explore hundreds of open tests on Quiz Wall, check your knowledge, explore new topics, ' - + 'share your achievements with friends!')} -

- -
-
, - -
-
- -
- -
-

{l('Check your knowledge')}

-

{l('Find out your language level, check knowledge of professional topics, pass entertainment ' - + 'tests or even find a new job! Everything absolutely free!')}

- -
-
, - -
-
- -
- -
-

{l('Find best ever employees')}

-

{l('Filter out candidates who don’t meet your standards before you interview them. ' - + 'Create test for a position, publish on Quiz Wall, enjoy interviewing only the best!')}

- -
-
, - -
-
- -
- -
-

{l('Create your own tests!')}

-

{l('Everyone can create a test on It\'s quiz! Simply add new questions, compose a quiz, ' - + 'activate and share with your friends!')}

- -
-
- ]; - - const currentSlideIndex = currentSlide % slides.length; - - return ( -
- -
- - -
- - -
- {slides[currentSlideIndex]} -
- - -
- - - - -
-
-
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/WelcomeDialog.less b/parser_setup/__tests__/itsquiz-wall/shared/components/WelcomeDialog.less deleted file mode 100644 index 51a4db4..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/WelcomeDialog.less +++ /dev/null @@ -1,121 +0,0 @@ -@import "../assets/mixins.less"; -@import "../assets/palette.less"; -@import "../assets/media.less"; - -@button-area: 64px; - -.WelcomeDialog__dialog { - @media @phone { - min-height: 100vh !important; - } -} - -.WelcomeDialog__content { - max-width: 100%; - display: flex; - align-items: center; - flex-direction: column; - flex: 1; - - @media @phone { - height: 100%; - justify-content: space-between; - } -} - -.WelcomeDialog__carousel { - display: flex; - align-items: center; - max-width: 100%; -} - -.WelcomeDialog__close { - display: block; - position: absolute; - color: @grey-500; - top: 10px; - right: 10px; -} - -.WelcomeDialog__slide-wrapper { - box-sizing: border-box; - min-width: 200px; - width: calc(~"100% - "@button-area); - padding: 10px; - display: flex; - min-height: 300px; -} - -.WelcomeDialog__slide { - width: 100%; - display: flex; - flex-wrap: wrap; - align-items: center; -} - -.WelcomeDialog__slide-image { - padding: 10px; - flex: 1; - min-width: 200px; - - @media @phone { - flex: auto; - width: 200px; - } - - img { - max-width: 100%; - - @media @phone { - margin: auto; - } - } -} - -.WelcomeDialog__btn { - color: white !important; -} - -.WelcomeDialog__skip { - color: @additional-text-color; - font-size: 12px; - - @media @phone { - display: absolute; - bottom: 5px; - } -} - -.WelcomeDialog__slide-content { - padding: 10px; - flex: 1; - min-width: 200px; - display: flex; - flex-direction: column; - - - @media @phone { - align-items: center; - } - - h1 { - font-size: 22px; - color: @text-color; - - @media @phone { - text-align: center; - font-weight: 500; - font-size: 16px; - } - } - - p { - font-size: 16px; - color: @additional-text-color; - - @media @phone { - text-align: center; - font-size: 14px; - } - } -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/layouts/MainLayout.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/layouts/MainLayout.jsx deleted file mode 100644 index 39b8f86..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/layouts/MainLayout.jsx +++ /dev/null @@ -1,39 +0,0 @@ -import React, { Component, PropTypes } from 'react'; - -// import WelcomeDialog from '../../containers/WelcomeDialog.jsx'; -import Footer from '../../containers/Footer.jsx'; - -import './MainLayout.less'; - -export default class MainLayout extends Component { - static propTypes = { - showWelcomeScreen : PropTypes.bool, - showFooter : PropTypes.bool, - children : PropTypes.object, - footerLinks : PropTypes.object, - onWelcomeScreenDismiss : PropTypes.func - }; - - render() { - // const { showWelcomeScreen, showFooter, children, onWelcomeScreenDismiss } = this.props; - const { showFooter, children } = this.props; - - return ( -
-
- {/* */} - {children} -
- - { - showFooter - ?
- : null - } -
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/layouts/MainLayout.less b/parser_setup/__tests__/itsquiz-wall/shared/components/layouts/MainLayout.less deleted file mode 100644 index 8846e6c..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/layouts/MainLayout.less +++ /dev/null @@ -1,7 +0,0 @@ -.MainLayout { - background-color: #eaeaea; - display: flex; - flex-direction: column; - justify-content: space-between; - min-height: 100vh; -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/other/ScoreCircle.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/other/ScoreCircle.jsx deleted file mode 100644 index e136497..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/other/ScoreCircle.jsx +++ /dev/null @@ -1,94 +0,0 @@ - /* eslint - no-param-reassign: 0 -*/ - -import React, { Component, PropTypes } from 'react'; - -import ProgressBar from 'progressbar.js'; -import ColorUtil from '../../utils/ColorUtil'; - -import './ScoreCircle.less'; - -const RED = '#F71D1D'; -const ORANGE = '#EAB42C'; -const GREEN = '#47D62A'; -const PURPLE = '#00bcd4'; - -class ScoreCircle extends Component { - static propTypes = { - value : PropTypes.number, - size : PropTypes.number - }; - - componentWillMount() { - this.id = Date.now(); - } - - componentDidMount() { - this.colorUtil = new ColorUtil([RED, ORANGE, GREEN]); - const { value } = this.props; - - this.scoreColor = '#FFF' || this.colorUtil.getColorCodeByPercent(value ? value : 0); - - this.circle = new ProgressBar.Circle(`#score-${this.id}`, { - color: '#FCB03C', - strokeWidth: 3, - trailWidth: 1, - duration: 1500, - text: { - value: `${value}%`, - color: this.scoreColor - }, - step: (state, shape) => { - shape.path.setAttribute('stroke', state.color); - shape.setText(`${(shape.value() * 100).toFixed(0)}%`); - shape.text.style.color = state.color; - } - }); - - this.circle.animate(value / 100, { - from: { color: PURPLE }, - to: { color: this.scoreColor } - }); - } - - shouldComponentUpdate(nextProps) { - return nextProps.value !== this.props.value; - } - - componentDidUpdate() { - const { value } = this.props; - const prevScoreColor = this.scoreColor; - - this.scoreColor = this.colorUtil.getColorCodeByPercent(value ? value : 0); - - this.circle.animate(value / 100, { - from : { color: prevScoreColor }, - to : { color: this.scoreColor } - }); - } - - componentWillUnmount() { - this.circle = null; - } - - render() { - const { size } = this.props; - - const style = { - width : size, - height : size, - fontSize : size / 3 - }; - - return ( -
- ); - } -} - -export default ScoreCircle; diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/other/ScoreCircle.less b/parser_setup/__tests__/itsquiz-wall/shared/components/other/ScoreCircle.less deleted file mode 100644 index 1398228..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/other/ScoreCircle.less +++ /dev/null @@ -1,8 +0,0 @@ -.ScoreCircle { - width: 100%; - height: 100%; - - .progressbar-text { - font-size: inherit; - } -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationPage.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationPage.jsx deleted file mode 100644 index c4070a1..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationPage.jsx +++ /dev/null @@ -1,875 +0,0 @@ -import React, { PropTypes } from 'react'; -import cx from 'classnames'; - -import { Card, CardTitle } from 'react-mdl/lib/Card'; -import Grid, { Cell } from 'react-mdl/lib/Grid'; -import Button from 'react-mdl/lib/Button'; -import IconButton from 'react-mdl/lib/IconButton'; -import Spinner from 'react-mdl/lib/Spinner'; - -import { sendEvent } from '../../utils/googleAnalytics'; - -import QuizTile from '../QuizTile.jsx'; -import Icon from '../Icon.jsx'; -import ShareDialog from '../../containers/ShareDialog.jsx'; -import LoginDialog from '../../containers/LoginDialog.jsx'; -import AppBarWithBackground from '../AppBarWithBackground.jsx'; -import ExpandableText from '../ExpandableText.jsx'; -import ScoreCircle from '../other/ScoreCircle.jsx'; -import Dialog from '../Dialog.jsx'; - -import { sprintf } from '../../utils'; - -import './ActivationPage.less'; - -export default class ActivationPage extends React.Component { - static propTypes = { - activation : PropTypes.object, - authorActivations : PropTypes.arrayOf(PropTypes.object), - similarActivations : PropTypes.arrayOf(PropTypes.object), - proposedActivations : PropTypes.arrayOf(PropTypes.object), - showAccountResult : PropTypes.bool, - isSurvey : PropTypes.bool, - isAllAuthorActivationsLoaded : PropTypes.bool, - sharingLink : PropTypes.string, - accountQuizSession : PropTypes.object, - isLoading : PropTypes.bool, - isLoggingIn : PropTypes.bool, - isEmbedded : PropTypes.bool, - isShowingProposedActivations : PropTypes.bool, - isOrganization : PropTypes.bool, - isAvailable : PropTypes.bool, - hideGoBackBtn : PropTypes.bool, - isLoadingAuthorActivations : PropTypes.bool, - dueTime : PropTypes.string, - assessmentSystem : PropTypes.array, - onPass : PropTypes.func, - onShare : PropTypes.func, - onShareComplete : PropTypes.func, - onLoginDialogClose : PropTypes.func, - onStopSharing : PropTypes.func, - onGoBack : PropTypes.func, - onShareResult : PropTypes.func, - onFillProfile : PropTypes.func, - onSponsoredClick : PropTypes.func, - onViewAnswers : PropTypes.func, - onActivationClick : PropTypes.func, - onLoadAllAuthorActivations : PropTypes.func, - onCloseMessageNotAvailable : PropTypes.func - }; - - static contextTypes = { i18n: PropTypes.object }; - - componentWillMount() { - const { l } = this.context.i18n; - - this.sponsoredButtonLabel = Math.random() < 0.5 ? l('Contact me') : l('Get the gift'); - } - - handleActivationClick = (activation) => { - this.props.onActivationClick(activation); - }; - - handlePassViaTelegram = () => { - sendEvent('Activation Page', 'Pass via Telegram'); - }; - - getGreeting = () => { - const { l } = this.context.i18n; - const { activation, assessmentSystem, isSurvey } = this.props; - const score = activation.accountQuizSession.score; - - if (isSurvey) { - return { phrase: l('Thank you for your answers!') }; - } - - if (assessmentSystem.length === 0) { - if (score > 95) { - return { phrase: l('You rock! Excellent job!') }; - } - - if (score > 75) { - return { phrase: l('Great result!') }; - } - - if (score > 50) { - return { phrase: l('Good job!') }; - } - - if (score > 30) { - return { phrase: l('You could do better!') }; - } - - return { phrase: l('You could do better!') }; - } - - for (let i = assessmentSystem.length - 1; i >= 0; i--) { - if (score >= assessmentSystem[i].grade) { - return { - phrase: assessmentSystem[i].phrase, - description: assessmentSystem[i].description || '' - }; - } - } - }; - - renderStatisticsForSurvey = () => { - const { activation } = this.props; - const { l } = this.context.i18n; - - if (!activation.accountQuizSession) return null; - - return ( -
- {sprintf(l('(%d of %d answered)'), activation.accountQuizSession.answeredQuestionsNumber, - activation.accountQuizSession.totalQuestionsNumber)} -
- ); - }; - - renderProposedActivations = () => { - if (!this.props.proposedActivations) { - return; - } - - return ( -
- { - this.props.proposedActivations.map(proposedActivation => -
- -
- ) - } -
- ); - }; - - renderAuthorActivations = () => { - const { - activation, - authorActivations, - isAllAuthorActivationsLoaded, - isLoadingAuthorActivations, - onLoadAllAuthorActivations - } = this.props; - - const { l } = this.context.i18n; - - if (authorActivations && authorActivations.length) { - return ( -
-
- {sprintf(l('More tests by %s'), activation.author.fullName)} -
- - - { - authorActivations.map(authorActivation => - - - - ) - } - - - { - isLoadingAuthorActivations - ? - - : - null - } - - { - !isAllAuthorActivationsLoaded - ? - - : - null - } -
- ); - } - - return null; - }; - - renderSimilarActivations = () => { - const { - similarActivations - } = this.props; - - const { l } = this.context.i18n; - - if (similarActivations && similarActivations.length) { - return ( -
-
- {l('Similar tests')} -
- - - { - similarActivations.map(similarActivation => - - - - ) - } - -
- ); - } - - return null; - }; - - renderContent = () => { - const { - activation, - isLoading, - showAccountResult, - isEmbedded, - isSurvey, - onPass, - onShare, - onShareResult, - onFillProfile, - onSponsoredClick, - onViewAnswers - } = this.props; - - const { - id, - pictureURL, - name, - isPrivate, - canPassViaChat, - accountQuizSession, - numberOfQuestions, - timeToPass, - author, - isSponsored, - canAssigneePass, - numberOfTriesLeft, - dueTime, - canAssigneeViewQuestions - } = activation; - - const { l, nl, humanizeDuration, getTimeFromNow } = this.context.i18n; - - const isPassingBtnAvailable = isEmbedded ? canAssigneePass : true; - - const greeting = showAccountResult ? this.getGreeting().phrase : ''; - const greetingDescription = showAccountResult ? this.getGreeting().description : ''; - - if (isLoading) { - return ; - } - - const classes = cx('ActivationPage__activation', { - 'ActivationPage__activation--sponsored': isSponsored, - 'ActivationPage__activation--passed': showAccountResult - }); - - const passInfoClasses = cx('ActivationPage__pass-info', { 'ActivationPage__pass-info--expires': dueTime }); - - const settingsIconsClasses = cx('ActivationPage__settings-icons--indented', { - 'ActivationPage__settings-icons--on' : canAssigneeViewQuestions, - 'ActivationPage__settings-icons--off' : !canAssigneeViewQuestions - }); - - const resultsContainerClasses = showAccountResult - ? cx('ActivationPage__results-container', accountQuizSession.resultBackground, { 'survey' : isSurvey }) - : ''; - - return ( -
- - - -
-
- {name} - { - isPrivate - ? - - {l('private')} - - : null - } -
- -
- {author.fullName} -
- -
- - { - sprintf( - nl('%d question', '%d questions', numberOfQuestions), - numberOfQuestions - ) - } - - - - • - - - - {humanizeDuration(timeToPass, 'second')} - - - { - dueTime - ? ( - - - • - - {sprintf(l('expires %s'), getTimeFromNow(dueTime))} - - - ) - : null - } - -
- - -
-
-
- { - showAccountResult && !isSurvey - ? - - : - null - } - - { - !showAccountResult && isPassingBtnAvailable - ? -
- - { - canPassViaChat - ? - - {l('pass via Telegram')} - - : - null - } - { - numberOfTriesLeft - ? -
- { - sprintf( - nl( - 'You have %d try left', - 'You have %d tries left', - numberOfTriesLeft), - numberOfTriesLeft - ) - } -
- : - null - } -
- : - null - } - - { - isSponsored - ? ( - - ) - : null - } -
-
- -
- { - !activation.isPrivate && !isSurvey - ? ( - - ) - : null - } -
-
- - { - showAccountResult - ? -
-
-
- { - !activation.isPrivate && !isSurvey - ? ( - - ) - : null - } -
-
- - { - !isSurvey - ? - -
- -
- : - null - } - - { - !isSurvey - ? -
- ({ - sprintf( - nl( - '%s of %s point', - '%s of %s points', - accountQuizSession.maxPoints - ), - accountQuizSession.gainedPoints, - accountQuizSession.maxPoints - ) - }) -
- : - null - } - - -

- {greeting} -

- - { - !isSurvey - ? - - : - null - } - - { - !isSurvey - ? -
- {accountQuizSession.score}% -
- : - this.renderStatisticsForSurvey() - } - - { - !isSurvey - ? -
- ({ - sprintf( - nl( - '%s of %s point', - '%s of %s points', - accountQuizSession.maxPoints - ), - accountQuizSession.gainedPoints, - accountQuizSession.maxPoints - ) - }) -
- : - null - } - - { - accountQuizSession.canViewAnswers - ? - - : null - } - - { - isPassingBtnAvailable - ? ( -
- - { - canPassViaChat - ? - - {l('pass via Telegram')} - - : - null - } - { - numberOfTriesLeft - ? -
- { - sprintf( - nl( - 'You have %d try left', - 'You have %d tries left', - numberOfTriesLeft), - numberOfTriesLeft - ) - } -
- : - null - } -
- ) - : null - } -
- -
- { - isPassingBtnAvailable - ? ( -
- - { - canPassViaChat - ? - - {l('pass via Telegram')} - - : - null - } - { - numberOfTriesLeft - ? -
- { - sprintf( - nl( - 'You have %d try left', - 'You have %d tries left', - numberOfTriesLeft), - numberOfTriesLeft - ) - } -
- : - null - } -
- ) - : null - } - - { - accountQuizSession.canViewAnswers - ? - - : null - } - - { - activation.category === 'VACANCY' - ?
- -
- {l('Filled profiles receive 70% more views')} -
-
- : null - } -
-
-
- : null - } - -
- -
-
- - {this.renderSimilarActivations()} - {this.renderAuthorActivations()} -
- ); - } - - render() { - const { l } = this.context.i18n; - const { - activation, - showAccountResult, - sharingLink, - isLoading, - isLoggingIn, - isEmbedded, - isOrganization, - isAvailable, - onCloseMessageNotAvailable, - hideGoBackBtn, - onLoginDialogClose, - onStopSharing, - onGoBack - } = this.props; - - const classes = cx('ActivationPage', { - 'ActivationPage--loading' : isLoading, - 'ActivationPage--embedded' : isEmbedded - }); - - return ( -
- - - - - - - { - -
- {l('Unfortunately, this quiz is not available. Author will be informed.')} -
-
- } - - {this.renderProposedActivations()} - -
- {this.renderContent()} -
-
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationPage.less b/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationPage.less deleted file mode 100644 index 990b60e..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationPage.less +++ /dev/null @@ -1,750 +0,0 @@ -@import "../../assets/mixins.less"; -@import "../../assets/palette.less"; -@import "../../assets/media.less"; - -.ActivationPage { - margin: 0 auto; - position: relative; - width: 100%; - box-sizing: border-box; - overflow: hidden; - display: flex; - flex-direction: column; - background-color: @background-color; -} - -.ActivationPage__content { - margin: 0 auto; - display: flex; - flex-direction: column; - align-items: center; - width: 100%; - min-width: 300px; - max-width: 800px; -} - -.ActivationPage__activation { - display: flex; - flex-direction: column; - align-items: center; - width: 100%; -} - -.ActivationPage__span-divider { - margin: 0 10px; -} - -.ActivationPage__menu { - position: absolute; - top: 16px; - right: 16px; -} - -.ActivationPage__menu--mobile { - display: none; - - @media @phone { - display: block; - position: absolute; - top: 16px; - right: 16px; - color: @white-darker; - } -} - -.ActivationPage__spinner { - margin-top: 30px; -} - -.ActivationPage__private-tag { - display: inline-block; - padding: 5px; - background-color: @amber-app; - border-radius: 5px; - font-size: 15px; - width: auto; - margin-left: 10px; - font-weight: 500; - color: @white-darker; - - .ActivationPage__lock { - margin: 0 3px; - } -} - -.ActivationPage__offer-btn { - font-size: 16px; - - .Icon { - font-size: 18px; - } -} - -.ActivationPage__paper { - align-self: center; - margin: 8px; - margin-top: 150px; - width: calc(~"100% - 32px"); - - @media @phone { - margin-top: 65px; - } - - .ActivationPage__actions { - margin: 16px 0; - display: flex; - justify-content: flex-end; - } - - .ActivationPage__head { - padding: 0; - display: flex; - padding: 16px; - align-items: flex-start; - - @media @phone { - flex-direction: column; - align-items: center; - } - - .ActivationPage__picture { - width: 150px; - height: 150px; - border-radius: 150px; - flex-shrink: 0; - } - - .ActivationPage__info { - margin-left: 16px; - display: flex; - flex-direction: column; - position: relative; - width: 100%; - height: 150px; - - @media @phone { - margin-left: 0; - height: auto; - margin-top: 24px; - align-items: center; - } - - .ActivationPage__heading { - width: calc(~"100% - 40px"); - - .ActivationPage__name { - font-size: 25px; - font-weight: 300; - - @media @phone { - width: 100%; - text-align: center; - } - } - - @media @phone { - width: 100%; - text-align: center; - margin-bottom: 10px; - } - } - - .ActivationPage__author-name { - margin-top: 5px; - font-weight: bold; - font-size: 15px; - color: @additional-text-color; - } - - .ActivationPage__price { - margin: 0 20px; - font-weight: bold; - font-size: 16px; - color: @green-200; - text-transform: uppercase; - } - - .ActivationPage__pass-info { - margin-top: 5px; - font-size: 15px; - color: @secondary-text-color; - font-weight: 400; - } - - .ActivationPage__pass-info--expires { - @media @phone { - display: flex; - flex-direction: column; - align-items: center; - } - } - - .ActivationPage__expires { - @media @phone { - display: flex; - flex-direction: column; - align-items: center; - } - } - - .ActivationPage__settings-icons { - margin-top: 5px; - - &--off { - opacity: 0.5; - } - - &--indented { - margin-right: 6px; - } - - @media @phone { - text-align: center; - } - } - - .ActivationPage__actions { - position: absolute; - display: flex; - flex-direction: row; - align-items: center; - right: 0; - bottom: 0; - - @media @phone { - position: relative; - margin-bottom: 10px; - margin-top: 20px; - flex-direction: column; - - .ActivationPage__btn { - order: 1; - } - } - } - - .ActivationPage__btn { - background-color: @green-app; - color: @white-darker; - } - - .ActivationPage__number-of-tries { - color: @secondary-text-color; - font-size: 12px; - margin-top: 8px; - text-align: center; - } - } - } - - .ActivationPage__head--passed { - padding: 0; - display: flex; - padding: 16px; - align-items: flex-start; - - @media @phone { - flex-direction: column; - align-items: center; - } - - .ActivationPage__picture { - width: 150px; - height: 150px; - border-radius: 150px; - flex-shrink: 0; - } - - .ActivationPage__info { - margin-left: 16px; - display: flex; - flex-direction: column; - position: relative; - width: 100%; - height: 150px; - - @media @phone { - margin-left: 0; - height: auto; - margin-top: 24px; - align-items: center; - } - - .ActivationPage__heading { - width: calc(~"100% - 40px"); - - .ActivationPage__name { - font-size: 25px; - font-weight: 300; - - @media @phone { - width: 100%; - text-align: center; - } - } - - @media @phone { - width: 100%; - text-align: center; - margin-bottom: 10px; - } - } - - .ActivationPage__author-name { - margin-top: 5px; - font-weight: bold; - font-size: 15px; - color: @additional-text-color; - } - - .ActivationPage__price { - margin: 0 20px; - font-weight: bold; - font-size: 16px; - color: @green-200; - text-transform: uppercase; - } - - .ActivationPage__pass-info { - margin-top: 5px; - font-size: 15px; - color: @secondary-text-color; - font-weight: 400; - } - - .ActivationPage__pass-info--expires { - @media @phone { - display: flex; - flex-direction: column; - align-items: center; - } - } - - .ActivationPage__expires { - @media @phone { - display: flex; - flex-direction: column; - align-items: center; - } - } - - .ActivationPage__settings-icons { - margin-top: 5px; - - &--off { - opacity: 0.5; - } - - &--indented { - margin-right: 6px; - } - - @media @phone { - text-align: center; - } - } - - .ActivationPage__actions { - position: absolute; - display: flex; - flex-direction: row; - align-items: center; - right: 0; - bottom: 0; - - @media @phone { - position: relative; - margin-bottom: 10px; - margin-top: 20px; - flex-direction: column; - - .ActivationPage__btn { - order: 1; - } - } - } - - .ActivationPage__btn { - background-color: @green-app; - color: @white-darker; - } - - .ActivationPage__number-of-tries { - color: @secondary-text-color; - font-size: 12px; - margin-top: 8px; - text-align: center; - } - } - - @media @phone { - display: none; - } - } - - .ActivationPage__divider { - width: 100%; - height: 1px; - background-color: @white-lighter; - margin: 0 auto; - } - - .ActivationPage__author { - margin-top: 10px; - } -} - -.ActivationPage__ad { - margin-bottom: 16px; -} - -.ActivationPage_score--circle { - display: none; - - .ScoreCircle { - margin: 0px auto; - } - - @media @phone { - display: block; - } -} - -.ActivationPage__greeting { - margin-top: 5px; - color: @white-darker; - text-shadow: rgba(0, 0, 0, 0.3) 2px 0px 3px; - margin-bottom: 10px; - // max-width added for transposition of long words - max-width: 470px; - word-wrap: break-word; - - @media @phone { - margin-top: 15px; - max-width: 280px; - font-size: 20px; - line-height: normal; - font-size: 18px; - } -} - -.ActivationsPage__greeting-description { - font-size: 14px; - color: #fff; - text-decoration: underline; - cursor: pointer; - - &:hover { - text-decoration: none; - } -} - -.ActivationPage__activation--sponsored { - display: flex; - flex-direction: column; - align-items: center; - width: 100%; -} - -.ActivationPage__score { - font-size: 38px; - color: @white-darker; - text-shadow: rgba(0, 0, 0, 0.3) 2px 0px 3px; - margin: 16px 0; - - @media @phone { - display: none; - } -} - -.ActivationPage__points, .ActivationPage__survey-statistics { - font-size: 12px; - text-shadow: rgba(0, 0, 0, 0.3) 2px 0px 3px; - color: @white-darker; - - @media @phone { - display: none; - } -} - -.ActivationPage__points--mobile { - font-size: 12px; - text-shadow: rgba(0, 0, 0, 0.3) 2px 0px 3px; - color: @white-darker; - display: none; - - @media @phone { - display: block; - margin-top: 10px; - } -} - -.ActivationPage__overlay { - background-color: rgba(0,0,0,0.1); -} - -.ActivationPage__result-share-btn { - background-color: @green-app; - color: @white-darker; - display: block; - margin: 6px auto; - - &:hover { - background-color: @green-app; - } -} - -.ActivationPage__result-share-btn--mobile { - display: none; - - @media @phone { - display: block; - background-color: @green-app; - color: @white-darker; - margin: 0px auto; - margin-top: 19px; - - &:hover { - background-color: @green-app; - } - } -} - -.ActivationPage__result-answers-btn { - margin: 6px auto; - color: @white-darker; - display: block; -} - -.ActivationPage__result-answers-btn--mobile { - margin: 6px auto; - color: @white-darker; - display: none; - - @media @phone { - display: block; - } -} - -.ActivationPage__fill-profile-btn { - margin: 6px auto; - color: @white-darker; - background-color: rgba(255, 255, 255, 0.05); - display: block; -} - -.ActivationPage__results-text { - flex: 1; - padding: 30px; - - @media @phone { - padding: 10px 30px; - } -} - -.ActivationPage__results-actions { - flex: 0.5; - display: flex; - justify-content: center; - flex-direction: column; - margin-top: 30px; - - @media @phone { - display: none; - margin-left: 0px; - } -} - -.ActivationPage__overlay { - position: absolute; - width: 100%; - height: 100%; - top: 0; - left: 0; - align-items: center; - display: flex; - - @media @phone { - flex-direction: column; - } -} - -.ActivationPage__tip { - font-size: 12px; - color: @white-dark; - margin: 0 auto; - text-align: center; -} - -.ActivationPage__results-container { - position: relative; - width: 100%; - min-height: 200px; - background-position: center; - background-size: cover; - - &.verybad { - background-image: url('/static/images/resultBackgrounds/verybad.png'); - } - - &.bad { - background-image: url('/static/images/resultBackgrounds/bad.png'); - } - - &.normal { - background-image: url('/static/images/resultBackgrounds/normal.png'); - } - - &.good { - background-image: url('/static/images/resultBackgrounds/good.png'); - } - - &.excellent { - background-image: url('/static/images/resultBackgrounds/excellent.png'); - } - - @media @phone { - min-height: 535px; - text-align: center; - - &.survey { - min-height: 170px; - } - } -} - -.ActivationPage__subheader { - font-weight: bold; - align-self: flex-start; - margin: 32px 18px -8px 18px; -} - -.ActivationPage__author-activations-grid, -.ActivationPage__similar-activations-grid { - box-sizing: border-box; - width: 100%; - - .mdl-cell { - height: 100% !important; - } -} - -.ActivationPage__author-activations, -.ActivationPage__similar-activations { - width: 100%; -} - -.ActivationPage__telegram-link { - display: block; - font-size: 12px; - margin-top: 6px; - text-align: center; - color: @secondary-text-color; -} - -.ActivationPage__pass-btn-wrapper-passed { - margin: 0px auto; - - .ActivationPage__pass-btn { - background-color: @white-darker; - } - - .ActivationPage__number-of-tries { - color: @white-darker; - font-size: 12px; - margin-top: 6px; - text-align: center; - } - - @media @phone { - display: none; - } -} - -.ActivationPage__pass-btn-wrapper-passed--mobile { - display: none; - - @media @phone { - background-color: @white-darker; - flex: 1; - display: flex; - justify-content: center; - flex-direction: column; - width: 200px; - margin: 0px auto; - margin-top: 10px; - } -} - -.ActivationPage__activation--sponsored { - - .ActivationPage__pass-btn { - margin-right: 10px; - background-color: @green-50 !important; - color: @green-700 !important; - - @media @phone { - order: 2; - margin-right: 0; - margin-top: 10px; - } - } -} - -.ActivationPage__proposed-activations { - background-color: rgba(0, 0, 0, 0); - position: fixed; - right: 0px; - top: 50%; - transform: translateY(-50%); - display: flex; - flex-direction: column; - width: 150px; - height: 420px; - z-index: 2; - justify-content: space-between; - transition: right 0.3s ease-in-out; - right: -150px; - - - &--hidden { - &:extend(.ActivationPage__proposed-activations all); - } - - &--visible { - &:extend(.ActivationPage__proposed-activations all); - right: 0px; - } - - @media @phone { - display: none; - } - - .ActivationPage__proposed-activation { - .QuizTile { - height: 100%; - } - } -} - -.ActivationPage__author-activations-spinner { - display: block; - margin: 10px auto 0; -} - -.ActivationPage__load-more-btn { - color: #fff !important; - background-color: @accent-1-color !important; - margin: 10px auto 0; - display: block; -} - -.ActivationPage__advertisement-wrapper { - padding: 10px; - background: #d8f9ff; - font-size: 14px; - - a { - cursor: pointer; - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationsPage.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationsPage.jsx deleted file mode 100644 index 8b233aa..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationsPage.jsx +++ /dev/null @@ -1,296 +0,0 @@ -import React from 'react'; -import cx from 'classnames'; - -import { Tab, Tabs } from 'react-mdl/lib/Tabs'; -import ReactList from 'react-list'; -import { Card } from 'react-mdl/lib/Card'; -import Spinner from 'react-mdl/lib/Spinner'; -import Button from 'react-mdl/lib/Button'; - -import QuizCard from '../QuizCard.jsx'; -import AppBar from '../AppBar.jsx'; -import ShareDialog from '../../containers/ShareDialog.jsx'; -import LoginDialog from '../../containers/LoginDialog.jsx'; -import Icon from '../Icon.jsx'; - -import './ActivationsPage.less'; - -const CATEGORIES = ['ALL', 'VACANCY', 'EDUCATION', 'ENTERTAINMENT', 'SPECIAL']; - -export default class ActivationsPage extends React.Component { - static propTypes = { - activations : React.PropTypes.arrayOf(React.PropTypes.object), - search : React.PropTypes.string, - totalActivationsAmount : React.PropTypes.number, - sortType : React.PropTypes.string, - selectedCategory : React.PropTypes.string, - linkToShare : React.PropTypes.string, - isLoading : React.PropTypes.bool, - isEmpty : React.PropTypes.bool, - isSharing : React.PropTypes.bool, - isEmbedded : React.PropTypes.bool, - isLoggingIn : React.PropTypes.bool, - onSearch : React.PropTypes.func, - onSpecialsSubscribe : React.PropTypes.func, - onChangeSortType : React.PropTypes.func, - onTabChange : React.PropTypes.func, - onLoginClose : React.PropTypes.func, - onStopSharing : React.PropTypes.func, - onItemClick : React.PropTypes.func, - onSubscribe : React.PropTypes.func, - onShare : React.PropTypes.func, - onItemRenderRequest : React.PropTypes.func, - onAuthorAvatarClick : React.PropTypes.func - }; - - static contextTypes = { i18n: React.PropTypes.object }; - - handleTabClick = (index, e) => { - e.preventDefault(); - - this.props.onTabChange(CATEGORIES[index]); - }; - - renderQuizItem = (index, key) => { - const { - activations, - onShare, - onItemClick, - onAuthorAvatarClick, - onItemRenderRequest - } = this.props; - - const activation = activations[index]; - - const isSurvey = activation.accountQuizSession ? activation.accountQuizSession.maxPoints === 0 : false; - - onItemRenderRequest(index); - - if (!activation) { - return ( - - - - ); - } - - return ( - - ); - }; - - renderQuizItemsGrid = (items, ref) => { - return ( -
-
- {items} -
-
- ); - }; - - renderContent = () => { - const { l } = this.context.i18n; - - const { - activations, - totalActivationsAmount, - search, - isLoading, - isEmpty - } = this.props; - - if (isLoading) { - return ; - } - - if (isEmpty && search) { - return ( -
- {l('Sorry, we couldn\'t find any tests for ')} {search} -
- ); - } - - if (isEmpty) { - return ( -
- {l('There are no activations in this category yet')} -
- ); - } - - return ( -
- - - { - activations.length < totalActivationsAmount - ?
- -
- : null - } -
- ); - }; - - render() { - const { - search, - sortType, - selectedCategory, - isSharing, - isEmbedded, - isLoggingIn, - isLoading, - linkToShare, - onSearch, - onSpecialsSubscribe, - onChangeSortType, - onLoginClose, - onStopSharing - } = this.props; - - const { l } = this.context.i18n; - - const classes = cx('ActivationsPage', { - 'ActivationsPage--embedded' : isEmbedded, - 'ActivationsPage--loading' : isLoading - }); - - return ( -
- - - - -
- - -
-
- - - {l('All tests')} - - - - {l('Vacancies')} - - - - {l('Education')} - - - - {l('Entertainment')} - - - - {l('Special offer')} - - - - -
-
-
- -
- { - selectedCategory === 'SPECIAL' && !isEmbedded - ? - - : - null - - } - - {this.renderContent()} -
-
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationsPage.less b/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationsPage.less deleted file mode 100644 index 429d208..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/ActivationsPage.less +++ /dev/null @@ -1,251 +0,0 @@ -@import "../../assets/palette.less"; -@import "../../assets/media.less"; - -.ActivationsPage { - background-color: @background-color; - width: 100%; - overflow: hidden; - box-sizing: border-box; - display: flex; - flex-direction: column; - - .ActivationsPage__toolbar-container { - height: 48px; - background-color: @primary-1-color; - display: flex; - justify-content: center; - - @media @phone { - width: 100%; - overflow: auto; - - .mdl-tabs { - width: 500px; - } - - &::-webkit-scrollbar { - display: none; - } - } - - .mdl-tabs { - width: auto; - } - - .mdl-tabs__tab-bar { - width: auto; - justify-content: center; - border-bottom: none; - } - - .mdl-tabs__tab { - color: @white-dark; - font-weight: regular; - font-size: 14px; - - &::after { - background: @accent-1-color; - } - - &.is-active { - color: @white-darker; - } - - .mdl-ripple { - background: white; - } - } - - .mdl-tabs__tab.is-active::after { - background: @accent-1-color; - } - } - - .ActivationsPage__toolbar { - display: flex; - padding-left: 50px; - padding-right: 50px; - width: 100%; - max-width: 1300px; - box-sizing: border-box; - justify-content: center; - } -} - -.ActivationsPage__header { - box-shadow: 0 3px 4px 0 rgba(0,0,0,.14),0 3px 3px -2px rgba(0,0,0,.2),0 1px 8px 0 rgba(0,0,0,.12); - position: fixed; - z-index: 999; - width: 100%; - top: 0; -} - -.ActivationsPage__content { - margin-top: 120px; - margin-bottom: 120px; - width: 100%; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; -} - -.ActivationsPage__empty-state { - font-size: 20px; - text-align: center; - max-width: 500px; - line-height: 30px; - color: @additional-text-color; - margin-top: 50px; - font-weight: 300; -} - -.ActivationsPage__special-tab { - background-color: rgba(0, 0, 0, 0); - - // temporary hide special-tab - display: none; -} - -.ActivationsPage__tab-text { - @media @phone { - display: none; - } -} - -.ActivationsPage__tab-icon { - display: none; - font-size: 18px; - - @media @phone { - display: inline-block; - } -} - -.ActivationsPage__list { - width: 100%; - max-width: 1200px; - margin: 0 auto; -} - -.ActivationsPage__spinner { - margin: 10px; -} - -.ActivationsPage__subscribe-btn { - background-color: @accent-1-color !important; - color: white !important; - margin-top: 8px; -} - -.ActivationsPage--embedded { - width: 100%; - - .ActivationsPage__app-bar { - display: none; - } - - .ActivationPage__select { - color: @accent-1-color; - } - - .ActivationsPage__toolbar-container { - background-color: @white-darker; - top: 0; - - .mdl-tabs__tab { - color: @black-dark; - font-weight: medium; - font-size: 14px; - - &.is-active { - color: @black-darker; - } - } - } - - .ActivationsPage__content { - margin-top: 60px; - margin-bottom: 60px; - } -} - -.ActivationsPage__grid-container { - display: flex; - flex-direction: column; - max-width: 1300px; - align-items: center; - justify-content: center; -} - -.ActivationsPage__grid { - display: flex; - flex-wrap: wrap; - width: 100%; - align-items: center; - justify-content: center; -} - -.ActivationsPage__grid-toolbar { - height: 50px; - display: flex; - justify-content: center; - align-items: center; - width: 100%; -} - -.ActivationPage__select { - background-color: transparent; - text-transform: uppercase; - cursor: pointer; - border: 0; - height: 49px; - font-size: 14px; - padding: 0 5px; - font-weight: 500; - text-overflow: ""; - color: @white-darker; - -webkit-appearance: none; - appearance: none; - margin: 0 10px; - - option { - color: black; - background-color: white; - } - - &:focus{ - outline: 0; - } - - &::-ms-expand { display: none; } - - @media @phone { - display: none; - font-size: 11px; - } -} - -.ActivationsPage__loading-next-spinner-container { - width: 100%; - margin-top: 70px; - display: flex; - justify-content: center; -} - -.ActivationsPage__quiz-card { - margin: 10px; - width: 300px; - height: 394px; -} - -.ActivationsPage__card-spinner { - margin: auto; -} - -.ActivationsPage__loading-card { - width: 300px; - height: 393px; - margin: 10px; - display: flex; -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/BasicSharePage.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/pages/BasicSharePage.jsx deleted file mode 100644 index 7fc585f..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/BasicSharePage.jsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from 'react'; - -export default class BasicSharePage extends React.Component { - static propTypes = { - title : React.PropTypes.string, - picture : React.PropTypes.string, - text : React.PropTypes.string - }; - - render() { - const { - title, - picture, - text - } = this.props; - - return ( -
-

{title}

- -

{text}

-
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/PromoPage.jsx b/parser_setup/__tests__/itsquiz-wall/shared/components/pages/PromoPage.jsx deleted file mode 100644 index 0e08312..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/PromoPage.jsx +++ /dev/null @@ -1,31 +0,0 @@ -import React from 'react'; - -import { Card } from 'react-mdl/lib/Card'; - -import Markdown from '../Markdown.jsx'; - -import './PromoPage.less'; - -export default class PromoPage extends React.Component { - static propTypes = { - title : React.PropTypes.string, - picture : React.PropTypes.string, - text : React.PropTypes.string - }; - - render() { - const { - picture, - text - } = this.props; - - return ( -
- - - - -
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/PromoPage.less b/parser_setup/__tests__/itsquiz-wall/shared/components/pages/PromoPage.less deleted file mode 100644 index 33eabc3..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/components/pages/PromoPage.less +++ /dev/null @@ -1,17 +0,0 @@ -.PromoPage { -} - -.PromoPage__head { - width: 100%; -} - -.PromoPage__content { - background-color: #ffffff; - padding-left: 24px; - padding-right: 24px; - width: 100%; - height: 100%; - max-width: 800px; - margin: 0 auto; - margin-top: 20px; -} \ No newline at end of file diff --git a/parser_setup/__tests__/itsquiz-wall/shared/config.js b/parser_setup/__tests__/itsquiz-wall/shared/config.js deleted file mode 100644 index ef002d8..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/config.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - eslint - import/no-commonjs: 0 - import/no-unresolved: 0 -*/ - -if (process.env.BROWSER) { - module.exports = window.__CONFIG__; -} else { - const confme = require('confme'); - const path = require('path'); - - const config = confme(path.join(__dirname, '../etc/client-config.json')); - - module.exports = config; -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/containers/App.jsx b/parser_setup/__tests__/itsquiz-wall/shared/containers/App.jsx deleted file mode 100644 index bafb9de..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/containers/App.jsx +++ /dev/null @@ -1,154 +0,0 @@ -import React, { Component, PropTypes } from 'react'; - -import EmbedEvents from '../utils/EmbedEventsUtil'; -import config from '../config'; -import { initialize, navigate } from '../utils/googleAnalytics'; -import isIOSDevice from '../utils/isIOSDevice'; - -if (process.env.BROWSER) { - require('../assets'); -} - -const TIMER_DELAY = 1000; - -const embedEvents = new EmbedEvents({ - embedOrigin: config.embedOrigin -}); - -export default class App extends Component { - static propTypes = { - location : PropTypes.object, - routes : PropTypes.array, - children : PropTypes.object, - history : PropTypes.object - }; - - componentWillMount() { - this.appContainerHeight = 0; - - clearInterval(this.iframeHeightCalcTimer); - } - - componentDidMount() { - initialize(); - const routes = this.props.routes; - - navigate({ - page : this.props.location.pathname, - title : routes[routes.length - 1].path - }); - - embedEvents.subscribe({ - 'REDIRECT_QUIZ_WALL' : this.handleRedirect - }); - - if (isIOSDevice()) { - this.appContainerHeight = this.getContainerHeight(); - - this.sendIframeHeightEvent(this.appContainerHeight); - } - } - - componentWillReceiveProps(nextProps) { - const currentLocation = this.props.location; - const nextLocation = nextProps.location; - - const isEmbed = Boolean(currentLocation.query.embed); - - const isPathnameChanged = currentLocation.pathname !== nextLocation.pathname; - const isQueryChanged = currentLocation.query !== nextLocation.query; - - if (isPathnameChanged) { - navigate({ - page : nextLocation.pathname, - title : nextProps.routes[nextProps.routes.length - 1].path - }); - - this.sendIframeHeightEvent(); - } - - if (isEmbed && (isPathnameChanged || isQueryChanged)) { - const pathname = nextLocation.pathname; - const { category, search, sortType } = nextLocation.query; - - const query = {}; - - if (category) { - query.category = category; - } - - if (search) { - query.search = search; - } - - if (sortType) { - query.sortType = sortType; - } - - const quizWallEmbedPath = this.props.history.createHref(pathname, query); - - embedEvents.send({ - type : 'PATH_CHANGED', - quizWallEmbedPath - }); - } - } - - componentDidUpdate() { - if (isIOSDevice()) { - const nextHeightOfAppContainer = this.getContainerHeight(); - - if (nextHeightOfAppContainer !== this.appContainerHeight) { - this.sendIframeHeightEvent(nextHeightOfAppContainer); - - this.appContainerHeight = nextHeightOfAppContainer; - } else { - this.iframeHeightCalcTimer = setTimeout(() => { - const newHeightOfAppContainer = this.getContainerHeight(); - - this.sendIframeHeightEvent(newHeightOfAppContainer); - - this.appContainerHeight = newHeightOfAppContainer; - }, TIMER_DELAY); - } - } - } - - componentWillUnmount() { - this.appContainerHeight = null; - } - - handleRedirect = () => { - const { query } = this.props.location; - - const newState = { - embed : query.embed, - assigneeId : query.assigneeId - }; - - if (query.search) { - newState.search = query.search; - } - - this.props.history.pushState(null, '/activations', newState); - }; - - getContainerHeight = () => { - return document.getElementById('app-view').scrollHeight; - }; - - sendIframeHeightEvent = (height = 0) => { - embedEvents.send({ - type : 'IFRAME_HEIGHT_CALCULATED', - iframeHeight : height - }); - } - - render() { - return ( -
- {this.props.children} -
- ); - } -} diff --git a/parser_setup/__tests__/itsquiz-wall/shared/containers/Footer.jsx b/parser_setup/__tests__/itsquiz-wall/shared/containers/Footer.jsx deleted file mode 100644 index dab4d03..0000000 --- a/parser_setup/__tests__/itsquiz-wall/shared/containers/Footer.jsx +++ /dev/null @@ -1,66 +0,0 @@ -import React, { Component, PropTypes } from 'react'; -import strformat from 'strformat'; - -import Footer from '../components/Footer.jsx'; - -import { footerLinks, quizwallShareLink } from '../config'; - -import { sendEvent } from '../utils/googleAnalytics'; - -export default class FooterContainer extends Component { - static contextTypes = { i18n: PropTypes.object }; - - state = { - showShareDialog: false - }; - - componentWillMount() { - const { getLocale } = this.context.i18n; - - this.links = {}; - - for (const linkType in footerLinks) { - if ({}.hasOwnProperty.call(footerLinks, linkType)) { - this.links[linkType] = strformat(footerLinks[linkType], { - lang: getLocale() - }); - } - } - - this.linkToShare = quizwallShareLink; - } - - handleLinkClick = (type) => { - sendEvent('footer', 'click', type); - }; - - handleShare = () => { - this.setState({ showShareDialog: true }); - sendEvent('footer', 'share'); - }; - - handleShareClose = () => { - this.setState({ showShareDialog: false }); - }; - - openLinkInPopup = (URL) => { - window.open(URL, '', 'width=500, height=500'); - }; - - openLinkInNewTab = (URL) => { - window.open(URL, '_blank'); - }; - - render() { - return ( -