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-26 #312

Merged
merged 3 commits into from
Feb 14, 2024
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
12 changes: 6 additions & 6 deletions browse/src/main/res/layout/fragment_task_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
android:layout_marginEnd="16dp"
android:contentDescription="@string/icon_name_description_edit"
android:scaleType="fitCenter"
android:src="@drawable/ic_edit"
android:src="@drawable/ic_edit_blue"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand Down Expand Up @@ -148,7 +148,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:src="@drawable/ic_edit"
android:src="@drawable/ic_edit_blue"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
Expand Down Expand Up @@ -230,7 +230,7 @@
android:layout_height="wrap_content"
android:contentDescription="@string/icon_due_date_edit"
android:scaleType="fitCenter"
android:src="@drawable/ic_edit"
android:src="@drawable/ic_edit_blue"
android:visibility="invisible" />

</FrameLayout>
Expand Down Expand Up @@ -305,7 +305,7 @@
android:layout_height="wrap_content"
android:contentDescription="@string/icon_priority_edit"
android:scaleType="fitCenter"
android:src="@drawable/ic_edit"
android:src="@drawable/ic_edit_blue"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
Expand Down Expand Up @@ -372,7 +372,7 @@
android:layout_height="wrap_content"
android:contentDescription="@string/icon_assignee_edit"
android:scaleType="fitCenter"
android:src="@drawable/ic_edit"
android:src="@drawable/ic_edit_blue"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
Expand Down Expand Up @@ -502,7 +502,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:src="@drawable/ic_edit"
android:src="@drawable/ic_edit_blue"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
Expand Down
1 change: 0 additions & 1 deletion browse/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<string name="icon_priority_edit">Symbol \'Priorität bearbeiten\'</string>
<string name="icon_due_date_clear">Symbol \'Fälligkeitsdatum löschen\'</string>
<string name="icon_due_date_edit">Symbol \'Fälligkeitsdatum bearbeiten\'</string>
<string name="suffix_view_all">...Alle anzeigen</string>
<string name="dialog_title_save_progress">Aufgabenfortschritt</string>
<string name="dialog_message_save_progress">Möchten Sie den Fortschritt speichern?</string>
<string name="text_mark_as_complete">Als abgeschlossen markieren</string>
Expand Down
1 change: 0 additions & 1 deletion browse/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<string name="icon_priority_edit">Icône Modifier la priorité</string>
<string name="icon_due_date_clear">Icône Effacer la date d\'échéance</string>
<string name="icon_due_date_edit">Icône Modifier la date d\'échéance</string>
<string name="suffix_view_all">&#8230;Afficher tout</string>
<string name="dialog_title_save_progress">Progression de la tâche</string>
<string name="dialog_message_save_progress">Voulez-vous enregistrer la progression ?</string>
<string name="text_mark_as_complete">Marquer comme terminé</string>
Expand Down
1 change: 0 additions & 1 deletion browse/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<string name="icon_priority_edit">Icona Modifica priorità</string>
<string name="icon_due_date_clear">Icona Cancella scadenza</string>
<string name="icon_due_date_edit">Icona Modifica scadenza</string>
<string name="suffix_view_all">...Visualizza tutto</string>
<string name="dialog_title_save_progress">Stato di avanzamento compito</string>
<string name="dialog_message_save_progress">Vuoi salvare lo stato di avanzamento?</string>
<string name="text_mark_as_complete">Contrassegna come completato</string>
Expand Down
1 change: 0 additions & 1 deletion browse/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<string name="icon_priority_edit">Pictogram Prioriteit bewerken</string>
<string name="icon_due_date_clear">Pictogram Vervaldatum wissen</string>
<string name="icon_due_date_edit">Pictogram Vervaldatum bewerken</string>
<string name="suffix_view_all">...Alle weergeven</string>
<string name="dialog_title_save_progress">Voortgang van de taak</string>
<string name="dialog_message_save_progress">Wilt u de voortgang opslaan?</string>
<string name="text_mark_as_complete">Als voltooid markeren</string>
Expand Down
1 change: 0 additions & 1 deletion browse/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
<string name="icon_priority_edit">Edit priority icon</string>
<string name="icon_due_date_clear">Clear due date icon</string>
<string name="icon_due_date_edit">Edit due date icon</string>
<string name="suffix_view_all">&#8230;View all</string>
<string name="dialog_title_save_progress">Task Progress</string>
<string name="dialog_message_save_progress">Do you want to save progress?</string>
<string name="text_mark_as_complete">Mark as complete</string>
Expand Down
1 change: 1 addition & 0 deletions common/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
<string name="none">Keine</string>
<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>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
<string name="none">Ninguno</string>
<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>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
<string name="none">Aucun</string>
<string name="title_action_mode">%d Sélectionné</string>
<string name="message_no_internet">Veuillez vérifier votre connexion Internet et réessayer.</string>
<string name="suffix_view_all">&#8230;Afficher tout</string>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
<string name="none">Nessuno</string>
<string name="title_action_mode">%d Selezionato</string>
<string name="message_no_internet">Controlla la connessione Internet e riprova.</string>
<string name="suffix_view_all">...Visualizza tutto</string>
</resources>
1 change: 1 addition & 0 deletions common/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@
<string name="none">Geen</string>
<string name="title_action_mode">%d Geselecteerd</string>
<string name="message_no_internet">Controleer uw internetverbinding en probeer het opnieuw.</string>
<string name="suffix_view_all">...Alle weergeven</string>
</resources>
2 changes: 2 additions & 0 deletions common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
<string name="none">None</string>
<string name="title_action_mode">%d Selected</string>
<string name="message_no_internet">Please check your internet connection and Try again.</string>
<string name="suffix_view_all">&#8230;View all</string>
<string name="title_workflow">Workflow</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ data class ComponentData(
return ComponentData(
id = fieldsData.id,
name = fieldsData.name,
selector = ComponentType.RADIO.value,
selector = ComponentType.DROPDOWN_RADIO.value,
options = fieldsData.options.filter { it.id != "empty" }.map { ComponentOptions.withProcess(it) },
selectedName = name,
selectedQuery = query,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ class ComponentSheet : BottomSheetDialogFragment(), MavericksView {
binding.parentView.addView(binding.topView)
binding.parentView.addView(binding.separator)

if (state.parent?.selector != ComponentType.DROPDOWN_RADIO.value) {
binding.bottomSeparator.visibility = View.VISIBLE
binding.bottomView.visibility = View.VISIBLE
}

val replacedString = state.parent?.name?.replace(" ", ".") ?: ""
val localizedName = requireContext().getLocalizedName(replacedString)
if (localizedName == replacedString) {
Expand All @@ -211,7 +216,7 @@ class ComponentSheet : BottomSheetDialogFragment(), MavericksView {
ComponentType.TASK_PROCESS_PRIORITY.value -> setupTaskPriorityComponent(state)
ComponentType.VIEW_TEXT.value -> setupTextComponent(state)
ComponentType.CHECK_LIST.value -> setupCheckListComponent(viewModel)
ComponentType.RADIO.value -> setupRadioListComponent(state, viewModel)
ComponentType.RADIO.value, ComponentType.DROPDOWN_RADIO.value -> setupRadioListComponent(state, viewModel)
ComponentType.NUMBER_RANGE.value -> setupNumberRangeComponent(state, viewModel)
ComponentType.SLIDER.value -> setupSliderComponent(state, viewModel)
ComponentType.DATE_RANGE.value, ComponentType.DATE_RANGE_FUTURE.value -> {
Expand All @@ -233,6 +238,7 @@ class ComponentSheet : BottomSheetDialogFragment(), MavericksView {
}
}
}

ComponentType.FACETS.value -> setupFacetComponent(state, viewModel)
}
}
Expand All @@ -251,6 +257,7 @@ class ComponentSheet : BottomSheetDialogFragment(), MavericksView {
dismiss()
}
}

ComponentType.DATE_RANGE_FUTURE.value -> {
if (viewModel.fromDate.isEmpty() && viewModel.toDate.isEmpty()) {
binding.dateRangeComponent.fromInputLayout.error = getString(R.string.component_number_range_empty)
Expand All @@ -259,6 +266,7 @@ class ComponentSheet : BottomSheetDialogFragment(), MavericksView {
dismiss()
}
}

else -> {
onApply?.invoke(state.parent?.selectedName ?: "", state.parent?.selectedQuery ?: "", state.parent?.selectedQueryMap ?: mapOf())
dismiss()
Expand All @@ -285,9 +293,11 @@ class ComponentSheet : BottomSheetDialogFragment(), MavericksView {
ComponentType.CHECK_LIST.value -> {
epoxyCheckListController.requestModelBuild()
}
ComponentType.RADIO.value -> {

ComponentType.RADIO.value, ComponentType.DROPDOWN_RADIO.value -> {
epoxyRadioListController.requestModelBuild()
}

ComponentType.FACETS.value -> {
epoxyCheckFacetListController.requestModelBuild()
}
Expand Down Expand Up @@ -317,10 +327,15 @@ class ComponentSheet : BottomSheetDialogFragment(), MavericksView {
data(option)
optionSelected(viewModel.isOptionSelected(state, option))
clickListener { model, _, _, _ ->
viewModel.updateSingleComponentData(
requireContext().getLocalizedName(model.data().label),
model.data().query,
)
if (state.parent.selector == ComponentType.DROPDOWN_RADIO.value) {
onApply?.invoke(requireContext().getLocalizedName(model.data().label), model.data().query, mapOf())
dismiss()
} else {
viewModel.updateSingleComponentData(
requireContext().getLocalizedName(model.data().label),
model.data().query,
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ fun ComponentSheet.setupFacetComponent(state: ComponentState, viewModel: Compone
*/
fun ComponentSheet.setupTextComponent(state: ComponentState) {
binding.parentView.addView(binding.frameTitleDescription)
binding.titleDescriptionComponent.tvTitle.text = state.parent?.query ?: ""
if (state.parent?.query.isNullOrEmpty()) {
binding.titleDescriptionComponent.tvTitle.visibility = View.GONE
} else {
binding.titleDescriptionComponent.tvTitle.text = state.parent?.query ?: ""
}
binding.titleDescriptionComponent.tvDescription.text = state.parent?.value ?: ""

binding.bottomView.visibility = View.GONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum class ComponentType(val value: String) {
DATE_RANGE("date-range"),
DATE_RANGE_FUTURE("date-range-future"),
RADIO("radio"),
DROPDOWN_RADIO("dropdown_radio"),
FACETS("facets"),
TASK_PROCESS_PRIORITY("task-process-priority"),
None("none"),
Expand Down
10 changes: 6 additions & 4 deletions component/src/main/res/layout/sheet_component_filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:layout_height="match_parent">
android:paddingBottom="16dp">


<LinearLayout
Expand Down Expand Up @@ -160,15 +160,17 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="@color/color_view_line" />
android:background="@color/color_view_line"
android:visibility="gone" />

<LinearLayout
android:id="@+id/bottom_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/component_default_margin"
android:layout_marginEnd="@dimen/component_default_margin"
android:orientation="vertical">
android:orientation="vertical"
android:visibility="gone">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
Expand Down
33 changes: 33 additions & 0 deletions data/src/main/kotlin/com/alfresco/content/data/ProcessEntry.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.alfresco.content.data

import android.os.Parcelable
import com.alfresco.content.data.payloads.FieldType
import com.alfresco.content.data.payloads.FieldsData
import com.alfresco.process.models.ProcessInstanceEntry
import kotlinx.parcelize.Parcelize
Expand Down Expand Up @@ -246,6 +247,38 @@ data class ProcessEntry(
reviewerType = reviewerType,
)
}

fun withProcess(data: ProcessEntry, fieldType: String): ProcessEntry {
var reviewerType: ReviewerType = ReviewerType.PEOPLE

if (fieldType == FieldType.FUNCTIONAL_GROUP.value()) {
reviewerType = ReviewerType.FUNCTIONAL_GROUP
}

return ProcessEntry(
id = data.id,
name = data.name,
description = data.description,
businessKey = data.businessKey,
processDefinitionId = data.processDefinitionId,
tenantId = data.tenantId,
started = data.started,
ended = data.ended,
startedBy = data.startedBy,
processDefinitionName = data.processDefinitionName,
processDefinitionDescription = data.processDefinitionDescription,
processDefinitionKey = data.processDefinitionKey,
processDefinitionCategory = data.processDefinitionCategory,
processDefinitionVersion = data.processDefinitionVersion,
processDefinitionDeploymentId = data.processDefinitionDeploymentId,
graphicalNotationDefined = data.graphicalNotationDefined,
startFormDefined = data.startFormDefined,
suspended = data.suspended,
formattedDueDate = data.formattedDueDate,
priority = data.priority,
reviewerType = reviewerType,
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ enum class FieldType {
READONLY_TEXT,
READONLY,
PEOPLE,
FUNCTIONAL_GROUP,
;

fun value() = name.lowercase()
Expand Down
Loading
Loading