-
Notifications
You must be signed in to change notification settings - Fork 3
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
Backup page #26
Conversation
There was a problem hiding this 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>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я понимаю, что ты это ставишь, чтобы верстать удобнее было, не дожидаясь загрузки, но это изменение ломает другие компоненты, не забывай плз перед сабмитом PR убирать его.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
у меня был коммит с более удобным управлением этим условием но он куда-то пропал в мержах
client/store/app.js
Outdated
setModal({ commit }, val) { | ||
commit(APP_SET_MODAL, val); | ||
}, | ||
setHeaderTitle({ commit }, val) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это не обязательно в стор выносить. Тебе ведь это нужно только в компоненте хедера? Можно обойтись простым computed там.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
там была идея вначале менять в компоненте, потом в итоге вышло, что особо и нужно было. Но с другой стороны ничего плохого нет, что через стор хедер работает.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, работает, но совершаются лишние манипуляции, которые вообще без надобности (действия со стором и вотч), прошлый вариант с computed был проще и всё полностью выполнял. Верни, пожалуйста, к нему.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вполне вероятна ситуация появления в нем надобности. Я же его и затеял, чтобы менять хедер в любом месте приложения при случае. Но отказался от реализации в текущем компоненте.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем менять хедер в каком-то месте, если он отражает текущее местоположение по роуту? Если возникнет необходимость показать там какие-то еще данные, то для этого лучше будет использовать отдельный параметр, который отдельными экшенами можно будет устанавливать, который не будет меняться на вотч роута.
client/store/app.js
Outdated
const APP_SET_MODAL = 'APP_SET_MODAL'; | ||
|
||
const actions = { | ||
setModal({ commit }, val) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что это за действие?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это действие дает возможность использовать v-if для показа модального окна в зависимости от его названия.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ок. Только давай будем использовать более понятные имена переменных. Если val - это название модального окна, то стоит обозначить его modalName.
client/views/Backup/done.vue
Outdated
<script> | ||
|
||
import icon from '@/components/icon'; | ||
/*eslint-disable*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Убирай пожалуйста все выключения еслинта перед сабмитом PR
client/views/Backup/done.vue
Outdated
|
||
import icon from '@/components/icon'; | ||
/*eslint-disable*/ | ||
const infos = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем это в отдельную переменную? В целом можно, но тогда стоит хранить просто в дате (а лучше - в $options, если это реактивные данные). А вообще хтмл код должен быть только в темплейте.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
намного удобнее выносить списки текстов в переменные, нежели писать эти строки в html.
client/views/Backup/index.vue
Outdated
|
||
#trusty_backup.main_padding | ||
|
||
first(v-if="$route.name==='backup'") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что это за файл? Конфиг еслинта или?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
извини,но ответ на это вопрос можно получить из названия файла..
я менял это потому что не очень ясно работает саблайм, webpack, eslinter и editor config вместе создавая дополнительных ошибки.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pixel-glass - это для пиксель-перфект верстки ты используешь?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pixel glass да.. вещь)
There was a problem hiding this 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/
client/views/Backup/index.vue
Outdated
p.trusty_help_text Let't verify your backup phrase | ||
.verify_area | ||
p.trusty_help_text | ||
span(v-for="word in comprehendPhrase") {{ `${word} `}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно же просто {{ word }}
client/views/Backup/index.vue
Outdated
}, | ||
computed: { | ||
...mapGetters('app', ['appModal']), | ||
getPhrase() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь не нужен computed, это статические данные. На будущее, computed - это как бы как переменные, то есть существительные, а не вызываемые функции - лучше назвать просто phrase.
client/views/Backup/index.vue
Outdated
.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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно сделать универсальный ui-компонент modal, который через slot будет получать, что ему отображать. По props получать состояние отобразается/спрятано. И его верстку не придётся в будущем по разным местам копировать.
client/views/Backup/index.vue
Outdated
import { mapActions, mapGetters } from 'vuex'; | ||
import phrase from './phrase'; | ||
import first from './first'; | ||
import done from './done'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client/store/app.js
Outdated
} | ||
}; | ||
|
||
const getters = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Переименуй плз в getModalName, геттер - это функция, т.е. глагол и начинаем с get.
client/views/Backup/index.vue
Outdated
phrase(v-if="$route.name==='backup-phrase'", :phrase="getPhrase" ) | ||
done(v-if="$route.name==='backup-done'") | ||
|
||
#verify(v-if="$route.name==='backup-verify'") |
There was a problem hiding this comment.
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, и не придётся кучу этих проверок на роут.нейм писать.
client/views/Backup/done.vue
Outdated
` | ||
I understand that my funds are<br/> | ||
help securely on this device, not<br/> | ||
by a compony, and nobody can<br/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Опечатка в company
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
backup/verify
Некорректная работа при выборе всех слов. Надо, чтобы контейнер с выбранными словами имел скролл, когда слова больше по высоте. Также надо иметь возможность возвращать слова из выбранных в пул всех (обратное действие для выбора слова). Пофиксить ошибки, возникающие при выборе всех слов. На "clear" - возврат в исходное состояние. Сделать, чтобы кнопки-слова имели cursor: pointer. -
route
Надо, чтобы по роуту backup/ грузился роут, который backup/info, для этого надо поменять url child-роута с "/info" на "/". -
Выпилить из стора неиспользуемые вещи, связанные с headerTitle.
Когда завершишь, убери префикс wip: из PR - так будет ясно, что это уже готовый вариант, который можно смотреть.
Поправил по замечаниям. Хочу отметить что то пространство с выбранными кнопками скролится. |
@riffca Всё гуд, осталось совсем чутка: По скроллу вижу, скроллится, просто есть какой-то странный скролл всего экрана... Ну это тогда отдельным issue. |
Добавлен компонент backup