Skip to content

Commit ab01a0a

Browse files
Merge pull request #35 from Arinyadav1/Implement-Create-Group-Add-Members-Form
feat(group): implement add member feature in create group module.
2 parents 780318f + 3dc80bc commit ab01a0a

17 files changed

Lines changed: 266 additions & 68 deletions

File tree

cmp-android/src/main/kotlin/cmp/android/app/ComponentActivityExtensions.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@ fun ComponentActivity.setupEdgeToEdge(appThemeFlow: Flow<org.mifos.core.model.us
5454
// This handles all the settings to go edge-to-edge. We are using a transparent
5555
// scrim for system bars and switching between "light" and "dark" based on the
5656
// system and internal app theme settings.
57-
val style = SystemBarStyle.auto(
58-
darkScrim = SCRIM_COLOR,
59-
lightScrim = SCRIM_COLOR,
60-
detectDarkMode = { isDarkMode },
61-
)
62-
enableEdgeToEdge(statusBarStyle = style, navigationBarStyle = style)
57+
val statusBarStyle = if (isDarkMode) {
58+
SystemBarStyle.dark(SCRIM_COLOR)
59+
} else {
60+
SystemBarStyle.light(SCRIM_COLOR, SCRIM_COLOR)
61+
}
62+
val navigationBarStyle = if (isDarkMode) {
63+
SystemBarStyle.dark(SCRIM_COLOR)
64+
} else {
65+
SystemBarStyle.light(SCRIM_COLOR, SCRIM_COLOR)
66+
}
67+
enableEdgeToEdge(statusBarStyle = statusBarStyle, navigationBarStyle = navigationBarStyle)
6368
}
6469
}
6570
}

core-base/ui/src/commonMain/kotlin/org/mifos/core/base/ui/screen/ScreenContent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private fun SkeletonLoadingContent(
178178
Column(
179179
modifier = modifier
180180
.fillMaxSize()
181-
.padding(spacing.md)
181+
.padding(vertical = spacing.md)
182182
.semantics {
183183
contentDescription = "Loading"
184184
liveRegion = LiveRegionMode.Polite

core/common/src/commonMain/kotlin/org/mifos/core/common/Constants.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ package org.mifos.core.common
1212
object Constants {
1313
const val SELF_SERVICE_USER = "Self Service User"
1414
const val MEMBER_SAVINGS_ACCOUNTS = "memberSavingsAccounts"
15+
const val SAVINGS_ACCOUNTS = "savingsAccounts"
1516
const val DATE_FORMAT_SHORT_MONTH = "dd/MM/yyyy"
1617
const val LOCALE_EN = "en"
1718
}

core/designsystem/src/commonMain/kotlin/org/mifos/core/designsystem/component/KptSelectableItemCard.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ fun KptSelectableItemCard(
5353
modifier = modifier
5454
.fillMaxWidth()
5555
.padding(
56-
horizontal = KptTheme.spacing.md,
5756
vertical = KptTheme.spacing.xs,
5857
)
5958
.clip(KptTheme.shapes.medium)

core/model/src/commonMain/kotlin/org/mifos/core/model/group/CreateGroupRequest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
package org.mifos.core.model.group
1111

1212
data class CreateGroupRequest(
13-
val officeId: String,
13+
val officeId: Long,
1414
val name: String,
1515
val externalId: String,
16-
val clientMembers: List<String>? = null,
16+
val clientMembers: List<Long>? = null,
1717
val dateFormat: String,
1818
val locale: String,
1919
val active: Boolean? = null,

core/network/src/commonMain/kotlin/org/mifos/core/network/fineract/group/dto/CreateGroupRequestDto.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import kotlinx.serialization.Serializable
1313

1414
@Serializable
1515
data class CreateGroupRequestDto(
16-
val officeId: String,
16+
val officeId: Long,
1717
val name: String,
1818
val externalId: String,
19-
val clientMembers: List<String>? = null,
19+
val clientMembers: List<Long>? = null,
2020
val dateFormat: String,
2121
val locale: String,
2222
val active: Boolean? = null,

core/ui/src/commonMain/kotlin/org/mifos/core/ui/component/KptItemCard.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ fun KptItemCard(
6262
modifier = modifier
6363
.fillMaxWidth()
6464
.padding(
65-
horizontal = MaterialTheme.spacing.lg,
6665
vertical = MaterialTheme.spacing.xs,
6766
)
6867
.clickable(onClick = onClick),

core/ui/src/commonMain/kotlin/org/mifos/core/ui/input/KptDropdownSearchBar.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ data class KptDropdownSearchBarItem(
5151
)
5252

5353
/**
54-
* Defaults for the dropdown search bar.
54+
* Default configurations for the Dropdown Search Bar.
5555
*/
5656
object KptDropdownSearchBarDefaults
5757

@@ -68,6 +68,7 @@ fun KptDropdownSearchBar(
6868
onDismissRequest: () -> Unit,
6969
isSearching: Boolean,
7070
modifier: Modifier = Modifier,
71+
label: String? = null,
7172
) {
7273
val density = LocalDensity.current
7374
var searchBarWidth by remember { mutableStateOf(0) }
@@ -98,6 +99,7 @@ fun KptDropdownSearchBar(
9899
contentAlignment = Alignment.TopStart,
99100
) {
100101
KptSearchBar(
102+
label = label,
101103
query = query,
102104
onQueryChange = onQueryChange,
103105
placeholder = placeholder,
@@ -114,8 +116,7 @@ fun KptDropdownSearchBar(
114116
)
115117

116118
if (showMenu && searchBarWidth > 0) {
117-
val horizontalPaddingPx =
118-
with(density) { MaterialTheme.spacing.lg.roundToPx() }
119+
val horizontalPaddingPx = 0
119120
val verticalPaddingPx = with(density) { MaterialTheme.spacing.md.roundToPx() }
120121
val cardWidthDp = with(density) { (searchBarWidth - horizontalPaddingPx * 2).toDp() }
121122

@@ -127,14 +128,14 @@ fun KptDropdownSearchBar(
127128
Surface(
128129
modifier = Modifier
129130
.width(cardWidthDp)
130-
.heightIn(max = 200.dp),
131+
.heightIn(max = 300.dp),
131132
shape = RoundedCornerShape(
132133
topStart = 0.dp,
133134
topEnd = 0.dp,
134135
bottomStart = KptTheme.spacing.md,
135136
bottomEnd = KptTheme.spacing.md,
136137
),
137-
color = KptTheme.colorScheme.inverseOnSurface,
138+
color = KptTheme.colorScheme.surfaceContainer,
138139
tonalElevation = 0.dp,
139140
shadowElevation = KptTheme.elevation.level2,
140141
) {

core/ui/src/commonMain/kotlin/org/mifos/core/ui/input/KptSearchBar.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import androidx.compose.material3.Icon
1515
import androidx.compose.material3.MaterialTheme
1616
import androidx.compose.runtime.Composable
1717
import androidx.compose.ui.Modifier
18-
import androidx.compose.ui.graphics.Color
1918
import androidx.compose.ui.graphics.Shape
2019
import org.mifos.core.base.designsystem.theme.KptTheme
2120
import org.mifos.core.designsystem.icon.AppIcons
@@ -27,17 +26,19 @@ fun KptSearchBar(
2726
onQueryChange: (String) -> Unit,
2827
placeholder: String,
2928
modifier: Modifier = Modifier,
30-
containerColor: Color = KptTheme.colorScheme.inverseOnSurface,
29+
label: String? = null,
3130
shape: Shape = KptTheme.shapes.large,
31+
enabled: Boolean = true,
3232
trailingIcon: (@Composable () -> Unit)? = null,
3333
) {
3434
KptTextField(
35+
enabled = enabled,
3536
value = query,
37+
label = label,
3638
onValueChange = onQueryChange,
3739
modifier = modifier
3840
.fillMaxWidth()
3941
.padding(
40-
horizontal = MaterialTheme.spacing.lg,
4142
vertical = MaterialTheme.spacing.md,
4243
),
4344
placeholder = placeholder,
@@ -50,10 +51,6 @@ fun KptSearchBar(
5051
},
5152
trailingIcon = trailingIcon,
5253
shape = shape,
53-
colors = KptTextFieldDefaults.textFieldColors(
54-
focusedContainerColor = containerColor,
55-
unfocusedContainerColor = containerColor,
56-
),
5754
singleLine = true,
5855
)
5956
}

feature/groups/src/commonMain/composeResources/values/strings.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<string name="feature_groups_create_group_subtitle">Fill the details to get started</string>
7979
<string name="feature_groups_group_name_label">Group Name *</string>
8080
<string name="feature_groups_group_name_placeholder">Enter group name</string>
81-
<string name="feature_groups_external_id_label">External Id *</string>
81+
<string name="feature_groups_external_id_label">External Id</string>
8282
<string name="feature_groups_external_id_placeholder">Enter external ID</string>
8383
<string name="feature_groups_office_label">Office *</string>
8484
<string name="feature_groups_select_office_placeholder">Select office</string>
@@ -90,4 +90,5 @@
9090
<string name="feature_groups_create_group_success_message">Group created successfully.</string>
9191
<string name="feature_groups_activate_group_success_title">Success</string>
9292
<string name="feature_groups_activate_group_success_message">Group activated successfully.</string>
93+
<string name="feature_groups_activate_add_members">Add Members</string>
9394
</resources>

0 commit comments

Comments
 (0)