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

Bump dependencies #7482

Merged
merged 13 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/android-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ jobs:
- name: Fix git dir
run: git config --global --add safe.directory $(pwd)

- name: Create Android rustJniLibs dir
run: mkdir -p android/app/build/rustJniLibs/android

- name: Re-generate lockfile
run: android/scripts/update-lockfile.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fun NegativeButton(
),
isEnabled: Boolean = true,
isLoading: Boolean = false,
icon: @Composable (() -> Unit)? = null,
content: @Composable (() -> Unit)? = null,
) {
BaseButton(
onClick = onClick,
Expand All @@ -85,7 +85,7 @@ fun NegativeButton(
modifier = modifier,
isEnabled = isEnabled,
isLoading = isLoading,
trailingIcon = icon,
trailingIcon = content,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ private fun PreviewCheckableRelayLocationCell(
}
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun StatusRelayItemCell(
item: RelayItem,
Expand All @@ -89,7 +88,12 @@ fun StatusRelayItemCell(
item = item,
isSelected = isSelected,
state = state,
leadingContent = {
onClick = onClick,
onLongClick = onLongClick,
onToggleExpand = onToggleExpand,
isExpanded = isExpanded,
depth = depth,
content = {
if (isSelected) {
Icon(imageVector = Icons.Default.Check, contentDescription = null)
} else {
Expand All @@ -111,11 +115,6 @@ fun StatusRelayItemCell(
)
}
},
onClick = onClick,
onLongClick = onLongClick,
onToggleExpand = onToggleExpand,
isExpanded = isExpanded,
depth = depth,
)
}

Expand All @@ -126,12 +125,12 @@ fun RelayItemCell(
item: RelayItem,
isSelected: Boolean,
state: RelayListItemState?,
leadingContent: (@Composable RowScope.() -> Unit)? = null,
onClick: () -> Unit,
onLongClick: (() -> Unit)? = null,
onToggleExpand: ((Boolean) -> Unit),
onToggleExpand: (Boolean) -> Unit,
isExpanded: Boolean,
depth: Int,
content: @Composable (RowScope.() -> Unit)? = null,
) {

val leadingContentStartPadding = Dimens.cellStartPadding
Expand Down Expand Up @@ -162,8 +161,8 @@ fun RelayItemCell(
.weight(1f),
verticalAlignment = Alignment.CenterVertically,
) {
if (leadingContent != null) {
leadingContent()
if (content != null) {
content()
}
Name(name = item.name, state = state)
}
Expand Down Expand Up @@ -194,16 +193,16 @@ fun CheckableRelayLocationCell(
item = item,
isSelected = false,
state = null,
leadingContent = {
onClick = { onRelayCheckedChange(!checked) },
onToggleExpand = onExpand,
isExpanded = expanded,
depth = depth,
content = {
MullvadCheckbox(
checked = checked,
onCheckedChange = { isChecked -> onRelayCheckedChange(isChecked) },
)
},
onClick = { onRelayCheckedChange(!checked) },
onToggleExpand = onExpand,
isExpanded = expanded,
depth = depth,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fun SwitchCellView(
}
}

MullvadSwitch(checked = isToggled, enabled = isEnabled, onCheckedChange = onSwitchClicked)
MullvadSwitch(checked = isToggled, onCheckedChange = onSwitchClicked, enabled = isEnabled)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ fun MullvadExposedDropdownMenuBox(

@Composable
fun MullvadDropdownMenuItem(
leadingIcon: @Composable (() -> Unit)? = null,
text: String,
onClick: () -> Unit,
content: @Composable (() -> Unit)? = null,
) {
DropdownMenuItem(
leadingIcon = leadingIcon,
leadingIcon = content,
colors = menuItemColors,
text = { Text(text = text) },
onClick = onClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ private fun PreviewMullvadSwitch() {
) {
MullvadSwitch(checked = true, onCheckedChange = null)
MullvadSwitch(checked = false, onCheckedChange = null)
MullvadSwitch(checked = true, enabled = false, onCheckedChange = null)
MullvadSwitch(checked = false, enabled = false, onCheckedChange = null)
MullvadSwitch(checked = true, onCheckedChange = null, enabled = false)
MullvadSwitch(checked = false, onCheckedChange = null, enabled = false)
}
}
}
Expand All @@ -46,19 +46,19 @@ fun MullvadSwitch(
checked: Boolean,
onCheckedChange: ((Boolean) -> Unit)?,
modifier: Modifier = Modifier,
thumbContent: (@Composable () -> Unit)? = {
// This is needed to ensure the thumb always is big in off mode
Spacer(modifier = Modifier.size(Dimens.switchIconSize))
},
enabled: Boolean = true,
colors: SwitchColors = mullvadSwitchColors(),
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
content: @Composable (() -> Unit)? = {
// This is needed to ensure the thumb always is big in off mode
Spacer(modifier = Modifier.size(Dimens.switchIconSize))
},
) {
Switch(
checked = checked,
onCheckedChange = onCheckedChange,
modifier = modifier.testTag(SWITCH_TEST_TAG),
thumbContent = thumbContent,
thumbContent = content,
enabled = enabled,
colors = colors,
interactionSource = interactionSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ class AccountUiStatePreviewParameterProvider : PreviewParameterProvider<AccountU
showManageAccountLoading = false,
)
) + generateOtherStates()
}

private fun generateOtherStates(): Sequence<AccountUiState> =
sequenceOf(
PaymentState.Loading,
PaymentState.NoPayment,
PaymentState.NoProductsFounds,
PaymentState.Error.Billing,
)
.map { state ->
AccountUiState(
deviceName = "Test Name",
accountNumber = AccountNumber("1234123412341234"),
accountExpiry = null,
showSitePayment = false,
billingPaymentState = state,
showLogoutLoading = false,
showManageAccountLoading = false,
private fun generateOtherStates(): Sequence<AccountUiState> =
sequenceOf(
PaymentState.Loading,
PaymentState.NoPayment,
PaymentState.NoProductsFounds,
PaymentState.Error.Billing,
)
}
.map { state ->
AccountUiState(
deviceName = "Test Name",
accountNumber = AccountNumber("1234123412341234"),
accountExpiry = null,
showSitePayment = false,
billingPaymentState = state,
showLogoutLoading = false,
showManageAccountLoading = false,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,36 +37,36 @@ object TunnelStatePreviewData {
TunnelState.Error(
errorState = ErrorState(cause = ErrorStateCause.DnsError, isBlocking = isBlocking)
)
}

private fun generateTunnelEndpoint(quantumResistant: Boolean, daita: Boolean): TunnelEndpoint =
TunnelEndpoint(
endpoint = generateEndpoint(TransportProtocol.Udp),
quantumResistant = quantumResistant,
obfuscation =
ObfuscationEndpoint(
endpoint = generateEndpoint(TransportProtocol.Tcp),
ObfuscationType.Udp2Tcp,
),
daita = daita,
)
private fun generateTunnelEndpoint(quantumResistant: Boolean, daita: Boolean): TunnelEndpoint =
TunnelEndpoint(
endpoint = generateEndpoint(TransportProtocol.Udp),
quantumResistant = quantumResistant,
obfuscation =
ObfuscationEndpoint(
endpoint = generateEndpoint(TransportProtocol.Tcp),
ObfuscationType.Udp2Tcp,
),
daita = daita,
)

private fun generateEndpoint(transportProtocol: TransportProtocol) =
Endpoint(address = InetSocketAddress(DEFAULT_ENDPOINT_PORT), protocol = transportProtocol)
private fun generateEndpoint(transportProtocol: TransportProtocol) =
Endpoint(address = InetSocketAddress(DEFAULT_ENDPOINT_PORT), protocol = transportProtocol)

private fun generateLocation(): GeoIpLocation =
GeoIpLocation(
ipv4 = null,
ipv6 = null,
country = "",
city = "",
hostname = "",
entryHostname = "",
latitude = 0.0,
longitude = 0.0,
)
private fun generateLocation(): GeoIpLocation =
GeoIpLocation(
ipv4 = null,
ipv6 = null,
country = "",
city = "",
hostname = "",
entryHostname = "",
latitude = 0.0,
longitude = 0.0,
)

private fun generateFeatureIndicators(size: Int): List<FeatureIndicator> =
FeatureIndicator.entries.subList(0, size)
private fun generateFeatureIndicators(size: Int): List<FeatureIndicator> =
FeatureIndicator.entries.subList(0, size)
}

private const val DEFAULT_ENDPOINT_PORT = 100
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ private fun ApiAccessMethodTypeSelection(
close()
onTypeSelected(it)
},
leadingIcon = {
content = {
Icon(
imageVector = Icons.Default.Check,
contentDescription = null,
Expand Down Expand Up @@ -510,7 +510,7 @@ private fun CipherSelection(cipher: Cipher, onCipherChange: (Cipher) -> Unit) {
close()
onCipherChange(it)
},
leadingIcon = {
content = {
Icon(
imageVector = Icons.Default.Check,
contentDescription = null,
Expand Down Expand Up @@ -549,7 +549,7 @@ private fun EnableAuthentication(
close()
onToggleAuthenticationEnabled(true)
},
leadingIcon = {
content = {
Icon(
imageVector = Icons.Default.Check,
contentDescription = null,
Expand All @@ -565,7 +565,7 @@ private fun EnableAuthentication(
close()
onToggleAuthenticationEnabled(false)
},
leadingIcon = {
content = {
Icon(
imageVector = Icons.Default.Check,
contentDescription = null,
Expand Down
Loading
Loading