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

feature/CLAN6-43--widget-person-draw #155

Merged
merged 14 commits into from
Jan 10, 2020

Conversation

jplucinski
Copy link
Contributor

  • Person Draw Widget
  • MultiTextInput.js - multiline dialog input

- Person Draw Widget
- MultiTextInput.js - multiline dialog input
Copy link
Contributor

@szymon-owczarzak szymon-owczarzak left a comment

Choose a reason for hiding this comment

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

As discussed please move draw logic to backend so:

  • each browser session will have the same draw resuls
  • draw results will be saved
  • draw results will be available for all new client sessions
  • less WS communication - only when new draw is done

@jplucinski
Copy link
Contributor Author

After catch up with @szymon-owczarzak we decided to add backed sync for widget.

@jplucinski jplucinski added the enhancement New feature or request label Dec 16, 2019
jplucinski added 3 commits December 17, 2019 17:28
- moved persistence to backend
- saving state when server restarts
- dialog form validation
- CR fixes
- update uuid in form
- fix imports
# Conflicts:
#	cogboard-webapp/src/components/widgets/dialogFields/index.js
Copy link
Contributor

@szymon-owczarzak szymon-owczarzak left a comment

Choose a reason for hiding this comment

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

Please we need JUnit for complex BL like this

jplucinski added 4 commits January 7, 2020 15:09
- extract implementation from PersonDrawWidget.kt
# Conflicts:
#	cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/WidgetIndex.kt
#	cogboard-webapp/src/components/widgets/index.js
#	functional/cypress-tests/cypress/config/travis.json
#	functional/cypress-tests/cypress/integration/widgets.js
#	functional/cypress-tests/cypress/support/widgetAssertions.js
- storing widget context in persisted content
- add unit tests for PersonDrawIndexer.kt
- storing widget data in persisted content
- util function and unit tests
Copy link
Contributor

@szymon-owczarzak szymon-owczarzak left a comment

Choose a reason for hiding this comment

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

Please revert all this strange format changes

import java.time.ZoneId
import kotlin.random.Random

fun <T> List<T>.getNextListIndex(currentIndex: Int): Int {
Copy link
Contributor

@szymon-owczarzak szymon-owczarzak Jan 8, 2020

Choose a reason for hiding this comment

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

You could use when expression and ranges here:

fun <T> List<T>.getNextListIndex(currentIndex: Int) = when {
    this.isEmpty() -> -1
    currentIndex in 0..(size - 2) -> currentIndex + 1
    else -> 0
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, I will use your version.

import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test

class PersonDrawUtilsTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice ! i like this

@jplucinski
Copy link
Contributor Author

Changes in cypress scripts formatting are expected - consulted with @staszke

- MultiTextInput.js - fix list key
- PersonDrawWidget.kt - read config only ones
@jplucinski jplucinski self-assigned this Jan 10, 2020
@jplucinski jplucinski merged commit 77207b0 into master Jan 10, 2020
@szymon-owczarzak szymon-owczarzak deleted the feature/CLAN6-43--widget-person-draw branch January 17, 2020 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants