diff --git a/.editorconfig b/.editorconfig index 1fc1ffdc..e804aaaf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,8 +15,12 @@ indent_size = 4 [*.{kt,kts}] max_line_length = 120 -ij_kotlin_allow_trailing_comma = false -ij_kotlin_allow_trailing_comma_on_call_site = false +ij_kotlin_packages_to_use_import_on_demand = unset +ij_kotlin_name_count_to_use_star_import = 99 +ij_kotlin_name_count_to_use_star_import_for_members = 99 +ij_kotlin_keep_line_breaks = true +ij_kotlin_call_parameters_new_line_after_left_paren = false +ij_kotlin_method_parameters_new_line_after_left_paren = false [*.md] trim_trailing_whitespace = false diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..6a2c03b6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,50 @@ +name: CI/CD Pipeline + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + env: + ECR_CLUSTER: ${{ secrets.ECR_CLUSTER }} + ECR_SERVICE: ${{ secrets.ECR_SERVICE }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + + - name: Build with Gradle + run: ./gradlew build + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Build, tag, and push image to Amazon ECR + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }} + IMAGE_TAG: ${{ github.sha }} + run: | + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG + + - name: Update image in AWS + run: | + aws apprunner create-service --service-name benatty-shop-web-client --source-configuration '{"ImageRepository": {"ImageIdentifier": "'"$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"'", "ImageRepositoryType": "ECR"}}' diff --git a/apps/shop/feature/home/src/commonMain/kotlin/feature/shop/home/HomeContract.kt b/apps/shop/feature/home/src/commonMain/kotlin/feature/shop/home/HomeContract.kt index b239dbf2..bdf95aa8 100644 --- a/apps/shop/feature/home/src/commonMain/kotlin/feature/shop/home/HomeContract.kt +++ b/apps/shop/feature/home/src/commonMain/kotlin/feature/shop/home/HomeContract.kt @@ -3,13 +3,16 @@ package feature.shop.home import component.localization.Strings import component.localization.getString import data.GetLandingConfigQuery +import data.GetLandingConfigQuery.SlideshowItem +import data.type.MediaType object HomeContract { data class State( val isLoading: Boolean = true, val landingConfig: GetLandingConfigQuery.GetLandingConfig = GetLandingConfigQuery.GetLandingConfig( - slideshowItems = listOf(), topCategoriesSection = GetLandingConfigQuery.TopCategoriesSection( + slideshowItems = listOf(), + topCategoriesSection = GetLandingConfigQuery.TopCategoriesSection( left = GetLandingConfigQuery.Left(media = null, title = null), middle = GetLandingConfigQuery.Middle(media = null, title = null), right = GetLandingConfigQuery.Right(media = null, title = null) @@ -21,6 +24,30 @@ object HomeContract { val email: String = "", val emailError: String? = null, + val slideshowItems: List = listOf( + SlideshowItem( + id = "1", + title = "Fine details", + description = null, + media = GetLandingConfigQuery.Media( + keyName = "1", + url = "https://be-natty.co.uk/cdn/shop/files/Dolce_Theme_Slide_1.webp?v=1717262628&width=1200", + alt = "Hero 1", + type = MediaType.Image + ), + ), + SlideshowItem( + id = "2", + title = "Boho style", + description = null, + media = GetLandingConfigQuery.Media( + keyName = "1", + url = "https://be-natty.co.uk/cdn/shop/files/Dolce_Theme_Slide_3.webp?v=1717262705&width=1200", + alt = "Hero 1", + type = MediaType.Image + ), + ) + ), val categorySection: List = listOf( CategoryItem( url = "https://icon-shopify-theme.myshopify.com/cdn/shop/files/looks1.jpg?v=1614301039&width=600", @@ -384,7 +411,7 @@ object HomeContract { data object FetchLandingConfig : Inputs data object FetchProducts : Inputs - data class OnCollageItemClick(val item: GetLandingConfigQuery.SlideshowItem) : Inputs + data class OnCollageItemClick(val item: SlideshowItem) : Inputs data object OnPrivacyPolicyClick : Inputs data object OnTermsOfServiceClick : Inputs data class OnCategoryItemClick(val id: String) : Inputs diff --git a/apps/shop/web/.kobweb/server/logs/kobweb-server.log b/apps/shop/web/.kobweb/server/logs/kobweb-server.log index 8d5afebf..e4647c1a 100644 --- a/apps/shop/web/.kobweb/server/logs/kobweb-server.log +++ b/apps/shop/web/.kobweb/server/logs/kobweb-server.log @@ -1,7 +1,18 @@ -2024-06-25 22:14:07.155 [main] DEBUG ktor.application - Java Home: /Users/adrianwitaszak/.sdkman/candidates/java -2024-06-25 22:14:07.156 [main] DEBUG ktor.application - Class Loader: jdk.internal.loader.ClassLoaders$AppClassLoader@1cf4f579: [file:/Users/adrianwitaszak/CharLEEX/BeNatty/kotlin/BeNatty-Client/apps/shop/web/.kobweb/server/server.jar!/ch] -2024-06-25 22:14:07.167 [main] INFO ktor.application - No API jar file specified in conf.yaml. Server API routes will not be available. -2024-06-25 22:14:07.197 [main] INFO ktor.application - Application started in 0.076 seconds. -2024-06-25 22:14:07.274 [main] INFO ktor.application - Responding at http://0.0.0.0:8080 -2024-06-25 22:44:20.166 [kotlinx.coroutines.DefaultExecutor] INFO ktor.application - Kobweb server shutting down... -2024-06-25 22:44:22.248 [kotlinx.coroutines.DefaultExecutor] INFO ktor.application - Server finished shutting down. +2024-06-30 12:51:04.035 [main] DEBUG ktor.application - Java Home: /Users/adrianwitaszak/.sdkman/candidates/java +2024-06-30 12:51:04.036 [main] DEBUG ktor.application - Class Loader: jdk.internal.loader.ClassLoaders$AppClassLoader@1cf4f579: [file:/Users/adrianwitaszak/CharLEEX/BeNatty/kotlin/BeNatty-Client/apps/shop/web/.kobweb/server/server.jar!/ch] +2024-06-30 12:51:04.046 [main] INFO ktor.application - No API jar file specified in conf.yaml. Server API routes will not be available. +2024-06-30 12:51:04.076 [main] INFO ktor.application - Application started in 0.075 seconds. +2024-06-30 12:51:04.158 [main] INFO ktor.application - Responding at http://0.0.0.0:8080 +2024-06-30 12:51:22.281 [eventLoopGroupProxy-4-1] DEBUG ktor.application - Served fallback index.html file in response to "/" +2024-06-30 12:51:23.489 [eventLoopGroupProxy-4-1] DEBUG ktor.application - Client connected and is requesting kobweb status events. +2024-06-30 12:53:10.508 [eventLoopGroupProxy-4-2] DEBUG ktor.application - Served fallback index.html file in response to "/" +2024-06-30 12:53:11.080 [eventLoopGroupProxy-4-1] DEBUG ktor.application - Stopped sending kobweb status events, probably because client disconnected or server is shutting down. (ChannelWriteException: Cannot write to a channel) +2024-06-30 12:53:12.311 [eventLoopGroupProxy-4-2] DEBUG ktor.application - Client connected and is requesting kobweb status events. +2024-06-30 12:53:19.500 [eventLoopGroupProxy-4-3] DEBUG ktor.application - Served fallback index.html file in response to "/" +2024-06-30 12:53:19.906 [eventLoopGroupProxy-4-2] DEBUG ktor.application - Stopped sending kobweb status events, probably because client disconnected or server is shutting down. (ChannelWriteException: Cannot write to a channel) +2024-06-30 12:53:21.113 [eventLoopGroupProxy-4-3] DEBUG ktor.application - Client connected and is requesting kobweb status events. +2024-06-30 12:53:32.050 [eventLoopGroupProxy-4-4] DEBUG ktor.application - Served fallback index.html file in response to "/" +2024-06-30 12:53:33.124 [eventLoopGroupProxy-4-4] DEBUG ktor.application - Client connected and is requesting kobweb status events. +2024-06-30 12:53:39.672 [eventLoopGroupProxy-4-3] DEBUG ktor.application - Stopped sending kobweb status events, probably because client disconnected or server is shutting down. (ChannelWriteException: Cannot write to a channel) +2024-06-30 12:54:26.951 [kotlinx.coroutines.DefaultExecutor] INFO ktor.application - Kobweb server shutting down... +2024-06-30 12:54:29.041 [kotlinx.coroutines.DefaultExecutor] INFO ktor.application - Server finished shutting down. diff --git a/apps/shop/web/.kobweb/server/server.jar b/apps/shop/web/.kobweb/server/server.jar index d97d0d16..b08a5126 100644 Binary files a/apps/shop/web/.kobweb/server/server.jar and b/apps/shop/web/.kobweb/server/server.jar differ diff --git a/apps/shop/web/src/jsMain/kotlin/web/components/sections/FooterContent.kt b/apps/shop/web/src/jsMain/kotlin/web/components/sections/FooterContent.kt index 7979bb8e..7c383749 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/components/sections/FooterContent.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/components/sections/FooterContent.kt @@ -180,7 +180,7 @@ private fun FollowUsSection( ) { AppOutlinedTextField( text = state.connectEmail, - onTextChanged = { vm.trySend(FooterContract.Inputs.SetConnectEmail(it)) }, + onTextChange = { vm.trySend(FooterContract.Inputs.SetConnectEmail(it)) }, placeholder = getString(Strings.JoinOurEmailList), autoComplete = AutoComplete.email, modifier = Modifier diff --git a/apps/shop/web/src/jsMain/kotlin/web/components/widgets/TextField.kt b/apps/shop/web/src/jsMain/kotlin/web/components/widgets/TextField.kt index 43218ac3..b9c39058 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/components/widgets/TextField.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/components/widgets/TextField.kt @@ -10,9 +10,7 @@ import com.varabyte.kobweb.compose.ui.modifiers.fillMaxWidth import com.varabyte.kobweb.compose.ui.modifiers.height import com.varabyte.kobweb.compose.ui.modifiers.lineHeight import com.varabyte.kobweb.compose.ui.modifiers.padding -import com.varabyte.kobweb.silk.components.forms.InputDefaults import com.varabyte.kobweb.silk.components.forms.TextInput -import com.varabyte.kobweb.silk.components.style.ComponentVariant import com.varabyte.kobweb.silk.theme.colors.ColorMode import com.varabyte.kobweb.silk.theme.colors.palette.background import com.varabyte.kobweb.silk.theme.colors.palette.toPalette @@ -25,9 +23,8 @@ import web.AppColors @Composable fun AppOutlinedTextField( text: String, - onTextChanged: (String) -> Unit, + onTextChange: (String) -> Unit, modifier: Modifier = Modifier, - variant: ComponentVariant? = InputDefaults.Variant, placeholder: String? = null, password: Boolean = false, enabled: Boolean = true, @@ -42,7 +39,7 @@ fun AppOutlinedTextField( ) { TextInput( text = text, - onTextChanged = onTextChanged, + onTextChange = onTextChange, placeholder = placeholder, spellCheck = spellCheck, autoComplete = autoComplete, @@ -53,7 +50,6 @@ fun AppOutlinedTextField( readOnly = readOnly, onCommit = onCommit, ref = ref, - variant = variant, focusBorderColor = AppColors.brandColor, modifier = modifier .fillMaxWidth() diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/RouterContent.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/RouterContent.kt index e1cfc716..96961047 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/RouterContent.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/RouterContent.kt @@ -65,7 +65,7 @@ fun RouterContent( isAuthenticated: Boolean, onError: (String) -> Unit, homeScreen: Screen = Screen.Home, - loginScreen: Screen = Screen.Login, + loginScreen: Screen = Screen.Home, ) { val scope = rememberCoroutineScope() val initialRoute = when (isAuthenticated) { diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/account/profile/ProfilePage.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/account/profile/ProfilePage.kt index 2c0d6f32..a264083d 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/account/profile/ProfilePage.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/account/profile/ProfilePage.kt @@ -69,14 +69,14 @@ private fun PersonalDetails(vm: ProfileViewModel, state: ProfileContract.State) } AppOutlinedTextField( text = state.detailsFirstName, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetDetailsFullName(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetDetailsFullName(it)) }, placeholder = getString(Strings.FirstName), autoComplete = AutoComplete.givenName, modifier = Modifier.fillMaxWidth(), ) AppOutlinedTextField( text = state.email, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetEmail(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetEmail(it)) }, placeholder = getString(Strings.Email), required = true, autoComplete = AutoComplete.email, @@ -84,7 +84,7 @@ private fun PersonalDetails(vm: ProfileViewModel, state: ProfileContract.State) ) AppOutlinedTextField( text = state.phone, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetPhone(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetPhone(it)) }, placeholder = getString(Strings.Phone), autoComplete = AutoComplete.tel, modifier = Modifier.fillMaxWidth(), @@ -103,13 +103,13 @@ fun Password(vm: ProfileViewModel, state: ProfileContract.State) { ) AppOutlinedTextField( text = state.oldPassword, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetOldPassword(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetOldPassword(it)) }, placeholder = getString(Strings.OldPassword), modifier = Modifier.fillMaxWidth(), ) AppOutlinedTextField( text = state.newPassword, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetNewPassword(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetNewPassword(it)) }, placeholder = getString(Strings.NewPassword), modifier = Modifier.fillMaxWidth(), ) @@ -135,14 +135,14 @@ private fun Address(vm: ProfileViewModel, state: ProfileContract.State) { } AppOutlinedTextField( text = state.address, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetAddress(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetAddress(it)) }, placeholder = getString(Strings.Address), autoComplete = AutoComplete.streetAddress, modifier = Modifier.fillMaxWidth(), ) AppOutlinedTextField( text = state.additionalInformation, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetAdditionalInformation(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetAdditionalInformation(it)) }, placeholder = getString(Strings.Company), autoComplete = AutoComplete.ccAdditionalName, modifier = Modifier.fillMaxWidth(), @@ -154,14 +154,14 @@ private fun Address(vm: ProfileViewModel, state: ProfileContract.State) { ) { AppOutlinedTextField( text = state.postcode, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetPostcode(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetPostcode(it)) }, placeholder = getString(Strings.PostCode), autoComplete = AutoComplete.postalCode, modifier = Modifier.weight(1f), ) AppOutlinedTextField( text = state.city, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetCity(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetCity(it)) }, placeholder = getString(Strings.City), autoComplete = AutoComplete.addressLevel2, modifier = Modifier.weight(1f) @@ -174,14 +174,14 @@ private fun Address(vm: ProfileViewModel, state: ProfileContract.State) { ) { AppOutlinedTextField( text = state.state, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetState(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetState(it)) }, placeholder = getString(Strings.Apartment), autoComplete = AutoComplete.addressLevel1, modifier = Modifier.weight(1f), ) AppOutlinedTextField( text = state.country, - onTextChanged = { vm.trySend(ProfileContract.Inputs.SetCountry(it)) }, + onTextChange = { vm.trySend(ProfileContract.Inputs.SetCountry(it)) }, placeholder = getString(Strings.Country), autoComplete = AutoComplete.countryName, modifier = Modifier.weight(1f) diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/auth/ForgotPasswordPage.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/auth/ForgotPasswordPage.kt index 74d4817d..aed2351a 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/auth/ForgotPasswordPage.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/auth/ForgotPasswordPage.kt @@ -104,7 +104,7 @@ private fun ForgotPassword( ) AppOutlinedTextField( text = email, - onTextChanged = { + onTextChange = { email = it vm.trySend(ForgotPasswordContract.Inputs.SetEmail(it)) }, diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/auth/LoginPage.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/auth/LoginPage.kt index 9a43534b..cea56ea5 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/auth/LoginPage.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/auth/LoginPage.kt @@ -119,7 +119,7 @@ private fun FieldsSection( AppOutlinedTextField( text = email, - onTextChanged = { + onTextChange = { email = it vm.trySend(LoginContract.Inputs.SetEmail(it)) }, @@ -131,7 +131,7 @@ private fun FieldsSection( ) AppOutlinedTextField( text = password, - onTextChanged = { + onTextChange = { password = it vm.trySend(LoginContract.Inputs.SetPassword(it)) }, diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/auth/RegisterPage.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/auth/RegisterPage.kt index fc12c39f..0e5fcc5d 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/auth/RegisterPage.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/auth/RegisterPage.kt @@ -109,7 +109,7 @@ private fun FieldsSection( AppOutlinedTextField( text = name, - onTextChanged = { + onTextChange = { name = it vm.trySend(RegisterContract.Inputs.SetName(it)) }, @@ -119,7 +119,7 @@ private fun FieldsSection( ) AppOutlinedTextField( text = email, - onTextChanged = { + onTextChange = { email = it vm.trySend(RegisterContract.Inputs.SetEmail(it)) }, @@ -131,7 +131,7 @@ private fun FieldsSection( ) AppOutlinedTextField( text = password, - onTextChanged = { + onTextChange = { password = it vm.trySend(RegisterContract.Inputs.SetPassword(it)) }, @@ -143,7 +143,7 @@ private fun FieldsSection( ) AppOutlinedTextField( text = repeatPassword, - onTextChanged = { + onTextChange = { repeatPassword = it vm.trySend(RegisterContract.Inputs.SetRepeatPassword(it)) }, diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/auth/UpdatePassword.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/auth/UpdatePassword.kt index 22f65798..9acb7c76 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/auth/UpdatePassword.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/auth/UpdatePassword.kt @@ -99,7 +99,7 @@ fun UpdatingPassword( AppOutlinedTextField( text = state.password, - onTextChanged = { + onTextChange = { password = it vm.trySend(UpdatePasswordContract.Inputs.SetPassword(it)) }, diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/home/HomeSubscribe.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/home/HomeSubscribe.kt index 6e9a29b0..9d46d8eb 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/home/HomeSubscribe.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/home/HomeSubscribe.kt @@ -61,7 +61,7 @@ fun HomeSubscribe( ) { AppOutlinedTextField( text = state.email, - onTextChanged = { vm.trySend(HomeContract.Inputs.OnEmailChange(it)) }, + onTextChange = { vm.trySend(HomeContract.Inputs.OnEmailChange(it)) }, placeholder = getString(Strings.EmailAddress), autoComplete = AutoComplete.email, modifier = Modifier diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/home/Slideshow.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/home/Slideshow.kt index d9fda7a3..d367ed78 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/home/Slideshow.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/home/Slideshow.kt @@ -98,7 +98,7 @@ fun Slideshow( state: HomeContract.State, height: CSSLengthOrPercentageNumericValue = 800.px ) { - val items = state.landingConfig.slideshowItems + val items = state.slideshowItems val slideshowModifier = Modifier .fillMaxWidth() diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/product/catalogue/CatalogFilters.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/product/catalogue/CatalogFilters.kt index 0b751ed8..f3a32afb 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/product/catalogue/CatalogFilters.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/product/catalogue/CatalogFilters.kt @@ -210,12 +210,12 @@ private fun PriceFilters(vm: CatalogViewModel, state: CatalogContract.State) { ) { AppOutlinedTextField( text = state.priceFrom ?: "", - onTextChanged = { vm.trySend(CatalogContract.Inputs.OnPriceFromChanged(it)) }, + onTextChange = { vm.trySend(CatalogContract.Inputs.OnPriceFromChanged(it)) }, placeholder = getString(Strings.From), ) AppOutlinedTextField( text = state.priceTo ?: "", - onTextChanged = { vm.trySend(CatalogContract.Inputs.OnPriceToChanged(it)) }, + onTextChange = { vm.trySend(CatalogContract.Inputs.OnPriceToChanged(it)) }, placeholder = getString(Strings.To), ) } diff --git a/apps/shop/web/src/jsMain/kotlin/web/pages/product/page/dialogs/AskQuestionDialog.kt b/apps/shop/web/src/jsMain/kotlin/web/pages/product/page/dialogs/AskQuestionDialog.kt index 19ad3ac0..b746b233 100644 --- a/apps/shop/web/src/jsMain/kotlin/web/pages/product/page/dialogs/AskQuestionDialog.kt +++ b/apps/shop/web/src/jsMain/kotlin/web/pages/product/page/dialogs/AskQuestionDialog.kt @@ -90,7 +90,7 @@ fun AskQuestionDialog( ) { AppOutlinedTextField( text = state.askQuestionName, - onTextChanged = { vm.trySend(ProductPageContract.Inputs.OnAskQuestionNameChanged(it)) }, + onTextChange = { vm.trySend(ProductPageContract.Inputs.OnAskQuestionNameChanged(it)) }, placeholder = getString(Strings.Name), modifier = Modifier .weight(1f) @@ -99,7 +99,7 @@ fun AskQuestionDialog( ) AppOutlinedTextField( text = state.askQuestionEmail, - onTextChanged = { vm.trySend(ProductPageContract.Inputs.OnAskQuestionEmailChanged(it)) }, + onTextChange = { vm.trySend(ProductPageContract.Inputs.OnAskQuestionEmailChanged(it)) }, placeholder = getString(Strings.Email), required = true, valid = state.askQuestionEmailError == null, @@ -112,7 +112,7 @@ fun AskQuestionDialog( } AppOutlinedTextField( text = state.askQuestionQuestion, - onTextChanged = { vm.trySend(ProductPageContract.Inputs.OnAskQuestionQuestionChanged(it)) }, + onTextChange = { vm.trySend(ProductPageContract.Inputs.OnAskQuestionQuestionChanged(it)) }, placeholder = getString(Strings.Comment), required = true, valid = state.askQuestionQuestionError == null, diff --git a/data/build.gradle.kts b/data/build.gradle.kts index f8fdf37e..1fa76e84 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -49,8 +49,9 @@ kotlin { } } -private val serverUrlGraphQl: String = - System.getenv("server.url.graphql")?.toString() ?: error("No server.url.graphql property found") +private val serverUrlGraphQl: String = "https://be-natty-server-ef8e2a031806.herokuapp.com/graphql" +// property("server.url.graphql")?.toString() +// ?: error("No server.url.graphql property found") apollo { service(libs.versions.projectName.get()) { @@ -66,8 +67,10 @@ apollo { buildkonfig { packageName = project.name - val dbName: String = System.getenv("db.name")?.toString() ?: error("No db.name property found") - val orgName: String = System.getenv("org.name")?.toString() ?: error("No org.name property found") + val dbName: String = "benatty" +// property("db.name")?.toString() ?: error("No db.name property found") + val orgName: String = "CharLEE X" +// property("org.name")?.toString() ?: error("No org.name property found") defaultConfigs { buildConfigField(FieldSpec.Type.STRING, "serverUrlGraphQl", serverUrlGraphQl) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 64ae7ffa..ac5b1c6b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,10 @@ [versions] # CONFIG -------------------------------------------------------------------------------------------------------------- +projectName = "BeNATTY" +packageName = "com.charleex.benatty" android-compileSdk = "34" android-minSdk = "26" android-targetSdk = "34" -projectName = "nataliashop" -packageName = "com.charleex.benatty" jvmTarget = "21" # VERSIONS ----------------------------------------------------------------------------------------------------------- @@ -26,7 +26,7 @@ google-services = "4.4.1" kamelImage = "0.8.3" kermit = "2.0.2" kmpnotifier = "0.1.9" -kobweb = "0.17.1" +kobweb = "0.18.2" koin = "3.5.3" koin-compose = "1.1.2" koinKtor = "3.5.3" @@ -47,6 +47,7 @@ playServicesMaps = "18.2.0" security = "1.1.0-alpha06" turbine = "1.0.0" uuid = "0.8.2" +spotless = "6.25.0" [libraries] androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" } @@ -123,6 +124,8 @@ okio = { module = "com.squareup.okio:okio", version.ref = "okio" } paging-compose-common = { module = "app.cash.paging:paging-compose-common", version.ref = "pagingComposeCommon" } +spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" } + test-koin = { module = "io.insert-koin:koin-test", version.ref = "koin" } test-kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } test-kotlin-koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" }