-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/custom ringtone [WTEL-4348] #706
Conversation
# Conflicts: # src/modules/settings/api/settings.js
src/modules/settings/api/settings.js
Outdated
|
||
export const getRingtonesList = async () => { | ||
try { | ||
const ringtones = await fetch(`${import.meta.env.VITE_RINGTONES_URL}/index.json`) |
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.
Я не впевнена що треба саме виносити у env, бо він більше включає загальні змінні для перевикористання
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.
треба, бо це за межами апплікейшена
</h3> | ||
</header> | ||
<form> | ||
<div class="settings-section__wrapper"> |
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.
так
<form> | ||
<div class="settings-section__wrapper"> | ||
<wt-checkbox | ||
v-model="isCustomRingtone" |
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.
:value
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.
з велью не працює, працює з :selected. змінила
}), | ||
data: () => ({ | ||
isCustomRingtone: false, | ||
currentRingtone: {}, |
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.
може просто ringtone?
options: [], | ||
}), | ||
computed: { | ||
currentRingtone: { |
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.
а чому саме get/set потрібен?
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.
я досить довго проколупалась з тим, що "звичними способами" не працює. Схоже, через те, що ми в данному випадку оперуємо об'єктами, а не простими типами данних.
Тому знайшла в коді приклад з get/set, який запрацював.
Тобто, схоже, особливість того, як працює наш мультиселект, якщо мова про оперування об'єктами.
this.options = await getRingtonesList(); | ||
}, | ||
restoreRingtone() { | ||
const ringtoneName = localStorage.getItem('ringtone'); |
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.
Я думаю якщо в локалСторадж ти зберігаєш тільки імя - то може і ключ назвати ringtone-name
А якщо не тільки імя - то тоді ця змінна має бути ringtone)
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.
Чесно кажучи, не бачу сенсу називати в локал стореджі ringtoneName
Бо и локалстореджі зберігається багато різних сутностей і, як на мене, сутність "рінгтон" виглядає досить зрозуміло, просто і однозначно
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.
треба settings/ringtone
, або settings/custom-ringtone
(я думаю, 1ше краще)
@@ -83,6 +83,7 @@ | |||
</div> | |||
</form> | |||
</section> | |||
<the-ringtone class="settings-section__setting" /> |
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 - settings-section__setting нема такого классу, є тільки settings-section. Да і чи потрібен він тобі
2 - цей же клас є в середині твого нового компонента, думаю він там не потрібен)
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.
Насправді, в сеттінгах є цей класс
Тому я його і використовую. Тут зараз приберу.
Але, гадаю, цей момент, скоріше, ще вилізе в тасці call-end-notification, бо там робила візуальні зміни в сеттінгах, опираючись на ті класи, які зараз є.
@@ -0,0 +1,113 @@ | |||
<template> | |||
<section class="settings-section__setting"> |
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.
Клас цей тут не потрібен, а як потрібен - називаємо як компонент)
</script> | ||
|
||
<style lang="scss" scoped> | ||
.settings-section__wrapper { |
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.
Давай адаптуємо назви классів до назви компонента)
selectRingtoneType() { | ||
if (this.isCustomRingtone && this.currentRingtone.name) this.currentRingtone = {}; | ||
}, | ||
saveRingtone() { |
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.
saveRingtoneInLocalStorage?
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.
а нашо? якщо ми просто зберігаємо рінгтон, у нас немає інших типів збереження тут наразі, щоб ми могли з чимось сплутати
Мені здається, saveRingtone досить зрозуміло і локанічно. Стандартна дія, яка відбувається при кліку на кнопку save
}), | ||
computed: { | ||
ringtone: { | ||
get() { |
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.
все таки не розумію навіщо гетер/сетер(
@@ -12,47 +12,76 @@ export const getWebPhone = async () => { | |||
|
|||
try { | |||
const response = await instance.get(url); | |||
return applyTransform(response.data, [snakeToCamel()]); | |||
return applyTransform(response.data, [ |
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.
я так зрозуміла, що це біом сплюскує отак applyTransform, а я його, виходить, заново "росправила"
мені, насправді, так не подобається як воно в одну строчку виглядає...
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.
мені теж
але тоді треба шукати як пофіксити біом)
@@ -12,47 +12,76 @@ export const getWebPhone = async () => { | |||
|
|||
try { | |||
const response = await instance.get(url); | |||
return applyTransform(response.data, [snakeToCamel()]); | |||
return applyTransform(response.data, [ |
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.
мені теж
але тоді треба шукати як пофіксити біом)
src/modules/settings/api/settings.js
Outdated
|
||
export const getRingtonesList = async () => { | ||
try { | ||
const ringtones = await fetch(`${import.meta.env.VITE_RINGTONES_URL}/index.json`) |
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.
а чого the-ringtone, а не, скажімо, custom-ringtone?
@@ -0,0 +1,117 @@ | |||
<template> | |||
<section class="ringtone"> |
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.
клас має завжди відповідати назві компонента
@change="selectRingtoneType" | ||
/> | ||
<wt-select | ||
v-model="ringtone" |
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.
в-модел краще не використовувати. чому? -- писав про це в нашому чаті
this.options = await getRingtonesList(); | ||
}, | ||
restoreRingtone() { | ||
const ringtoneName = localStorage.getItem('ringtone'); |
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.
треба settings/ringtone
, або settings/custom-ringtone
(я думаю, 1ше краще)
|
||
.wt-button { | ||
display: block; | ||
margin: 3px 0 0 auto; |
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.
а шо це за 3 пікселі затіхарілісь?))
# Conflicts: # src/app/locale/en/en.js # src/app/locale/ru/ru.js # src/app/locale/ua/ua.js # src/modules/settings/components/the-settings.vue
No description provided.