From 10582c0c3ae7163c6b597dc9c681fa5f8f8167ef Mon Sep 17 00:00:00 2001 From: Slava Kovalenko Date: Thu, 14 Apr 2016 15:07:09 +0600 Subject: [PATCH 1/8] fix #19: quiz editor via mocked data --- lib/ui/Input/Input.jsx | 1 + lib/ui/Switch/Switch.jsx | 10 +- package.json | 7 +- .../components/AdminEditor/AdminEditor.json | 28 -- .../components/AdminEditor/AdminEditor.jsx | 327 +++++++++++------- .../components/AdminEditor/AdminEditor.sass | 12 +- src/admin/components/AdminEditor/Answer.jsx | 2 +- src/admin/components/AdminEditor/Answer.sass | 54 +-- src/admin/components/AdminEditor/Editor.json | 30 ++ src/admin/components/AdminEditor/Editor.jsx | 185 ++++++++++ src/admin/components/AdminEditor/Question.jsx | 51 ++- .../components/AdminEditor/Question.sass | 36 +- .../components/AdminEditor/QuestionsList.json | 14 + .../components/AdminEditor/QuestionsList.jsx | 70 ++++ 14 files changed, 631 insertions(+), 196 deletions(-) create mode 100644 src/admin/components/AdminEditor/Editor.json create mode 100644 src/admin/components/AdminEditor/Editor.jsx create mode 100644 src/admin/components/AdminEditor/QuestionsList.json create mode 100644 src/admin/components/AdminEditor/QuestionsList.jsx diff --git a/lib/ui/Input/Input.jsx b/lib/ui/Input/Input.jsx index 8f91be8..a50966e 100644 --- a/lib/ui/Input/Input.jsx +++ b/lib/ui/Input/Input.jsx @@ -12,6 +12,7 @@ class Input extends Component { type: PropTypes.string.isRequired, placeholder: PropTypes.string, value: PropTypes.string, + focus: PropTypes.bool, lg: PropTypes.bool, sm: PropTypes.bool, inline: PropTypes.bool, diff --git a/lib/ui/Switch/Switch.jsx b/lib/ui/Switch/Switch.jsx index b65336e..57187b6 100644 --- a/lib/ui/Switch/Switch.jsx +++ b/lib/ui/Switch/Switch.jsx @@ -19,18 +19,12 @@ class Switch extends Component { name: '', } - state = { - active: this.props.active, - } - toggle = () => { - this.props.onChange(this.props.name, !this.state.active); - this.setState({active: !this.state.active}); + this.props.onChange(this.props.name, !this.props.active); } render() { - const { active } = this.state; - const { label } = this.props; + const { label, active } = this.props; const styleNames = cx({ switcher: true, diff --git a/package.json b/package.json index 3e72897..5f84907 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "moment": "^2.12.0", "mongoose": "^4.4.10", "morgan": "^1.7.0", + "object-hash": "^1.1.2", "postcss-alias": "^0.2.2", "postcss-autoreset": "^1.1.5", "postcss-center": "^1.0.0", @@ -52,10 +53,12 @@ "postcss-reporter": "^1.3.3", "postcss-size": "^1.0.0", "precss": "^1.4.0", - "react": "^0.14.8", + "react": "^15.0.1", + "react-addons-css-transition-group": "^15.0.1", "react-css-modules": "^3.7.6", - "react-dom": "^0.14.8", + "react-dom": "^15.0.1", "react-intl": "^2.0.0-rc-1", + "react-motion": "^0.4.2", "react-router": "^2.0.1", "style-loader": "^0.13.1", "sugarss": "^0.1.2", diff --git a/src/admin/components/AdminEditor/AdminEditor.json b/src/admin/components/AdminEditor/AdminEditor.json index 5b95942..3c9467d 100644 --- a/src/admin/components/AdminEditor/AdminEditor.json +++ b/src/admin/components/AdminEditor/AdminEditor.json @@ -1,16 +1,4 @@ [ - { - "id": "Your question...", - "defaultMessage": "Your question..." - }, - { - "id": "Some additional info or comments (optional)", - "defaultMessage": "Some additional info or comments (optional)" - }, - { - "id": "An answer var", - "defaultMessage": "An answer var" - }, { "id": "Quiz questions", "defaultMessage": "Quiz questions" @@ -18,21 +6,5 @@ { "id": "Add another question", "defaultMessage": "Add another question" - }, - { - "id": "Type: One of many", - "defaultMessage": "Type: One of many" - }, - { - "id": "Show question to the client", - "defaultMessage": "Show question to the client" - }, - { - "id": "Answers", - "defaultMessage": "Answers" - }, - { - "id": "Add answer", - "defaultMessage": "Add answer" } ] \ No newline at end of file diff --git a/src/admin/components/AdminEditor/AdminEditor.jsx b/src/admin/components/AdminEditor/AdminEditor.jsx index 2163067..174360f 100644 --- a/src/admin/components/AdminEditor/AdminEditor.jsx +++ b/src/admin/components/AdminEditor/AdminEditor.jsx @@ -1,137 +1,108 @@ import React, { Component } from 'react'; import css from 'react-css-modules'; -import { FormattedMessage, intlShape, injectIntl, defineMessages } from 'react-intl'; import styles from './AdminEditor.sass'; -import { Card, Btn, Input, Icon, Textarea, Switch, Space } from 'ui'; +import { Card } from 'ui'; -import Question from './Question'; -import Answer from './Answer'; - -const messages = defineMessages({ - titlePlaceholder: { - id: 'Your question...', - defaultMessage: 'Your question...', - }, - textareaPlaceholder: { - id: 'Some additional info or comments (optional)', - defaultMessage: 'Some additional info or comments (optional)', - }, - answerPlaceholder: { - id: 'An answer var', - defaultMessage: 'An answer var', - }, -}); +import Editor from './Editor'; +import QuestionsList from './QuestionsList'; class AdminEditor extends Component { + state = { + questions: questionsMok, + selectedQuestionId: null, + } + + viewQuestionDetails = (id) => { + this.setState({selectedQuestionId: id}); + } + + updateQuestion = (object) => { + const { questions } = this.state; + const currentPosition = questions.map(q => q.id).indexOf(object.id); + if (currentPosition !== -1) { + // mock + questions.splice(currentPosition, 1); + questions.splice(currentPosition, 0, object); + this.setState({questions: questions}); + } + } + + addQuestion = () => { + const { questions } = this.state; + // mock + const newId = Math.random() * 1000; + questions.push({ + id: newId, + title: '', + subtitle: '', + type: 'QuestionStars', + isVisible: true, + options: [], + }); + this.setState({ + questions: questions, + selectedQuestionId: newId, + }); + } + + switchQuestionsIndex = (direction, id) => { + const { questions } = this.state; + let indexA = 0; + let indexB = 0; - static propTypes = { - intl: intlShape.isRequired, + const currentPosition = questions.map(q => q.id).indexOf(id); + if (currentPosition !== -1) { + switch (direction) { + case 'up': + if (currentPosition > 0) { + indexA = currentPosition; + indexB = currentPosition - 1; + } + break; + default: + if (currentPosition < questions.length - 1) { + indexA = currentPosition; + indexB = currentPosition + 1; + } + } + } + + // mock + const copyQuestions = questions.slice(0); + const indexAelem = questions.slice(indexA)[0]; + copyQuestions.splice(indexA, 1); + copyQuestions.splice(indexB, 0, indexAelem); + this.setState({questions: copyQuestions}); } render() { - const {formatMessage} = this.props.intl; + const { selectedQuestionId } = this.state; + const questions = this.state.questions.map(q => { + return ( + { + ...q, + isActive: selectedQuestionId && q.id === selectedQuestionId ? true : false, + } + ); + }); return ( -
-

- + -

- - - - - } - outline - icon="playlist_add" /> -
-
-
- - - - -
- false} - lg - /> - - false} - label={ - - } +
+ q.id === selectedQuestionId)[0]} + updateQuestion={this.updateQuestion} /> -
-
- -
-
- false} - onDelete={() => false} - onMoveup={() => false} - onMovedown={() => false} - name="answer" - placeholder={formatMessage(messages.answerPlaceholder)} - /> - false} - onDelete={() => false} - onMoveup={() => false} - onMovedown={() => false} - name="answer" - placeholder={formatMessage(messages.answerPlaceholder)} - /> - false} - onDelete={() => false} - onMoveup={() => false} - onMovedown={() => false} - name="answer" - placeholder={formatMessage(messages.answerPlaceholder)} - /> -
- } - outline - sm - icon="playlist_add" />
@@ -139,4 +110,126 @@ class AdminEditor extends Component { } } -export default injectIntl(css(AdminEditor, styles, {allowMultiple: true})); +const questionsMok = [ + { + id: 1, + title: 'Оцените пиццерию «Maya pizza»', + subtitle: 'Че?', + type: 'QuestionStars', + isVisible: true, + options: [ + 'Ужас', + 'Плохо', + 'Пойдёт', + 'Хорошо', + 'Отлично!', + ], + }, + { + id: 2, + title: 'В какой «Майе» вы сегодня были?', + subtitle: '', + type: 'QuestionOneOfMany', + isVisible: true, + options: [ + 'На Иркустком 42', + 'На Ленина 85а', + ], + + }, + { + id: 3, + title: 'Как сегодня дела со скоростью обслуживания?', + subtitle: '', + type: 'QuestionOneOfMany', + isVisible: true, + options: [ + 'все очень оперативно', + 'можно и побыстрее', + 'так себе, совсем небыстро', + 'устали ждать', + ], + + }, + { + id: 4, + title: 'А как оценим работу и дружелюбность наших кассиров?', + subtitle: '', + type: 'QuestionOneOfMany', + isVisible: true, + options: [ + 'великолепно', + 'хорошо, как обычно', + 'без энтузиазма', + 'невнимание, грубость, игнор', + ], + + }, + { + id: 5, + title: 'Как вы оцените чистоту и порядок на месте?', + subtitle: '', + type: 'QuestionOneOfMany', + isVisible: false, + options: [ + 'все блестит и сверкает', + 'в целом чисто, но не идеально', + 'неопрятно, много замечаний', + 'полный бардак', + ], + + }, + { + id: 6, + title: 'А как вам внешний вид нашего кассира?', + subtitle: '', + type: 'QuestionOneOfMany', + isVisible: true, + options: [ + 'красотка/красавец!', + 'нормально', + 'неряшливый', + 'отталкивающий', + ], + + }, + { + id: 7, + title: 'Довольны ли вы качеством наших блюд?', + subtitle: '', + type: 'QuestionOneOfMany', + isVisible: true, + options: [ + 'супер!', + 'хорошо', + 'средненько, бывало и лучше', + 'плохо, я недоволен', + ], + + }, + { + id: 8, + title: 'Хотите что-то добавить к ответам?', + subtitle: 'Нам это очень важно знать', + type: 'QuestionInputText', + isVisible: true, + options: [ + 'textarea', + ], + }, + { + id: 9, + title: 'Спасибо, что помогаете нам стать еще лучше!', + subtitle: 'Оставьте контакты, чтобы мы могли с вами связаться', + type: 'QuestionInputText', + isVisible: true, + options: [ + 'Имя', + 'E-mail', + 'Телефон', + ], + }, +]; + + +export default css(AdminEditor, styles, {allowMultiple: true}); diff --git a/src/admin/components/AdminEditor/AdminEditor.sass b/src/admin/components/AdminEditor/AdminEditor.sass index 4f6201a..9804c9d 100644 --- a/src/admin/components/AdminEditor/AdminEditor.sass +++ b/src/admin/components/AdminEditor/AdminEditor.sass @@ -7,10 +7,14 @@ position: relative padding: calc($h + $nav-height) $h $h -.questions +.left-column, +.right-column lost-column: 1/2 2 + +.left-column border-right: 1px solid $gray-lighter min-height: 600px - -.editor - lost-column: 1/2 2 + +.editor, +.questions + position: relative diff --git a/src/admin/components/AdminEditor/Answer.jsx b/src/admin/components/AdminEditor/Answer.jsx index 8c010f5..b19e955 100644 --- a/src/admin/components/AdminEditor/Answer.jsx +++ b/src/admin/components/AdminEditor/Answer.jsx @@ -29,7 +29,7 @@ class Answer extends Component { value={value} /> - +
); diff --git a/src/admin/components/AdminEditor/Answer.sass b/src/admin/components/AdminEditor/Answer.sass index 33c51cd..32a7e00 100644 --- a/src/admin/components/AdminEditor/Answer.sass +++ b/src/admin/components/AdminEditor/Answer.sass @@ -2,44 +2,36 @@ .answer position: relative + border-radius: $border-radius-base + + &:hover + background: rgba(30,30,30,.05) + z-index: 2 + cursor: pointer + box-shadow: 0 1px 5px -2px rgba(30,30,30,.35) .delete position: absolute height: $h top: 50% margin-top: calc(-$h * .5) - right: calc($h * .5) + right: calc($h * .25) color: $gray transition: color .25s + cursor: pointer + &:hover color: $brand-danger - .up, - .down - display: block - position: absolute - right: $h - size: $h - text-align: center - line-height: $h - opacity: 0 - background: $gray-light - border-radius: 50% - - .down - bottom: calc(-$h * .5) - - .up - top: calc(-$h * .5) - - &:hover - background: rgba(30,30,30,.05) - .up, .down opacity: 1 + &:hover + background: $brand-primary + color: #fff + &:first-of-type .up display: none @@ -47,3 +39,21 @@ &:last-of-type .down display: none + +.up, +.down + display: block + position: absolute + right: $h + size: $h + text-align: center + line-height: $h + opacity: 0 + background: $gray-light + border-radius: 50% + +.down + bottom: calc(-$h * .5) + +.up + top: calc(-$h * .5) diff --git a/src/admin/components/AdminEditor/Editor.json b/src/admin/components/AdminEditor/Editor.json new file mode 100644 index 0000000..1959d12 --- /dev/null +++ b/src/admin/components/AdminEditor/Editor.json @@ -0,0 +1,30 @@ +[ + { + "id": "Type: One of many", + "defaultMessage": "Type: One of many" + }, + { + "id": "Answers", + "defaultMessage": "Answers" + }, + { + "id": "Your question...", + "defaultMessage": "Your question..." + }, + { + "id": "Some additional info or comments (optional)", + "defaultMessage": "Some additional info or comments (optional)" + }, + { + "id": "Show question to the client", + "defaultMessage": "Show question to the client" + }, + { + "id": "An answer var", + "defaultMessage": "An answer var" + }, + { + "id": "Add answer", + "defaultMessage": "Add answer" + } +] \ No newline at end of file diff --git a/src/admin/components/AdminEditor/Editor.jsx b/src/admin/components/AdminEditor/Editor.jsx new file mode 100644 index 0000000..e2bb826 --- /dev/null +++ b/src/admin/components/AdminEditor/Editor.jsx @@ -0,0 +1,185 @@ +import React, { Component, PropTypes } from 'react'; +import css from 'react-css-modules'; +import { intlShape, injectIntl, defineMessages } from 'react-intl'; +import { Motion, spring } from 'react-motion'; + +import { Btn, Input, Icon, Textarea, Switch } from 'ui'; + +import styles from './AdminEditor.sass'; +import Answer from './Answer'; + +const messages = defineMessages({ + title: { + id: 'Type: One of many', + defaultMessage: 'Type: One of many', + }, + answersTitle: { + id: 'Answers', + defaultMessage: 'Answers', + }, + titlePlaceholder: { + id: 'Your question...', + defaultMessage: 'Your question...', + }, + textareaPlaceholder: { + id: 'Some additional info or comments (optional)', + defaultMessage: 'Some additional info or comments (optional)', + }, + switchTitle: { + id: 'Show question to the client', + defaultMessage: 'Show question to the client', + }, + answerPlaceholder: { + id: 'An answer var', + defaultMessage: 'An answer var', + }, + addButton: { + id: 'Add answer', + defaultMessage: 'Add answer', + }, +}); + +class Editor extends Component { + static propTypes = { + intl: intlShape.isRequired, + question: PropTypes.object, + updateQuestion: PropTypes.func.isRequired, + } + + static defaultProps = { + question: { + title: '', + subtitle: '', + type: '-', + isVisible: false, + options: [], + }, + updateQuestion: () => {}, + } + + handleChange = (param, value) => { + const { question, updateQuestion } = this.props; + let newParam = {}; + switch (param) { + case 'title': + newParam = {title: value}; + break; + case 'subtitle': + newParam = {subtitle: value}; + break; + case 'isVisible': + newParam = {isVisible: value}; + break; + case 'options': + newParam = {options: value}; + break; + default: + console.log('Unknown param'); + break; + } + updateQuestion({...question, ...newParam}); + } + + updateOptions = (index, action) => (_, value = '') => { + const { options } = this.props.question; + switch (action) { + case 'add': + options.push(''); + break; + case 'delete': + options.splice(index, 1); + break; + case 'edit': + options[index] = value; + break; + case 'moveup': + if (index !== 0) { + options.splice(index - 1, 0, options.splice(index, 1)[0]); + } + break; + case 'movedown': + if (index !== options.length - 1) { + options.splice(index + 1, 0, options.splice(index, 1)[0]); + } + break; + default: + console.log('Unknown action'); + break; + } + this.handleChange('options', options); + } + + render() { + const { formatMessage } = this.props.intl; + const { question } = this.props; + + if (question) { + return ( + + {({opacity}) => +
+
+ + + {formatMessage(messages.title)} + +
+ + + +
+
+ + {formatMessage(messages.answersTitle)} + +
+
+ {question.options.map((o, i) => + + )} +
+ +
+ } +
+ ); + } + } +} + +export default injectIntl(css(Editor, styles, {allowMultiple: true})); diff --git a/src/admin/components/AdminEditor/Question.jsx b/src/admin/components/AdminEditor/Question.jsx index f699487..03f4d51 100644 --- a/src/admin/components/AdminEditor/Question.jsx +++ b/src/admin/components/AdminEditor/Question.jsx @@ -1,18 +1,53 @@ -import React, { Component } from 'react'; +import React, { Component, PropTypes } from 'react'; import css from 'react-css-modules'; -import styles from './Question.sass'; +import cx from 'classnames'; +import styles from './Question.sass'; import { Circle, Icon } from 'ui'; class Question extends Component { + static propTypes = { + question: PropTypes.object.isRequired, + number: PropTypes.number.isRequired, + onMove: PropTypes.func, + onSelect: PropTypes.func, + } + + static defaultProps = { + question: { + id: 0, + title: '-', + type: '-', + isActive: false, + }, + number: 0, + onMove: () => {}, + onSelect: () => {}, + } + render() { + const { number, onMove, onSelect } = this.props; + const { title, id, isActive } = this.props.question; + + const styles = cx({ + question: true, + active: isActive, + }); + + const circle = isActive ? + + : + ; + return ( -
- 1 - - Довольны ли вы качеством наших блюд? - - +
+
onSelect(id)}> + {number} + {circle} + {title} +
+ onMove('up', id)}> + onMove('down', id)}>
); } diff --git a/src/admin/components/AdminEditor/Question.sass b/src/admin/components/AdminEditor/Question.sass index 75127e8..74d2cd2 100644 --- a/src/admin/components/AdminEditor/Question.sass +++ b/src/admin/components/AdminEditor/Question.sass @@ -2,17 +2,22 @@ .question position: relative - white-space: nowrap - padding: calc($h * .5) $h margin-left: -$h background: transparent transition: background .25s - .number - color: $gray + .content + cursor: pointer + white-space: nowrap + overflow: hidden + text-overflow: ellipsis + padding: calc($h * .5) $h - .title - font-size: calc($f * 1.25) + .number + color: $gray + + .title + font-size: calc($f * 1.25) .up, .down @@ -25,6 +30,12 @@ opacity: 0 background: $gray-light border-radius: 50% + transition: background .25s + cursor: pointer + + &:hover + background: $brand-primary + color: #fff .down bottom: calc(-$h * .5) @@ -34,6 +45,7 @@ &:hover background: rgba(30,30,30,.05) + z-index: 2 .up, .down @@ -46,3 +58,15 @@ &:last-of-type .down display: none + + +.active + background: $brand-primary + color: #fff + + &:hover + background: $brand-primary + + .up, + .down + color: $text-color diff --git a/src/admin/components/AdminEditor/QuestionsList.json b/src/admin/components/AdminEditor/QuestionsList.json new file mode 100644 index 0000000..64512c7 --- /dev/null +++ b/src/admin/components/AdminEditor/QuestionsList.json @@ -0,0 +1,14 @@ +[ + { + "id": "Quiz questions", + "defaultMessage": "Quiz questions" + }, + { + "id": "Add another question", + "defaultMessage": "Add another question" + }, + { + "id": "There are no questions in this quiz. Go ahead, add the first one.", + "defaultMessage": "There are no questions in this quiz. Go ahead, add the first one." + } +] \ No newline at end of file diff --git a/src/admin/components/AdminEditor/QuestionsList.jsx b/src/admin/components/AdminEditor/QuestionsList.jsx new file mode 100644 index 0000000..c9731b7 --- /dev/null +++ b/src/admin/components/AdminEditor/QuestionsList.jsx @@ -0,0 +1,70 @@ +import React, { Component, PropTypes } from 'react'; +import css from 'react-css-modules'; +import { intlShape, injectIntl, defineMessages } from 'react-intl'; + +import { Btn, Space } from 'ui'; +import Question from './Question'; +import styles from './AdminEditor.sass'; + +const messages = defineMessages({ + title: { + id: 'Quiz questions', + defaultMessage: 'Quiz questions', + }, + btnAddQuestion: { + id: 'Add another question', + defaultMessage: 'Add another question', + }, + emptyQuiz: { + id: 'There are no questions in this quiz. Go ahead, add the first one.', + defaultMessage: 'There are no questions in this quiz. Go ahead, add the first one.', + }, +}); + +class QuestionsList extends Component { + static propTypes = { + intl: intlShape.isRequired, + switchQuestionsIndex: PropTypes.func.isRequired, + viewQuestionDetails: PropTypes.func.isRequired, + addQuestion: PropTypes.func.isRequired, + questions: PropTypes.array, + } + + static defaultProps = { + questions: [], + switchQuestionsIndex: () => {}, + viewQuestionDetails: () => {}, + addQuestion: () => {}, + } + + render() { + const { formatMessage } = this.props.intl; + const { questions, viewQuestionDetails, switchQuestionsIndex, addQuestion } = this.props; + + return ( +
+

+ {formatMessage(messages.title)} +

+
+ { questions.length > 1 ? + questions.map((q, i) => + + ) + : +
{formatMessage(messages.emptyQuiz)}
+ } +
+ + +
+ ); + } +} + +export default injectIntl(css(QuestionsList, styles, {allowMultiple: true})); From e064a151fb70555458d4ec1bb1a5ad7e099fa261 Mon Sep 17 00:00:00 2001 From: Slava Kovalenko Date: Wed, 20 Apr 2016 23:50:03 +0600 Subject: [PATCH 2/8] fix var name --- src/admin/components/AdminEditor/AdminEditor.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/admin/components/AdminEditor/AdminEditor.jsx b/src/admin/components/AdminEditor/AdminEditor.jsx index 174360f..ff73b05 100644 --- a/src/admin/components/AdminEditor/AdminEditor.jsx +++ b/src/admin/components/AdminEditor/AdminEditor.jsx @@ -10,11 +10,11 @@ import QuestionsList from './QuestionsList'; class AdminEditor extends Component { state = { questions: questionsMok, - selectedQuestionId: null, + editingQuestionId: null, } viewQuestionDetails = (id) => { - this.setState({selectedQuestionId: id}); + this.setState({editingQuestionId: id}); } updateQuestion = (object) => { @@ -42,7 +42,7 @@ class AdminEditor extends Component { }); this.setState({ questions: questions, - selectedQuestionId: newId, + editingQuestionId: newId, }); } @@ -77,12 +77,12 @@ class AdminEditor extends Component { } render() { - const { selectedQuestionId } = this.state; + const { editingQuestionId } = this.state; const questions = this.state.questions.map(q => { return ( { ...q, - isActive: selectedQuestionId && q.id === selectedQuestionId ? true : false, + isActive: editingQuestionId && q.id === editingQuestionId ? true : false, } ); }); @@ -100,7 +100,7 @@ class AdminEditor extends Component {
q.id === selectedQuestionId)[0]} + question={editingQuestionId && questions.filter(q => q.id === editingQuestionId)[0]} updateQuestion={this.updateQuestion} />
From 414053be00240c33cae5545bb9feca20ad6d7823 Mon Sep 17 00:00:00 2001 From: Slava Kovalenko Date: Fri, 22 Apr 2016 01:23:04 +0600 Subject: [PATCH 3/8] sup --- lib/ui/Switch/Switch.sass | 11 +++- lib/ui/styles/variables.sass | 6 +- src/admin/components/Admin/Admin.jsx | 14 +++- .../components/AdminEditor/AdminEditor.jsx | 16 ++++- .../components/AdminEditor/AdminEditor.sass | 6 +- src/admin/components/AdminEditor/Editor.jsx | 2 +- .../components/AdminEditor/QuestionsList.jsx | 6 +- .../AdminStatistics/AdminStatistics.jsx | 65 +++++++++++++++++++ 8 files changed, 106 insertions(+), 20 deletions(-) diff --git a/lib/ui/Switch/Switch.sass b/lib/ui/Switch/Switch.sass index 631c3ff..b67e6bb 100644 --- a/lib/ui/Switch/Switch.sass +++ b/lib/ui/Switch/Switch.sass @@ -4,6 +4,7 @@ display: inline-block .switcher + cursor: pointer vertical-align: middle display: inline-block position: relative @@ -20,16 +21,20 @@ width: calc($h) height: @width border-radius: 50% - background: $gray-light + background: $gray box-shadow: 0 0 2px -1px rgba(30,30,30,.25) left: calc($component-border-width + 1px) top: calc($component-border-width + 1px) transition: all .25s right: auto + &:hover + border-color: $gray + background-color: $gray-lighter + &.active - border-color: $brand-success - background: $brand-success + border-color: $brand-success !important + background: $brand-success !important .round left: calc($h * 1.2 - $component-border-width - 3px) diff --git a/lib/ui/styles/variables.sass b/lib/ui/styles/variables.sass index 8cc7a87..c3cb18e 100644 --- a/lib/ui/styles/variables.sass +++ b/lib/ui/styles/variables.sass @@ -3,9 +3,9 @@ $gray-darkest: #263238 $gray-darker: #3A3F51 $gray-dark: #58666e -$gray: #E4EAEC -$gray-light: #D4D6D8 -$gray-lighter: #f9f9f9 +$gray: #D4D6D8 +$gray-light: #E4EAEC +$gray-lighter: #f5f5f5 $brand-primary: #677AE4 $brand-success: #46BE8A diff --git a/src/admin/components/Admin/Admin.jsx b/src/admin/components/Admin/Admin.jsx index ba78c09..1c537d3 100644 --- a/src/admin/components/Admin/Admin.jsx +++ b/src/admin/components/Admin/Admin.jsx @@ -1,7 +1,9 @@ import React, { Component, PropTypes } from 'react'; import cookies from 'cookies-js'; +import ReactCSSTransitionGroup from 'react-addons-css-transition-group'; import Navbar from '../Navbar/Navbar'; +import styles from './Admin.sass'; export default class Admin extends Component { @@ -19,6 +21,7 @@ export default class Admin extends Component { static propTypes = { children: PropTypes.any.isRequired, + location: PropTypes.any.isRequired, } getChildContext() { @@ -61,7 +64,16 @@ export default class Admin extends Component {
- {this.props.children} + + {React.cloneElement(this.props.children, { + key: this.props.location.pathname, + })} +
); diff --git a/src/admin/components/AdminEditor/AdminEditor.jsx b/src/admin/components/AdminEditor/AdminEditor.jsx index ff73b05..6b2feb6 100644 --- a/src/admin/components/AdminEditor/AdminEditor.jsx +++ b/src/admin/components/AdminEditor/AdminEditor.jsx @@ -6,11 +6,13 @@ import { Card } from 'ui'; import Editor from './Editor'; import QuestionsList from './QuestionsList'; +import SuggestToSave from './SuggestToSave'; class AdminEditor extends Component { state = { questions: questionsMok, editingQuestionId: null, + suggestToSave: false, } viewQuestionDetails = (id) => { @@ -24,7 +26,10 @@ class AdminEditor extends Component { // mock questions.splice(currentPosition, 1); questions.splice(currentPosition, 0, object); - this.setState({questions: questions}); + this.setState({ + questions: questions, + suggestToSave: true, + }); } } @@ -43,6 +48,7 @@ class AdminEditor extends Component { this.setState({ questions: questions, editingQuestionId: newId, + suggestToSave: true, }); } @@ -73,11 +79,14 @@ class AdminEditor extends Component { const indexAelem = questions.slice(indexA)[0]; copyQuestions.splice(indexA, 1); copyQuestions.splice(indexB, 0, indexAelem); - this.setState({questions: copyQuestions}); + this.setState({ + questions: copyQuestions, + suggestToSave: true, + }); } render() { - const { editingQuestionId } = this.state; + const { editingQuestionId, suggestToSave } = this.state; const questions = this.state.questions.map(q => { return ( { @@ -105,6 +114,7 @@ class AdminEditor extends Component { />
+ this.setState({suggestToSave: false})}/>
); } diff --git a/src/admin/components/AdminEditor/AdminEditor.sass b/src/admin/components/AdminEditor/AdminEditor.sass index 9804c9d..7549507 100644 --- a/src/admin/components/AdminEditor/AdminEditor.sass +++ b/src/admin/components/AdminEditor/AdminEditor.sass @@ -5,7 +5,7 @@ .content display: block position: relative - padding: calc($h + $nav-height) $h $h + padding: calc($h + $nav-height) $h calc($h + 60px) .left-column, .right-column @@ -14,7 +14,3 @@ .left-column border-right: 1px solid $gray-lighter min-height: 600px - -.editor, -.questions - position: relative diff --git a/src/admin/components/AdminEditor/Editor.jsx b/src/admin/components/AdminEditor/Editor.jsx index e2bb826..c0ff555 100644 --- a/src/admin/components/AdminEditor/Editor.jsx +++ b/src/admin/components/AdminEditor/Editor.jsx @@ -119,7 +119,7 @@ class Editor extends Component { defaultStyle={{opacity: 0}} style={{opacity: spring(1)}}> {({opacity}) => -
+
diff --git a/src/admin/components/AdminEditor/QuestionsList.jsx b/src/admin/components/AdminEditor/QuestionsList.jsx index c9731b7..ecafdcf 100644 --- a/src/admin/components/AdminEditor/QuestionsList.jsx +++ b/src/admin/components/AdminEditor/QuestionsList.jsx @@ -1,10 +1,8 @@ import React, { Component, PropTypes } from 'react'; -import css from 'react-css-modules'; import { intlShape, injectIntl, defineMessages } from 'react-intl'; import { Btn, Space } from 'ui'; import Question from './Question'; -import styles from './AdminEditor.sass'; const messages = defineMessages({ title: { @@ -42,7 +40,7 @@ class QuestionsList extends Component { const { questions, viewQuestionDetails, switchQuestionsIndex, addQuestion } = this.props; return ( -
+

{formatMessage(messages.title)}

@@ -67,4 +65,4 @@ class QuestionsList extends Component { } } -export default injectIntl(css(QuestionsList, styles, {allowMultiple: true})); +export default injectIntl(QuestionsList); diff --git a/src/admin/components/AdminStatistics/AdminStatistics.jsx b/src/admin/components/AdminStatistics/AdminStatistics.jsx index 10f64fa..fab33eb 100644 --- a/src/admin/components/AdminStatistics/AdminStatistics.jsx +++ b/src/admin/components/AdminStatistics/AdminStatistics.jsx @@ -35,3 +35,68 @@ class AdminStatistics extends Component { } } export default css(AdminStatistics, styles, {allowMultiple: true}); + +const feedbackMok = [ + { + id: 'f1', + customer: { + id: 'c1', + email: '', + phone: '89234553434', + }, + answers: [ + { + question: { + title: 'Как сегодня дела со скоростью обслуживания?', + subtitle: '', + type: 'QuestionOneOfMany', + }, + answer: 'все очень оперативно', + }, + { + question: { + title: 'А как оценим работу и дружелюбность наших кассиров?', + subtitle: '', + type: 'QuestionOneOfMany', + }, + answer: 'без энтузиазма', + }, + { + question: { + title: 'Как вы оцените чистоту и порядок на месте?', + subtitle: '', + type: 'QuestionOneOfMany', + }, + answer: 'все блестит и сверкает', + }, + ], + createdAt: 'Fri Apr 22 2016 00:44:13 GMT+0600 (NOVT)', + }, + { + id: 'f2', + customer: { + id: 'c2', + email: '', + phone: '89234553435', + }, + answers: [ + { + question: { + title: 'Как сегодня дела со скоростью обслуживания?', + subtitle: '', + type: 'QuestionOneOfMany', + }, + answer: 'можно и побыстрее', + }, + { + question: { + title: 'А как оценим работу и дружелюбность наших кассиров?', + subtitle: '', + type: 'QuestionOneOfMany', + }, + answer: 'без энтузиазма', + }, + ], + createdAt: 'Fri Apr 22 2016 00:43:03 GMT+0600 (NOVT)', + }, +]; From 2ba192e08e3568136ad2450a7fc58f39cca61bc7 Mon Sep 17 00:00:00 2001 From: Slava Kovalenko Date: Fri, 22 Apr 2016 12:56:44 +0600 Subject: [PATCH 4/8] added animation and stat mok data --- src/admin/components/Admin/Admin.sass | 14 ++++++ .../components/AdminEditor/SuggestToSave.json | 10 +++++ .../components/AdminEditor/SuggestToSave.jsx | 43 +++++++++++++++++++ .../components/AdminEditor/SuggestToSave.sass | 19 ++++++++ 4 files changed, 86 insertions(+) create mode 100644 src/admin/components/Admin/Admin.sass create mode 100644 src/admin/components/AdminEditor/SuggestToSave.json create mode 100644 src/admin/components/AdminEditor/SuggestToSave.jsx create mode 100644 src/admin/components/AdminEditor/SuggestToSave.sass diff --git a/src/admin/components/Admin/Admin.sass b/src/admin/components/Admin/Admin.sass new file mode 100644 index 0000000..0dee2ee --- /dev/null +++ b/src/admin/components/Admin/Admin.sass @@ -0,0 +1,14 @@ +.enter + opacity: 0.01 + transform: translateY(100px) + transition: all .25s ease + +.enter.enterActive + opacity: 1 + transform: translateY(0) + +.leave + opacity: 0 + +.leave.leaveActive + opacity: 0 diff --git a/src/admin/components/AdminEditor/SuggestToSave.json b/src/admin/components/AdminEditor/SuggestToSave.json new file mode 100644 index 0000000..7a9ea0c --- /dev/null +++ b/src/admin/components/AdminEditor/SuggestToSave.json @@ -0,0 +1,10 @@ +[ + { + "id": "Save them", + "defaultMessage": "Save them" + }, + { + "id": "You've made some changes.", + "defaultMessage": "You've made some changes." + } +] \ No newline at end of file diff --git a/src/admin/components/AdminEditor/SuggestToSave.jsx b/src/admin/components/AdminEditor/SuggestToSave.jsx new file mode 100644 index 0000000..e577bfc --- /dev/null +++ b/src/admin/components/AdminEditor/SuggestToSave.jsx @@ -0,0 +1,43 @@ +import React, { Component, PropTypes } from 'react'; +import css from 'react-css-modules'; +import { intlShape, injectIntl, defineMessages } from 'react-intl'; +import cx from 'classnames'; + +import { Btn } from 'ui'; + +import styles from './SuggestToSave.sass'; + +const messages = defineMessages({ + btnTitle: { + id: 'Save them', + defaultMessage: 'Save them', + }, + btnComment: { + id: 'You\'ve made some changes.', + defaultMessage: 'You\'ve made some changes.', + }, +}); + +class SuggestToSave extends Component { + static propTypes = { + intl: intlShape.isRequired, + visible: PropTypes.bool.isRequired, + onSave: PropTypes.func.isRequired, + } + + render() { + const {formatMessage} = this.props.intl; + const {visible, onSave} = this.props; + const styles = cx({ + container: true, + visible: visible, + }); + return ( +
+ {formatMessage(messages.btnComment)} +
+ ); + } +} + +export default injectIntl(css(SuggestToSave, styles, {allowMultiple: true})); diff --git a/src/admin/components/AdminEditor/SuggestToSave.sass b/src/admin/components/AdminEditor/SuggestToSave.sass new file mode 100644 index 0000000..e3cd62b --- /dev/null +++ b/src/admin/components/AdminEditor/SuggestToSave.sass @@ -0,0 +1,19 @@ +@import "ui/styles/variables.sass" + +.container + position: fixed + left: 0 + bottom: 0 + width: 100% + transform: translateY(100%) + opacity: 0 + transition: all .35s ease + padding: $h + text-align: right + background: #fff + z-index: 1000 + box-shadow: 0 -2px 5px -2px rgba(60, 60, 60, .45) + + &.visible + opacity: 1 + transform: translateY(0) From 1b184d59924a5126144b807b02b458b91642bc48 Mon Sep 17 00:00:00 2001 From: Slava Kovalenko Date: Mon, 25 Apr 2016 16:15:49 +0600 Subject: [PATCH 5/8] parse mok data --- .babelrc | 2 +- .gitignore | 1 + package.json | 1 + .../AdminStatistics/AdminStatistics.jsx | 20 ++++++++++++++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.babelrc b/.babelrc index d42ca72..8de75dc 100644 --- a/.babelrc +++ b/.babelrc @@ -2,7 +2,7 @@ "presets": ["es2015", "react", "stage-0"], "plugins": [ ["react-intl", { - "messagesDir": "./" + "messagesDir": "./translations" }] ] } diff --git a/.gitignore b/.gitignore index 60add15..e65dba4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules elm-stuff *.log *.DS_Store +translations diff --git a/package.json b/package.json index 5f84907..0542235 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "express": "^4.13.4", "history": "^2.0.1", "jsonwebtoken": "^5.7.0", + "lodash": "^4.11.1", "lost": "^6.7.2", "moment": "^2.12.0", "mongoose": "^4.4.10", diff --git a/src/admin/components/AdminStatistics/AdminStatistics.jsx b/src/admin/components/AdminStatistics/AdminStatistics.jsx index fab33eb..4b7f224 100644 --- a/src/admin/components/AdminStatistics/AdminStatistics.jsx +++ b/src/admin/components/AdminStatistics/AdminStatistics.jsx @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import css from 'react-css-modules'; import moment from 'moment'; +import { flatten } from 'lodash'; import styles from './AdminStatistics.sass'; import { Btn, Dropdown } from 'ui'; @@ -11,11 +12,14 @@ import Feedback from './Feedback'; class AdminStatistics extends Component { state = { + feedbacks: feedbacksMok, dateFrom: moment().subtract(7, 'days'), dateTo: moment(), } render() { + console.log(prepareFeedbacks(this.state.feedbacks)); + return (
@@ -36,7 +40,21 @@ class AdminStatistics extends Component { } export default css(AdminStatistics, styles, {allowMultiple: true}); -const feedbackMok = [ +function prepareFeedbacks(feedbacks) { + let answers = []; + if (feedbacks && feedbacks.length > 1) { + answers = flatten(feedbacks.map(f => + f.answers.map(a => ({ + question: a.question.title, + answer: a.answer, + })) + )); + } + return answers; +} + + +const feedbacksMok = [ { id: 'f1', customer: { From 073da7219be4ccfe2c38f279c0385f992023f8cc Mon Sep 17 00:00:00 2001 From: Slava Kovalenko Date: Mon, 25 Apr 2016 17:30:04 +0600 Subject: [PATCH 6/8] translations added --- .eslintignore | 2 ++ generate-translations.js | 41 ++++++++++++++++++++++++++++++++++++++ package.json | 1 + src/admin/index.js | 5 +---- src/translation-default.js | 16 +++++++++++++++ src/translation-ru.js | 16 +++++++++++++++ 6 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 generate-translations.js create mode 100644 src/translation-default.js create mode 100644 src/translation-ru.js diff --git a/.eslintignore b/.eslintignore index eff0863..0e01e92 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,7 @@ node_modules webpack.* index.js +translator.js dev.js .public +translation-*.js diff --git a/generate-translations.js b/generate-translations.js new file mode 100644 index 0000000..4f62ead --- /dev/null +++ b/generate-translations.js @@ -0,0 +1,41 @@ +var glob = require("glob"); +var fs = require('fs'); +var object = require('lodash/fp/object'); + +var availableTranslations = ['ru']; + +var fileHeader = "module.exports = "; + +glob("translations/**/*.json", function (er, files) { + var messagesResult = {}; + files.map(function(file) { + var messagesArray = require('./'+file); + messagesArray.map(function(message) { + messagesResult[message.id] = message.defaultMessage; + }); + }); + writeTranslation('default', fileHeader + JSON.stringify(messagesResult, null, "\t")); + availableTranslations.map(function(translation) { + var fileName = './src/translation-'+translation+'.js'; + fs.stat(fileName, function(err, stat) { + if(err == null) { + var availableTranslation = require(fileName); + writeTranslation(translation, fileHeader + JSON.stringify(object.merge(messagesResult, availableTranslation), null, "\t")); + } else if(err.code == 'ENOENT') { + writeTranslation(translation, fileHeader + JSON.stringify(messagesResult, null, "\t")); + } else { + console.log('Some other error: ', err.code); + } + }); + }) + +}); + +function writeTranslation(translation, content) { + fs.writeFile("./src/translation-"+translation+".js", content, function(err) { + if(err) { + return console.log(err); + } + console.log("The "+translation+" translation file was created successfully."); + }); +} diff --git a/package.json b/package.json index 0542235..426534b 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "cookies-js": "^1.2.2", "css-loader": "^0.23.1", "express": "^4.13.4", + "glob": "^7.0.3", "history": "^2.0.1", "jsonwebtoken": "^5.7.0", "lodash": "^4.11.1", diff --git a/src/admin/index.js b/src/admin/index.js index d73b303..eaf5a60 100644 --- a/src/admin/index.js +++ b/src/admin/index.js @@ -9,10 +9,7 @@ import Admin from './components/Admin/Admin'; import AdminStatistics from './components/AdminStatistics/AdminStatistics'; import AdminEditor from './components/AdminEditor/AdminEditor'; -const messages = { - 'Sign in to your account': 'Войти в аккаунт', - 'Your question...': 'Ваш вопрос...', -}; +import messages from '../translation-ru'; const mountNode = document.getElementById('root'); ReactDOM.render( diff --git a/src/translation-default.js b/src/translation-default.js new file mode 100644 index 0000000..7b04213 --- /dev/null +++ b/src/translation-default.js @@ -0,0 +1,16 @@ +module.exports = { + "Type: One of many": "Type: One of many", + "Answers": "Answers", + "Your question...": "Your question...", + "Some additional info or comments (optional)": "Some additional info or comments (optional)", + "Show question to the client": "Show question to the client", + "An answer var": "An answer var", + "Add answer": "Add answer", + "Quiz questions": "Quiz questions", + "Add another question": "Add another question", + "There are no questions in this quiz. Go ahead, add the first one.": "There are no questions in this quiz. Go ahead, add the first one.", + "Save them": "Save them", + "You've made some changes.": "You've made some changes.", + "Sign in to your account": "Sign in to your account", + "Log out": "Log out" +} \ No newline at end of file diff --git a/src/translation-ru.js b/src/translation-ru.js new file mode 100644 index 0000000..8aefdec --- /dev/null +++ b/src/translation-ru.js @@ -0,0 +1,16 @@ +module.exports = { + "Type: One of many": "Блять", + "Answers": "Answers", + "Your question...": "Your question...", + "Some additional info or comments (optional)": "Some additional info or comments (optional)", + "Show question to the client": "Show question to the client", + "An answer var": "An answer var", + "Add answer": "Add answer", + "Quiz questions": "Quiz questions", + "Add another question": "Add another question", + "There are no questions in this quiz. Go ahead, add the first one.": "There are no questions in this quiz. Go ahead, add the first one.", + "Save them": "Save them", + "You've made some changes.": "You've made some changes.", + "Sign in to your account": "Перевод, блять!", + "Log out": "Log out" +} \ No newline at end of file From 1fba0e55084c50729eb3092c1b82541d498a55b2 Mon Sep 17 00:00:00 2001 From: Slava Kovalenko Date: Mon, 25 Apr 2016 17:37:52 +0600 Subject: [PATCH 7/8] fix #19: added translations script --- src/translation-ru.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/translation-ru.js b/src/translation-ru.js index 8aefdec..6c0a726 100644 --- a/src/translation-ru.js +++ b/src/translation-ru.js @@ -1,16 +1,16 @@ module.exports = { - "Type: One of many": "Блять", - "Answers": "Answers", - "Your question...": "Your question...", - "Some additional info or comments (optional)": "Some additional info or comments (optional)", - "Show question to the client": "Show question to the client", - "An answer var": "An answer var", - "Add answer": "Add answer", - "Quiz questions": "Quiz questions", - "Add another question": "Add another question", + "Type: One of many": "Тип: один вариант из нескольких", + "Answers": "Ответы", + "Your question...": "Ваш вопрос...", + "Some additional info or comments (optional)": "Подробное разъяснение вопроса (не обязательно)", + "Show question to the client": "Показывать вопрос клиенту?", + "An answer var": "Вариант ответа", + "Add answer": "Добавить вариант", + "Quiz questions": "Вопросы", + "Add another question": "Добавить вопрос", "There are no questions in this quiz. Go ahead, add the first one.": "There are no questions in this quiz. Go ahead, add the first one.", - "Save them": "Save them", - "You've made some changes.": "You've made some changes.", - "Sign in to your account": "Перевод, блять!", - "Log out": "Log out" -} \ No newline at end of file + "Save them": "Сохранить", + "You've made some changes.": "Вы внесли изменения", + "Sign in to your account": "Войти в свой аккаунт", + "Log out": "Выйти" +} From b4abc12605ad32fa7cf47f45d3fefa6a4e22388b Mon Sep 17 00:00:00 2001 From: Slava Kovalenko Date: Mon, 25 Apr 2016 17:39:29 +0600 Subject: [PATCH 8/8] fix #19: remove unused translations files --- .../components/AdminEditor/AdminEditor.json | 10 ------- src/admin/components/AdminEditor/Editor.json | 30 ------------------- .../components/AdminEditor/QuestionsList.json | 14 --------- .../components/AdminEditor/SuggestToSave.json | 10 ------- src/admin/components/Login/Login.json | 6 ---- src/admin/components/Navbar/Navbar.json | 6 ---- 6 files changed, 76 deletions(-) delete mode 100644 src/admin/components/AdminEditor/AdminEditor.json delete mode 100644 src/admin/components/AdminEditor/Editor.json delete mode 100644 src/admin/components/AdminEditor/QuestionsList.json delete mode 100644 src/admin/components/AdminEditor/SuggestToSave.json delete mode 100644 src/admin/components/Login/Login.json delete mode 100644 src/admin/components/Navbar/Navbar.json diff --git a/src/admin/components/AdminEditor/AdminEditor.json b/src/admin/components/AdminEditor/AdminEditor.json deleted file mode 100644 index 3c9467d..0000000 --- a/src/admin/components/AdminEditor/AdminEditor.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "id": "Quiz questions", - "defaultMessage": "Quiz questions" - }, - { - "id": "Add another question", - "defaultMessage": "Add another question" - } -] \ No newline at end of file diff --git a/src/admin/components/AdminEditor/Editor.json b/src/admin/components/AdminEditor/Editor.json deleted file mode 100644 index 1959d12..0000000 --- a/src/admin/components/AdminEditor/Editor.json +++ /dev/null @@ -1,30 +0,0 @@ -[ - { - "id": "Type: One of many", - "defaultMessage": "Type: One of many" - }, - { - "id": "Answers", - "defaultMessage": "Answers" - }, - { - "id": "Your question...", - "defaultMessage": "Your question..." - }, - { - "id": "Some additional info or comments (optional)", - "defaultMessage": "Some additional info or comments (optional)" - }, - { - "id": "Show question to the client", - "defaultMessage": "Show question to the client" - }, - { - "id": "An answer var", - "defaultMessage": "An answer var" - }, - { - "id": "Add answer", - "defaultMessage": "Add answer" - } -] \ No newline at end of file diff --git a/src/admin/components/AdminEditor/QuestionsList.json b/src/admin/components/AdminEditor/QuestionsList.json deleted file mode 100644 index 64512c7..0000000 --- a/src/admin/components/AdminEditor/QuestionsList.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "id": "Quiz questions", - "defaultMessage": "Quiz questions" - }, - { - "id": "Add another question", - "defaultMessage": "Add another question" - }, - { - "id": "There are no questions in this quiz. Go ahead, add the first one.", - "defaultMessage": "There are no questions in this quiz. Go ahead, add the first one." - } -] \ No newline at end of file diff --git a/src/admin/components/AdminEditor/SuggestToSave.json b/src/admin/components/AdminEditor/SuggestToSave.json deleted file mode 100644 index 7a9ea0c..0000000 --- a/src/admin/components/AdminEditor/SuggestToSave.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "id": "Save them", - "defaultMessage": "Save them" - }, - { - "id": "You've made some changes.", - "defaultMessage": "You've made some changes." - } -] \ No newline at end of file diff --git a/src/admin/components/Login/Login.json b/src/admin/components/Login/Login.json deleted file mode 100644 index dfcc6d3..0000000 --- a/src/admin/components/Login/Login.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "id": "Sign in to your account", - "defaultMessage": "Sign in to your account" - } -] \ No newline at end of file diff --git a/src/admin/components/Navbar/Navbar.json b/src/admin/components/Navbar/Navbar.json deleted file mode 100644 index 14abf8c..0000000 --- a/src/admin/components/Navbar/Navbar.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "id": "Log out", - "defaultMessage": "Log out" - } -] \ No newline at end of file