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

For review with Android #90

Open
wants to merge 246 commits into
base: for-review
Choose a base branch
from
Open

For review with Android #90

wants to merge 246 commits into from

Conversation

KirillSmirnow
Copy link
Member

@KirillSmirnow KirillSmirnow commented Jan 18, 2021

In addition to all the code as in #89, this PR contains the latest android module code, though the checks fail

On branch MR-1-user
On branch MR-1-user
1. User creation test
2. Identifier creation test

On branch MR-1-user
On branch MR-1-user
On branch MR-1-user
6-digit verification code generation by means of Apache Commons Lang

On branch MR-1-user
On branch MR-1-user
On branch MR-1-user
On branch MR-4-session
On branch MR-4-session
The library provides multiplatform support of date/time classes

On branch MR-4-session
On branch MR-4-session
On branch MR-4-session
Use Mockito (v3.6) to mock static method of Clock class
so as to have the ability to change system time

On branch MR-4-session
On branch MR-1-user
On branch MR-1-user
* Configure website deployment

* Add Production, Build and Deploy sections to README

* Make FCM initialization optional (for local/debug envs)

* Fix Build section of README

* Add 'Development with IntelliJ IDEA' section to README
@Walingar Walingar self-requested a review January 19, 2021 14:52
val name: String,
val type: String,
) {
fun url(): String = "http://${Server.host}:${Server.port}/attachments/$objectId/$name"
Copy link
Collaborator

Choose a reason for hiding this comment

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

fun -> val

Copy link
Member Author

@KirillSmirnow KirillSmirnow Jan 19, 2021

Choose a reason for hiding this comment

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

Так можно сделать, если сконфигурировать ktor client deserializer, чтобы он игнорировал поле url (потому что оно не в конструкторе). Иначе возникают ошибки, то в android, то в ios...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Тогда можно сделать extension val ;)

private val restaurantClient: RestaurantClient
) : ViewModel() {
private val _restaurants = MutableLiveData<List<RestaurantInfo>>()
val restaurants: LiveData<List<RestaurantInfo>> = _restaurants
Copy link
Collaborator

Choose a reason for hiding this comment

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

Класс, что так делаешь!

val search = restaurantClient.search(keyword, Pageable(0, 10))
// TODO debug x4
val test = mutableListOf<RestaurantInfo>()
for (i in (0..3)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Скобки лишние

import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class MyRestApplication : Application() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

{} не нужны

private fun getMyRestaurants() = GlobalScope.launch {
try {
val restaurants = props.restaurantClient.getRestaurantsOfUser()
setState(State(state.me, restaurants))
Copy link
Collaborator

Choose a reason for hiding this comment

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

state.copy(restaurants = restaurants)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Насколько я знаю, в kotlin-react больше любят делать state интерфейсом и проперти var, чтобы тут вызывать setState { restaurants = restaurants }

Copy link
Member Author

Choose a reason for hiding this comment

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

Да, так было бы лучше

class SignInComponent(props: Props) : RComponent<SignInComponent.Props, SignInComponent.State>(props) {

init {
state = State(null)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Я думаю, так не очень хорошо делать, лучше использовать state который предоставляет родитель

KirillSmirnow and others added 21 commits January 30, 2021 12:15
* Add getById method for RestaurantClient

* Disable auth for public method
* Add ability to update profile

* Fix tests
Add skeleton of sign up activity
Add manual dependency injection
Auto upgrade of gradle dependencies
Add DI using hilt
Enable data binding
Fix java versions (hilt doesn't work with 11)
Add some dummy fragments
Add toolbar
Add material components
Set theme to NoActionBar (to see the back icon?)
Implement auto-recovering session logic
Remove old activities from manifest
Add profile view
Remove obsolete debug search activities
Auto-move to restaurant search if user is signed in
Refresh session
Add stub navigation
Add assisted DI support
Fix singletons
Dynamic menu depending on global employee mode
Implement logout
Setup navigation root destinations
Remove signUp fragment
Add ability to change profile data
Global timer for signIn action
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.

4 participants