Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup page #26

Merged
merged 12 commits into from
Feb 20, 2018
Merged

Backup page #26

merged 12 commits into from
Feb 20, 2018

Conversation

riffca
Copy link
Contributor

@riffca riffca commented Feb 13, 2018

Добавлен компонент backup

Copy link
Contributor

@roma219 roma219 left a comment

Choose a reason for hiding this comment

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

В целом гуд, нужно немного подпилить. Чуть позже поподробнее посмотрю по функционалу компонент.

client/root.js Outdated
@@ -10,7 +10,7 @@ export default {
},
render() {
// eslint-disable-next-line
let app = (this.connected) ? (<router-view></router-view>) : (<h4>Connecting</h4>);
let app = (this.connected) || true ? (<router-view></router-view>) : (<h4>Connecting</h4>);
Copy link
Contributor

Choose a reason for hiding this comment

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

Я понимаю, что ты это ставишь, чтобы верстать удобнее было, не дожидаясь загрузки, но это изменение ломает другие компоненты, не забывай плз перед сабмитом PR убирать его.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

у меня был коммит с более удобным управлением этим условием но он куда-то пропал в мержах

setModal({ commit }, val) {
commit(APP_SET_MODAL, val);
},
setHeaderTitle({ commit }, val) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Это не обязательно в стор выносить. Тебе ведь это нужно только в компоненте хедера? Можно обойтись простым computed там.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

там была идея вначале менять в компоненте, потом в итоге вышло, что особо и нужно было. Но с другой стороны ничего плохого нет, что через стор хедер работает.

Copy link
Contributor

Choose a reason for hiding this comment

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

Да, работает, но совершаются лишние манипуляции, которые вообще без надобности (действия со стором и вотч), прошлый вариант с computed был проще и всё полностью выполнял. Верни, пожалуйста, к нему.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Вполне вероятна ситуация появления в нем надобности. Я же его и затеял, чтобы менять хедер в любом месте приложения при случае. Но отказался от реализации в текущем компоненте.

Copy link
Contributor

Choose a reason for hiding this comment

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

А зачем менять хедер в каком-то месте, если он отражает текущее местоположение по роуту? Если возникнет необходимость показать там какие-то еще данные, то для этого лучше будет использовать отдельный параметр, который отдельными экшенами можно будет устанавливать, который не будет меняться на вотч роута.

const APP_SET_MODAL = 'APP_SET_MODAL';

const actions = {
setModal({ commit }, val) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Что это за действие?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Это действие дает возможность использовать v-if для показа модального окна в зависимости от его названия.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ок. Только давай будем использовать более понятные имена переменных. Если val - это название модального окна, то стоит обозначить его modalName.

<script>

import icon from '@/components/icon';
/*eslint-disable*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Убирай пожалуйста все выключения еслинта перед сабмитом PR


import icon from '@/components/icon';
/*eslint-disable*/
const infos = [
Copy link
Contributor

Choose a reason for hiding this comment

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

А зачем это в отдельную переменную? В целом можно, но тогда стоит хранить просто в дате (а лучше - в $options, если это реактивные данные). А вообще хтмл код должен быть только в темплейте.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

намного удобнее выносить списки текстов в переменные, нежели писать эти строки в html.


#trusty_backup.main_padding

first(v-if="$route.name==='backup'")
Copy link
Contributor

Choose a reason for hiding this comment

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

Эти проверки можно тоже через компутед возвращать по словарю аналогично как в хедере было сделано.

@@ -1,7 +1,7 @@
root = true

[*]
indent_style = space
indent_style = tab
Copy link
Contributor

Choose a reason for hiding this comment

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

Что это за файл? Конфиг еслинта или?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

извини,но ответ на это вопрос можно получить из названия файла..
я менял это потому что не очень ясно работает саблайм, webpack, eslinter и editor config вместе создавая дополнительных ошибки.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ок, я просто не понял, что это за эдитор такой...

@@ -1,7 +1,7 @@
root = true

[*]
indent_style = space
indent_style = tab
Copy link
Contributor

Choose a reason for hiding this comment

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

Ок, я просто не понял, что это за эдитор такой...

isProfilePage() {
return this.$route.path.indexOf('home') !== -1 || this.$route.name === 'home';
},
getTitle() {
return this.titles[this.$route.name];
Copy link
Contributor

Choose a reason for hiding this comment

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

Вот этот вариант был лучше.

@@ -10,7 +10,20 @@ HTML {
/* Планшет */
@media ( max-width: 768px ) {
HTML {
background-image: url("./screens/manage_portfolio_manual.png");
Copy link
Contributor

Choose a reason for hiding this comment

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

pixel-glass - это для пиксель-перфект верстки ты используешь?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pixel glass да.. вещь)

@roma219
Copy link
Contributor

roma219 commented Feb 13, 2018

image

Copy link
Contributor

@roma219 roma219 left a comment

Choose a reason for hiding this comment

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

Ознакомься пожалуйста со стайл-гайдом по vue
https://vuejs.org/v2/style-guide/

p.trusty_help_text Let't verify your backup phrase
.verify_area
p.trusty_help_text
span(v-for="word in comprehendPhrase") {{ `${word} `}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Можно же просто {{ word }}

},
computed: {
...mapGetters('app', ['appModal']),
getPhrase() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Здесь не нужен computed, это статические данные. На будущее, computed - это как бы как переменные, то есть существительные, а не вызываемые функции - лучше назвать просто phrase.

.modal_content: p.trusty_big_font TRY AGAIN

.modal_alert.main_padding(@click="setModal(null)", v-if="appModal==='backup_copied_password'")
.modal_content: p.trusty_big_font Password copied#[br] to clipboard
Copy link
Contributor

Choose a reason for hiding this comment

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

Можно сделать универсальный ui-компонент modal, который через slot будет получать, что ему отображать. По props получать состояние отобразается/спрятано. И его верстку не придётся в будущем по разным местам копировать.

import { mapActions, mapGetters } from 'vuex';
import phrase from './phrase';
import first from './first';
import done from './done';
Copy link
Contributor

Choose a reason for hiding this comment

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

}
};

const getters = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Переименуй плз в getModalName, геттер - это функция, т.е. глагол и начинаем с get.

phrase(v-if="$route.name==='backup-phrase'", :phrase="getPhrase" )
done(v-if="$route.name==='backup-done'")

#verify(v-if="$route.name==='backup-verify'")
Copy link
Contributor

Choose a reason for hiding this comment

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

Вся эта затея с этими роутами делается через вложенные роуты - https://router.vuejs.org/en/essentials/nested-routes.html, и не придётся кучу этих проверок на роут.нейм писать.

`
I understand that my funds are<br/>
help securely on this device, not<br/>
by a compony, and nobody can<br/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Опечатка в company

@roma219 roma219 changed the title Backup page wip: Backup page Feb 16, 2018
Copy link
Contributor

@roma219 roma219 left a comment

Choose a reason for hiding this comment

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

  1. backup/verify
    image
    image
    Некорректная работа при выборе всех слов. Надо, чтобы контейнер с выбранными словами имел скролл, когда слова больше по высоте. Также надо иметь возможность возвращать слова из выбранных в пул всех (обратное действие для выбора слова). Пофиксить ошибки, возникающие при выборе всех слов. На "clear" - возврат в исходное состояние. Сделать, чтобы кнопки-слова имели cursor: pointer.

  2. route
    Надо, чтобы по роуту backup/ грузился роут, который backup/info, для этого надо поменять url child-роута с "/info" на "/".

  3. Выпилить из стора неиспользуемые вещи, связанные с headerTitle.

Когда завершишь, убери префикс wip: из PR - так будет ясно, что это уже готовый вариант, который можно смотреть.

@riffca riffca changed the title wip: Backup page Backup page Feb 19, 2018
@riffca
Copy link
Contributor Author

riffca commented Feb 19, 2018

Поправил по замечаниям. Хочу отметить что то пространство с выбранными кнопками скролится.

@roma219
Copy link
Contributor

roma219 commented Feb 19, 2018

@riffca Всё гуд, осталось совсем чутка:
image

По скроллу вижу, скроллится, просто есть какой-то странный скролл всего экрана... Ну это тогда отдельным issue.

@roma219 roma219 merged commit fbc4299 into master Feb 20, 2018
@roma219 roma219 deleted the backupPage branch February 20, 2018 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants