Skip to content

Commit

Permalink
ADST-23 (#321)
Browse files Browse the repository at this point in the history
* submit collected data to server

* code optimized

* added UI for attachments

* added attach files component

* code optimize
  • Loading branch information
aman-alfresco authored Mar 22, 2024
1 parent c43a1db commit 3380a2f
Show file tree
Hide file tree
Showing 52 changed files with 1,203 additions and 393 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ProcessDefinitionsSheet : BottomSheetDialogFragment(), MavericksView {

val intent = Intent(
requireActivity(),
Class.forName("com.alfresco.content.process.ProcessFormActivity"),
Class.forName("com.alfresco.content.process.ui.ProcessFormActivity"),
)
intent.putExtra(Mavericks.KEY_ARG, processEntry)
startActivity(intent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.alfresco.content.actions.Action
import com.alfresco.content.browse.R
import com.alfresco.content.browse.databinding.ActivityLocalPreviewBinding
import com.alfresco.content.data.Entry
import com.alfresco.content.process.ui.fragments.BaseDetailFragment.Companion.KEY_ENTRY_OBJ

/**
* Mark as Preview Activity
Expand Down Expand Up @@ -45,8 +46,4 @@ class LocalPreviewActivity : AppCompatActivity() {
fragment.arguments = intent.extras
}
}

companion object {
const val KEY_ENTRY_OBJ = "entryObj"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class ProcessDetailViewModel(
fun startWorkflow() = withState { state ->
val items = state.listContents.joinToString(separator = ",") { it.id }
viewModelScope.launch {
repository::startWorkflow.asFlow(state.parent, items, emptyList()).execute {
repository::startWorkflow.asFlow(state.parent, items, mapOf()).execute {
when (it) {
is Loading -> copy(requestStartWorkflow = Loading())
is Fail -> copy(requestStartWorkflow = Fail(it.error))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.alfresco.content.browse.processes.details

import com.alfresco.content.browse.tasks.list.UpdateTasksData
import com.alfresco.content.process.ui.UpdateProcessData
import com.alfresco.content.process.ui.models.UpdateProcessData
import com.alfresco.events.EventBus
import kotlinx.coroutines.launch

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import com.alfresco.content.data.payloads.TaskProcessFiltersPayload
import com.alfresco.content.getLocalizedName
import com.alfresco.content.listview.processes.ProcessListViewModel
import com.alfresco.content.listview.processes.ProcessListViewState
import com.alfresco.content.process.ui.UpdateProcessData
import com.alfresco.content.process.ui.models.UpdateProcessData
import com.alfresco.coroutines.asFlow
import com.alfresco.events.on
import kotlinx.coroutines.launch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.alfresco.content.browse.tasks.detail.TaskDetailViewState
import com.alfresco.content.data.AnalyticsManager
import com.alfresco.content.data.Entry
import com.alfresco.content.data.EventName
import com.alfresco.content.process.ui.fragments.BaseDetailFragment.Companion.KEY_ENTRY_OBJ
import com.alfresco.content.viewer.ViewerActivity
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar
Expand Down Expand Up @@ -84,7 +85,7 @@ abstract class BaseDetailFragment : Fragment(), DeleteContentListener {
*/
fun localViewerIntent(contentEntry: Entry) = startActivity(
Intent(requireActivity(), LocalPreviewActivity::class.java)
.putExtra(LocalPreviewActivity.KEY_ENTRY_OBJ, contentEntry),
.putExtra(KEY_ENTRY_OBJ, contentEntry),
)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.alfresco.content.data.PageView
import com.alfresco.content.data.ParentEntry
import com.alfresco.content.data.UploadServerType
import com.alfresco.content.mimetype.MimeType
import com.alfresco.content.process.ui.fragments.BaseDetailFragment.Companion.KEY_ENTRY_OBJ
import com.alfresco.content.simpleController
import com.alfresco.ui.getDrawableForAttribute

Expand Down Expand Up @@ -148,7 +149,7 @@ class AttachedFilesFragment : BaseDetailFragment(), MavericksView, EntryListener
if (isAdded) {
startActivity(
Intent(requireActivity(), LocalPreviewActivity::class.java)
.putExtra(LocalPreviewActivity.KEY_ENTRY_OBJ, entry as Entry),
.putExtra(KEY_ENTRY_OBJ, entry as Entry),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.alfresco.content.browse.tasks.list.UpdateTasksData
import com.alfresco.content.data.Entry
import com.alfresco.content.data.OfflineRepository
import com.alfresco.content.data.UserGroupDetails
import com.alfresco.content.process.ui.UpdateProcessData
import com.alfresco.content.process.ui.models.UpdateProcessData
import com.alfresco.events.EventBus
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
Expand Down
8 changes: 0 additions & 8 deletions browse/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<string name="account">Account</string>
<string name="icon_due_date">Symbol für Fälligkeitsdatum</string>
<string name="icon_user_profile">Symbol für Benutzerprofil</string>
<string name="icon_file">Symbol für Datei</string>
<string name="icon_priority">Symbol für Priorität</string>
<string name="icon_assigned">Zugewiesenes Symbol</string>
<string name="icon_status">Symbol für Status</string>
Expand All @@ -63,15 +62,11 @@
<string name="text_view_all">Alle anzeigen</string>
<string name="text_multiple_comments">%d Kommentare</string>
<string name="text_attached_files">Angehängte Dateien</string>
<string name="text_multiple_attachment">%d Anhänge</string>
<string name="no_attached_files">Keine angehängten Dateien</string>
<string name="empty_no_due_date">Kein Fälligkeitsdatum</string>
<string name="title_attached_files">Angehängte Dateien</string>
<string name="text_complete">Abgeschlossen</string>
<string name="dialog_title_complete_task">Aufgabe abschließen</string>
<string name="dialog_message_complete_task">Sind Sie sicher, dass Sie diese Aufgabe abschließen wollen? Sie werden keine Änderungen mehr vornehmen können.</string>
<string name="dialog_negative_button_task">Abbrechen</string>
<string name="dialog_positive_button_task">Bestätigen</string>
<string name="icon_send_description">Schaltfläche „Senden“</string>
<string name="empty_description">Keine Beschreibung</string>
<string name="icon_completed">Abgeschlossen-Symbol</string>
Expand All @@ -87,9 +82,6 @@
<string name="text_create_task">Aufgabe erstellen</string>
<string name="dialog_title_discard_task">Verwerfen</string>
<string name="dialog_message_discard_task">Sollen die Änderungen verworfen werden?</string>
<string name="icon_delete_attachment">Symbol \'Anhang löschen\'</string>
<string name="dialog_title_delete_content">Eine Datei löschen?</string>
<string name="text_add_attachments">Anhänge hinzufügen</string>
<string name="icon_add_attachment">Symbol \'Anhang hinzufügen\'</string>
<string name="dialog_message_complete_task_files_queue">Sind Sie sicher, dass Sie die Aufgabe abschließen wollen? Nach Abschluss der Aufgabe können einige Dateien nicht hochgeladen werden und es können keine Änderungen vorgenommen werden.</string>

Expand Down
8 changes: 0 additions & 8 deletions browse/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<string name="account">Cuenta</string>
<string name="icon_due_date">Icono de fecha de vencimiento</string>
<string name="icon_user_profile">Icono de perfil de usuario</string>
<string name="icon_file">Icono de fichero</string>
<string name="icon_priority">Icono de prioridad</string>
<string name="icon_assigned">Icono de usuario asignado</string>
<string name="icon_status">Icono de estado</string>
Expand All @@ -63,15 +62,11 @@
<string name="text_view_all">Ver todo</string>
<string name="text_multiple_comments">%d comentarios</string>
<string name="text_attached_files">Ficheros adjuntos</string>
<string name="text_multiple_attachment">%d adjuntos</string>
<string name="no_attached_files">No hay ficheros adjuntos</string>
<string name="empty_no_due_date">Sin fecha de vencimiento</string>
<string name="title_attached_files">Ficheros adjuntos</string>
<string name="text_complete">Por completar</string>
<string name="dialog_title_complete_task">Completar tarea</string>
<string name="dialog_message_complete_task">¿Está seguro de que desea completar esta tarea? Ya no podrá realizar ningún cambio.</string>
<string name="dialog_negative_button_task">Cancelar</string>
<string name="dialog_positive_button_task">Confirmar</string>
<string name="icon_send_description">Botón Enviar</string>
<string name="empty_description">Sin descripción</string>
<string name="icon_completed">Icono completado</string>
Expand All @@ -88,9 +83,6 @@
<string name="text_create_task">Crear tarea</string>
<string name="dialog_title_discard_task">Descartar</string>
<string name="dialog_message_discard_task">¿Desea descartar los cambios?</string>
<string name="icon_delete_attachment">Icono de eliminación de adjuntos</string>
<string name="dialog_title_delete_content">¿Eliminar un fichero?</string>
<string name="text_add_attachments">Añadir adjuntos</string>
<string name="icon_add_attachment">Añadir icono adjunto</string>
<string name="dialog_message_complete_task_files_queue">¿Está seguro de que quiere completar la tarea? Una vez completada, algunos ficheros no se pudieron cargar y no se pueden realizar cambios.</string>

Expand Down
8 changes: 0 additions & 8 deletions browse/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<string name="account">Compte</string>
<string name="icon_due_date">Icône Date d\'échéance</string>
<string name="icon_user_profile">Icône du profil d\'utilisateur</string>
<string name="icon_file">Icône de fichier</string>
<string name="icon_priority">Icône de priorité</string>
<string name="icon_assigned">Icône Assigné</string>
<string name="icon_status">Icône du statut</string>
Expand All @@ -63,15 +62,11 @@
<string name="text_view_all">Afficher tout</string>
<string name="text_multiple_comments">%d commentaires</string>
<string name="text_attached_files">Fichiers joints</string>
<string name="text_multiple_attachment">%d pièces jointes</string>
<string name="no_attached_files">Aucun fichier joint</string>
<string name="empty_no_due_date">Aucune date d\'échéance</string>
<string name="title_attached_files">Fichiers joints</string>
<string name="text_complete">Terminé</string>
<string name="dialog_title_complete_task">Terminer la tâche</string>
<string name="dialog_message_complete_task">Voulez-vous vraiment terminer cette tâche ? Vous ne pourrez plus faire de modifications.</string>
<string name="dialog_negative_button_task">Annuler</string>
<string name="dialog_positive_button_task">Confirmer</string>
<string name="icon_send_description">Bouton Envoyer</string>
<string name="empty_description">Aucune description</string>
<string name="icon_completed">Icône Terminé</string>
Expand All @@ -87,9 +82,6 @@
<string name="text_create_task">Créer une tâche</string>
<string name="dialog_title_discard_task">Ignorer</string>
<string name="dialog_message_discard_task">Voulez-vous ignorer les modifications ?</string>
<string name="icon_delete_attachment">Icône Supprimer la pièce jointe</string>
<string name="dialog_title_delete_content">Supprimer un fichier ?</string>
<string name="text_add_attachments">Ajouter des pièces jointes</string>
<string name="icon_add_attachment">Icône Ajouter une pièce jointe</string>
<string name="dialog_message_complete_task_files_queue">Voulez-vous vraiment terminer la tâche ? Une fois terminée, certains fichiers ne pourront plus être importés et aucun changement ne pourra être effectué.</string>

Expand Down
8 changes: 0 additions & 8 deletions browse/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<string name="account">Account</string>
<string name="icon_due_date">Icona scadenza</string>
<string name="icon_user_profile">Icona profilo utente</string>
<string name="icon_file">Icona file</string>
<string name="icon_priority">Icona priorità</string>
<string name="icon_assigned">Icona assegnazione</string>
<string name="icon_status">Icona stato</string>
Expand All @@ -63,10 +62,8 @@
<string name="text_view_all">Visualizza tutto</string>
<string name="text_multiple_comments">%d commenti</string>
<string name="text_attached_files">File allegati</string>
<string name="text_multiple_attachment">%d allegati</string>
<string name="no_attached_files">Nessun file allegato</string>
<string name="empty_no_due_date">Nessuna scadenza</string>
<string name="title_attached_files">File allegati</string>
<string name="text_complete">Completato</string>
<string name="dialog_title_complete_task">Completa compito</string>
<string name="dialog_message_complete_task">Vuoi completare il compito? Non potrai più apportare modifiche.</string>
Expand All @@ -85,11 +82,6 @@
<string name="icon_assignee_edit">Icona Modifica assegnatario</string>
<string name="icon_name_description_edit">Icona Modifica nome e descrizione</string>
<string name="text_create_task">Crea compito</string>
<string name="dialog_title_discard_task">Ignora</string>
<string name="dialog_message_discard_task">Vuoi ignorare le modifiche?</string>
<string name="icon_delete_attachment">Icona Elimina allegato</string>
<string name="dialog_title_delete_content">Vuoi eliminare un file?</string>
<string name="text_add_attachments">Aggiungi allegati</string>
<string name="icon_add_attachment">Icona Aggiungi allegati</string>
<string name="dialog_message_complete_task_files_queue">Vuoi completare il compito? Una volta completato, non sarà possibile caricare alcuni file né apportare modifiche.</string>

Expand Down
8 changes: 0 additions & 8 deletions browse/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<string name="account">Account</string>
<string name="icon_due_date">Pictogram Vervaldatum</string>
<string name="icon_user_profile">Pictogram Gebruikersprofiel</string>
<string name="icon_file">Pictogram Bestand</string>
<string name="icon_priority">Pictogram Prioriteit</string>
<string name="icon_assigned">Pictogram Toegewezen</string>
<string name="icon_status">Pictogram Status</string>
Expand All @@ -63,15 +62,11 @@
<string name="text_view_all">Alle weergeven</string>
<string name="text_multiple_comments">%d opmerkingen</string>
<string name="text_attached_files">Bijgevoegde bestanden</string>
<string name="text_multiple_attachment">%d bijlagen</string>
<string name="no_attached_files">Geen bijgevoegde bestanden</string>
<string name="empty_no_due_date">Geen vervaldatum</string>
<string name="title_attached_files">Bijgevoegde bestanden</string>
<string name="text_complete">Voltooien</string>
<string name="dialog_title_complete_task">Taak voltooien</string>
<string name="dialog_message_complete_task">Weet u zeker dat u de taak wilt voltooien? U kunt geen wijzigingen meer aanbrengen.</string>
<string name="dialog_negative_button_task">Annuleren</string>
<string name="dialog_positive_button_task">Bevestigen</string>
<string name="icon_send_description">Knop Verzenden</string>
<string name="empty_description">Geen beschrijving</string>
<string name="icon_completed">Pictogram Voltooid</string>
Expand All @@ -87,9 +82,6 @@
<string name="text_create_task">Taak creëren</string>
<string name="dialog_title_discard_task">Negeren</string>
<string name="dialog_message_discard_task">Wilt u de wijzigingen negeren?</string>
<string name="icon_delete_attachment">Pictogram Bijlage verwijderen</string>
<string name="dialog_title_delete_content">Bestand verwijderen?</string>
<string name="text_add_attachments">Bijlagen toevoegen</string>
<string name="icon_add_attachment">Pictogram Bijlage toevoegen</string>
<string name="dialog_message_complete_task_files_queue">Weet u zeker dat u de taak wilt voltooien? Nadat de taak is voltooid, kunnen sommige bestanden niet worden geüpload en kunnen geen wijzigingen worden aangebracht.</string>

Expand Down
8 changes: 0 additions & 8 deletions browse/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
<string name="account">Account</string>
<string name="icon_due_date">Due date icon</string>
<string name="icon_user_profile">User profile icon</string>
<string name="icon_file">File icon</string>
<string name="icon_priority">Priority icon</string>
<string name="icon_assigned">Assigned icon</string>
<string name="icon_status">Status icon</string>
Expand All @@ -63,15 +62,11 @@
<string name="text_view_all">View all</string>
<string name="text_multiple_comments">%d comments</string>
<string name="text_attached_files">Attached files</string>
<string name="text_multiple_attachment">%d attachments</string>
<string name="no_attached_files">No Attached Files</string>
<string name="empty_no_due_date">No due date</string>
<string name="title_attached_files">Attached files</string>
<string name="text_complete">Complete</string>
<string name="dialog_title_complete_task">Complete Task</string>
<string name="dialog_message_complete_task">Are you sure you want to complete this task? You will no longer be able to make any changes.</string>
<string name="dialog_negative_button_task">Cancel</string>
<string name="dialog_positive_button_task">Confirm</string>
<string name="icon_send_description">Send Button</string>
<string name="empty_description">No description</string>
<string name="icon_completed">Completed icon</string>
Expand All @@ -87,9 +82,6 @@
<string name="text_create_task">Create task</string>
<string name="dialog_title_discard_task">Discard</string>
<string name="dialog_message_discard_task">Do you want to discard the changes?</string>
<string name="icon_delete_attachment">Icon delete attachment</string>
<string name="dialog_title_delete_content">Delete a file?</string>
<string name="text_add_attachments">Add attachments</string>
<string name="icon_add_attachment">Add attachment icon</string>
<string name="dialog_message_complete_task_files_queue">Are you sure you want to complete the task? Once completed, some files could not be uploaded and no changes can be made.</string>

Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions common/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@
<string name="title_action_mode">%d Ausgewählt</string>
<string name="message_no_internet">Bitte überprüfen Sie Ihre Internetverbindung und starten anschließend den Vorgang erneut.</string>
<string name="suffix_view_all">...Alle anzeigen</string>
<string name="text_multiple_attachment">%d Anhänge</string>
<string name="text_add_attachments">Anhänge hinzufügen</string>
<string name="title_attached_files">Angehängte Dateien</string>
<string name="icon_file">Symbol für Datei</string>
<string name="icon_delete_attachment">Symbol \'Anhang löschen\'</string>
<string name="dialog_title_delete_content">Eine Datei löschen?</string>
<string name="dialog_negative_button_task">Abbrechen</string>
<string name="dialog_positive_button_task">Bestätigen</string>
</resources>
8 changes: 8 additions & 0 deletions common/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,12 @@
<string name="title_action_mode">%d Seleccionado</string>
<string name="message_no_internet">Verifique su conexión a Internet y vuelva a intentarlo.</string>
<string name="suffix_view_all">...Ver todo</string>
<string name="text_multiple_attachment">%d adjuntos</string>
<string name="text_add_attachments">Añadir adjuntos</string>
<string name="title_attached_files">Ficheros adjuntos</string>
<string name="icon_file">Icono de fichero</string>
<string name="icon_delete_attachment">Icono de eliminación de adjuntos</string>
<string name="dialog_title_delete_content">¿Eliminar un fichero?</string>
<string name="dialog_negative_button_task">Cancelar</string>
<string name="dialog_positive_button_task">Confirmar</string>
</resources>
Loading

0 comments on commit 3380a2f

Please sign in to comment.