mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3593 Primitives | Fix | Disable type title update when restriction is present (#2358)
This commit is contained in:
parent
fd1c45f780
commit
3b94345d5f
4 changed files with 15 additions and 0 deletions
|
@ -181,6 +181,14 @@ class ObjectTypeFragment : BaseComposeFragment() {
|
|||
onDismissRequest = vm::hideError
|
||||
)
|
||||
}
|
||||
UiErrorState.Reason.ErrorEditingTypeDetails -> {
|
||||
BaseAlertDialog(
|
||||
dialogText = stringResource(R.string.object_type_edit_type_details_error),
|
||||
buttonText = stringResource(id = R.string.membership_error_button_text_dismiss),
|
||||
onButtonClick = vm::hideError,
|
||||
onDismissRequest = vm::hideError
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,6 +211,7 @@ sealed class UiErrorState {
|
|||
|
||||
sealed class Reason {
|
||||
data class ErrorGettingObjects(val msg: String) : Reason()
|
||||
data object ErrorEditingTypeDetails : Reason()
|
||||
data class Other(val msg: String) : Reason()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1172,6 +1172,11 @@ class ObjectTypeViewModel(
|
|||
"showTitleAndIconUpdateScreen, initialIcon: $initialIcon, " +
|
||||
"initialTitle: $initialTitle, initialPlural: $initialPlural"
|
||||
)
|
||||
val isPossibleToUpdateTitle = _objectTypePermissionsState.value?.canEditDetails == true
|
||||
if (!isPossibleToUpdateTitle) {
|
||||
errorState.value = Show(ErrorEditingTypeDetails)
|
||||
return
|
||||
}
|
||||
uiTitleAndIconUpdateState.value = UiTypeSetupTitleAndIconState.Visible.EditType(
|
||||
icon = initialIcon,
|
||||
initialTitle = initialTitle,
|
||||
|
|
|
@ -1901,6 +1901,7 @@ Please provide specific details of your needs here.</string>
|
|||
<string name="object_properties_empty_state">No properties yet. Add some to this type</string>
|
||||
|
||||
<string name="object_type_open_type_error">Failed to open the object type</string>
|
||||
<string name="object_type_edit_type_details_error">Editing this type is not allowed.</string>
|
||||
|
||||
<string name="day_of_week_monday">Monday</string>
|
||||
<string name="day_of_week_tuesday">Tuesday</string>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue