-
Notifications
You must be signed in to change notification settings - Fork 142
[Woo POS][Refunds] Allow adding refund reason #15173
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
Merged
samiuelson
merged 18 commits into
trunk
from
woomob-1775-woo-posrefunds-allow-adding-a-refund-reason-while-creating-a
Jan 20, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d553008
Allow adding refund reason
samiuelson ee467a1
Merge branch 'woomob-1855-create-refund' into woomob-1775-woo-posrefu…
samiuelson 742520b
Update UI
samiuelson 15f3396
Refactor refund dialog and view model for improved event handling
samiuelson f67b691
Remove unused string
samiuelson 8b9d6ed
Handle text overflow
samiuelson 6bbaf0f
Show "Edit reason" button text instead of "Add" if reason is not blank
samiuelson cf95aa0
Add test
samiuelson e6492be
Revert original reason if reason editing is canceled
samiuelson a86a148
Update buttons' texts
samiuelson 76315da
Revert refund reason to original value when editing and dialog is dis…
samiuelson 9acf1eb
Handle system back press
samiuelson 15f2256
Clean up code
samiuelson 8830629
Clean up code
samiuelson ad3424d
Merge trunk into woomob-1775
samiuelson 7fcee54
Refactor refund reason flow to use nav host controller
samiuelson be8bd8f
Clean up code
samiuelson a074d7e
Merge branch 'trunk' into woomob-1775-woo-posrefunds-allow-adding-a-r…
samiuelson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
...m/woocommerce/android/ui/woopos/common/composeui/component/WooPosFullScreenInputLayout.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| package com.woocommerce.android.ui.woopos.common.composeui.component | ||
|
|
||
| import androidx.activity.compose.BackHandler | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.Spacer | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.imePadding | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.rememberScrollState | ||
| import androidx.compose.foundation.verticalScroll | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.tooling.preview.PreviewFontScale | ||
| import com.woocommerce.android.ui.woopos.common.composeui.designsystem.WooPosSpacing | ||
| import com.woocommerce.android.ui.woopos.common.composeui.designsystem.WooPosTheme | ||
| import com.woocommerce.android.ui.woopos.common.composeui.designsystem.WooPosTypography | ||
|
|
||
| @Composable | ||
| fun WooPosFullScreenInputLayout( | ||
| modifier: Modifier = Modifier, | ||
| titleText: String, | ||
| onBackClicked: () -> Unit, | ||
| centerContent: @Composable () -> Unit, | ||
| buttonText: String, | ||
| buttonState: WooPosButtonState = WooPosButtonState.ENABLED, | ||
| onButtonClicked: () -> Unit, | ||
| topContent: (@Composable () -> Unit)? = null, | ||
| bottomContent: (@Composable () -> Unit)? = null | ||
| ) { | ||
| BackHandler { onBackClicked() } | ||
|
|
||
| Column( | ||
| modifier = modifier.fillMaxSize() | ||
| ) { | ||
| WooPosToolbar( | ||
| titleText = titleText, | ||
| onBackClicked = onBackClicked, | ||
| ) | ||
|
|
||
| Column( | ||
| modifier = Modifier | ||
| .fillMaxSize() | ||
| .verticalScroll(rememberScrollState()) | ||
| .imePadding(), | ||
| verticalArrangement = Arrangement.SpaceBetween | ||
| ) { | ||
| topContent?.invoke() | ||
|
|
||
| Spacer(modifier = Modifier.weight(1f)) | ||
|
|
||
| centerContent() | ||
|
|
||
| if (bottomContent != null) { | ||
| bottomContent() | ||
| } | ||
|
|
||
| Spacer(modifier = Modifier.weight(1f)) | ||
|
|
||
| WooPosButton( | ||
| text = buttonText, | ||
| onClick = onButtonClicked, | ||
| state = buttonState, | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .padding(WooPosSpacing.Medium.value) | ||
| ) | ||
|
|
||
| Spacer(modifier = Modifier.height(WooPosSpacing.Small.value)) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Composable | ||
| @PreviewFontScale | ||
| fun WooPosFullScreenInputLayoutPreview() { | ||
| WooPosTheme { | ||
| WooPosFullScreenInputLayout( | ||
| titleText = "Enter Information", | ||
| onBackClicked = {}, | ||
| centerContent = { | ||
| Column( | ||
| modifier = Modifier.fillMaxWidth(), | ||
| horizontalAlignment = Alignment.CenterHorizontally | ||
| ) { | ||
| WooPosText( | ||
| text = "Sample Input", | ||
| style = WooPosTypography.Heading, | ||
| color = MaterialTheme.colorScheme.onSurface | ||
| ) | ||
| } | ||
| }, | ||
| buttonText = "Save", | ||
| onButtonClicked = {} | ||
| ) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.