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

ADST-431 #345

Merged
merged 6 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Context
import android.view.View
import androidx.annotation.StringRes
import com.alfresco.Logger
import com.alfresco.content.GetMultipleContents.Companion.MAX_FILE_SIZE_10
import com.alfresco.content.data.APIEvent
import com.alfresco.content.data.AnalyticsManager
import com.alfresco.content.data.Entry
Expand Down Expand Up @@ -55,9 +56,10 @@ interface Action {
ex.message == ERROR_FILE_SIZE_EXCEED -> {
bus.send(Error(context.getString(R.string.error_file_size_exceed)))
}

entry is Entry && (entry as Entry).uploadServer == UploadServerType.UPLOAD_TO_PROCESS &&
ex.message == ERROR_FILE_SIZE_EXCEED -> {
bus.send(Error(context.getString(R.string.error_file_size_exceed_10mb)))
bus.send(Error(context.getString(R.string.error_file_size_exceed_10mb, MAX_FILE_SIZE_10)))
}
}
} catch (ex: Exception) {
Expand Down
2 changes: 1 addition & 1 deletion capture/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
<string name="format_video_duration_hour" translatable="false">%02d:%02d:%02d</string>
<string name="format_video_duration_minute" translatable="false">%02d:%02d</string>
<string name="error_file_size_exceed">The selected file size cannot exceed 100MB to upload.</string>
<string name="error_file_size_exceed_10mb">The selected file size cannot exceed 10MB to upload.</string>
<string name="error_file_size_exceed_10mb">The selected file size cannot exceed %d MB to upload.</string>

</resources>
1 change: 1 addition & 0 deletions component/src/main/res/layout/view_actions_list_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
style="@style/Widget.Alfresco.Component.Primary"
android:layout_width="0dp"
android:layout_height="48dp"
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@ class ListViewMessage @JvmOverloads constructor(
fun setMessage(@StringRes stringRes: Int) {
binding.message.text = resources.getText(stringRes)
}

@ModelProp
fun setMessage(stringRes: String) {
binding.message.text = stringRes
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.airbnb.epoxy.AsyncEpoxyController
import com.airbnb.mvrx.MavericksView
import com.airbnb.mvrx.fragmentViewModel
import com.airbnb.mvrx.withState
import com.alfresco.content.GetMultipleContents
import com.alfresco.content.actions.ActionOpenWith
import com.alfresco.content.common.EntryListener
import com.alfresco.content.data.AnalyticsManager
Expand Down Expand Up @@ -84,7 +85,11 @@ class ProcessAttachFilesFragment : ProcessBaseFragment(), MavericksView, EntryLi
if (isAdded) {
if (state.listContents.isNotEmpty()) {
binding.tvNoOfAttachments.visibility = View.VISIBLE
binding.tvNoOfAttachments.text = getString(R.string.text_multiple_attachment, state.listContents.size)
val filesHeader = StringBuilder()
filesHeader.append(getString(R.string.text_multiple_attachment, state.listContents.size))
.append("\n")
.append(getString(R.string.process_max_file_size, GetMultipleContents.MAX_FILE_SIZE_10))
binding.tvNoOfAttachments.text = filesHeader
} else {
binding.tvNoOfAttachments.visibility = View.GONE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.airbnb.mvrx.MavericksViewModel
import com.airbnb.mvrx.MavericksViewModelFactory
import com.airbnb.mvrx.Success
import com.airbnb.mvrx.ViewModelContext
import com.alfresco.content.GetMultipleContents
import com.alfresco.content.actions.Action
import com.alfresco.content.actions.ActionOpenWith
import com.alfresco.content.common.EntryListener
Expand Down Expand Up @@ -85,7 +86,7 @@ class ProcessAttachFilesViewModel(
fun emptyMessageArgs(state: ProcessAttachFilesViewState) =
when {
else ->
Triple(R.drawable.ic_empty_files, R.string.no_attached_files, R.string.file_empty_message)
Triple(R.drawable.ic_empty_files, R.string.no_attached_files, context.getString(R.string.file_empty_message, GetMultipleContents.MAX_FILE_SIZE_10))
}

/**
Expand Down
3 changes: 2 additions & 1 deletion process-app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
<string name="no_attached_folder">No Folder Attached</string>
<string name="text_attached_folder">%d folder(s)</string>
<string name="action_info">Info</string>
<string name="file_empty_message">Looks like you haven’t\nadded any files yet.</string>
<string name="file_empty_message">Looks like you haven’t\nadded any files yet\n(Max file size: %d MB).</string>
<string name="title_search_folder">Search Folder</string>
<string name="error_hyperlink_invalid_url">%1$s has Invalid URL</string>
<string name="error_no_upload_fields">Not able to attach the selected content in this form.</string>
<string name="process_max_file_size">Please note: Maximum file size for uploads is %d MB.</string>
</resources>
Loading