-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
jplucinski
commented
Dec 12, 2019
- Person Draw Widget
- MultiTextInput.js - multiline dialog input
- Person Draw Widget - MultiTextInput.js - multiline dialog input
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/WidgetIndex.kt
Show resolved
Hide resolved
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
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.
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
After catch up with @szymon-owczarzak we decided to add backed sync for widget. |
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/types/PersonDrawWidget/index.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/types/PersonDrawWidget/index.js
Outdated
Show resolved
Hide resolved
- 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
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.
Please we need JUnit for complex BL like this
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
- 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
cogboard-webapp/src/components/widgets/types/PersonDrawWidget/index.js
Outdated
Show resolved
Hide resolved
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.
Please revert all this strange format changes
- run eslint for cypress test
- reformat config.json
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/dialogFields/MultiTextInput.js
Outdated
Show resolved
Hide resolved
cogboard-webapp/src/components/widgets/types/PersonDrawWidget/styled.js
Outdated
Show resolved
Hide resolved
import java.time.ZoneId | ||
import kotlin.random.Random | ||
|
||
fun <T> List<T>.getNextListIndex(currentIndex: Int): Int { |
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.
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
}
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.
Nice, I will use your version.
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/persondraw/PersonDrawUtils.kt
Show resolved
Hide resolved
cogboard-app/src/main/kotlin/com/cognifide/cogboard/widget/type/persondraw/PersonDrawWidget.kt
Outdated
Show resolved
Hide resolved
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Test | ||
|
||
class PersonDrawUtilsTest { |
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.
nice ! i like this
Changes in cypress scripts formatting are expected - consulted with @staszke |
- MultiTextInput.js - fix list key - PersonDrawWidget.kt - read config only ones
…idget-person-draw