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

feat: [ANDROAPP-6693] Use compose table from mobile ui #3912

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.dhis2.composetable.model.DropdownOption;

import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.dhis2.composetable.model.DropdownOption;
import org.hisp.dhis.android.core.common.ValueType;
import org.hisp.dhis.android.core.program.SectionRenderingType;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import org.dhis2.composetable.model.DropdownOption;

import org.dhis2.data.forms.dataentry.tablefields.age.AgeViewModel;
import org.dhis2.data.forms.dataentry.tablefields.coordinate.CoordinateViewModel;
import org.dhis2.data.forms.dataentry.tablefields.datetime.DateTimeViewModel;
Expand All @@ -14,6 +14,7 @@
import org.dhis2.data.forms.dataentry.tablefields.unsupported.UnsupportedViewModel;
import org.hisp.dhis.android.core.common.ValueType;
import org.hisp.dhis.android.core.program.SectionRenderingType;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.android.core.common.ValueType;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.android.core.common.ValueType;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.android.core.common.ValueType;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;
import java.util.Locale;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import com.google.auto.value.AutoValue;

import org.dhis2.composetable.model.DropdownOption;
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel;
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ import org.dhis2.commons.dialogs.DialogClickListener
import org.dhis2.commons.dialogs.calendarpicker.CalendarPicker
import org.dhis2.commons.dialogs.calendarpicker.OnDatePickerListener
import org.dhis2.commons.orgunitselector.OUTreeFragment
import org.dhis2.composetable.actions.TableResizeActions
import org.dhis2.composetable.model.TableCell
import org.dhis2.composetable.ui.DataSetTableScreen
import org.dhis2.composetable.ui.TableColors
import org.dhis2.composetable.ui.TableConfiguration
import org.dhis2.composetable.ui.TableDimensions
import org.dhis2.composetable.ui.TableTheme
import org.dhis2.composetable.ui.semantics.MAX_CELL_WIDTH_SPACE

import org.dhis2.data.forms.dataentry.tablefields.age.AgeView
import org.dhis2.data.forms.dataentry.tablefields.coordinate.CoordinatesView
import org.dhis2.data.forms.dataentry.tablefields.radiobutton.YesNoView
Expand All @@ -55,6 +48,14 @@ import org.hisp.dhis.android.core.common.FeatureType
import org.hisp.dhis.android.core.common.ValueTypeRenderingType
import org.hisp.dhis.android.core.dataelement.DataElement
import org.hisp.dhis.android.core.organisationunit.OrganisationUnit
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.actions.TableResizeActions
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableCell
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.ui.DataSetTableScreen
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.ui.TableColors
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.ui.TableConfiguration
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.ui.TableDimensions
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.ui.TableTheme
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.ui.semantics.MAX_CELL_WIDTH_SPACE
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.Date
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.dhis2.usescases.datasets.dataSetTable.dataSetSection

import org.dhis2.composetable.model.TableCell
import org.dhis2.data.forms.dataentry.tablefields.spinner.SpinnerViewModel
import org.dhis2.usescases.general.AbstractActivityContracts
import org.hisp.dhis.android.core.dataelement.DataElement
import org.hisp.dhis.android.core.organisationunit.OrganisationUnit
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableCell

class DataValueContract {
interface View : AbstractActivityContracts.View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.dhis2.commons.schedulers.SchedulerProvider
import org.dhis2.commons.viewmodel.DispatcherProvider
import org.dhis2.composetable.TableConfigurationState
import org.dhis2.composetable.TableScreenState
import org.dhis2.composetable.TableState
import org.dhis2.composetable.actions.Validator
import org.dhis2.composetable.model.TableCell
import org.dhis2.composetable.model.TableModel
import org.dhis2.composetable.model.TextInputModel
import org.dhis2.composetable.model.ValidationResult
import org.dhis2.data.forms.dataentry.ValueStore
import org.dhis2.data.forms.dataentry.tablefields.spinner.SpinnerViewModel
import org.dhis2.form.model.ValueStoreResult.ERROR_UPDATING_VALUE
Expand All @@ -30,6 +22,14 @@ import org.dhis2.usescases.datasets.dataSetTable.dataSetSection.TableDataToTable
import org.hisp.dhis.android.core.arch.helpers.Result
import org.hisp.dhis.android.core.common.ValueType
import org.hisp.dhis.android.core.dataelement.DataElement
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.TableConfigurationState
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.TableScreenState
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.TableState
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.actions.Validator
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableCell
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableModel
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TextInputModel
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.ValidationResult
import timber.log.Timber
import kotlin.coroutines.CoroutineContext

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import org.dhis2.bindings.decimalFormat
import org.dhis2.commons.bindings.dataValueConflicts
import org.dhis2.commons.data.tuples.Pair
import org.dhis2.commons.date.DateUtils
import org.dhis2.composetable.model.DropdownOption
import org.dhis2.composetable.model.TableCell
import org.dhis2.data.dhislogic.AUTH_DATAVALUE_ADD
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModel
import org.dhis2.data.forms.dataentry.tablefields.FieldViewModelFactoryImpl
Expand All @@ -34,6 +32,8 @@ import org.hisp.dhis.android.core.dataset.DataSetElement
import org.hisp.dhis.android.core.datavalue.DataValue
import org.hisp.dhis.android.core.organisationunit.OrganisationUnit
import org.hisp.dhis.android.core.period.Period
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.DropdownOption
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableCell
import java.util.SortedMap

class DataValueRepository(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package org.dhis2.usescases.datasets.dataSetTable.dataSetSection

import org.dhis2.R
import org.dhis2.composetable.model.RowHeader
import org.dhis2.composetable.model.TableCell
import org.dhis2.composetable.model.TableHeader
import org.dhis2.composetable.model.TableHeaderCell
import org.dhis2.composetable.model.TableHeaderRow
import org.dhis2.composetable.model.TableModel
import org.dhis2.composetable.model.TableRowModel

import org.hisp.dhis.android.core.common.ValueType
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.RowHeader
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableCell
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableHeader
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableHeaderCell
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableHeaderRow
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableModel
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableRowModel
import java.util.SortedMap

class TableDataToTableModelMapper(val mapFieldValueToUser: MapFieldValueToUser) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.dhis2.usescases.datasets.dataSetTable.dataSetSection

import org.dhis2.composetable.model.TableModel
import org.hisp.dhis.android.core.D2
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.TableModel

class TableDimensionStore(
val d2: D2,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.dhis2.usescases.datasets.dataSetTable.dataSetSection

import org.dhis2.composetable.model.KeyboardInputType
import org.hisp.dhis.android.core.common.ValueType
import org.hisp.dhis.mobile.ui.designsystem.component.composetable.model.KeyboardInputType

fun ValueType.toKeyBoardInputType(): KeyboardInputType? {
return when (this) {
Expand Down
1 change: 1 addition & 0 deletions commons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ dependencies {
api(libs.analytics.sentry.compose)
implementation(libs.github.treeView)
api(libs.dhis2.mobile.designsystem) {
exclude(group = "tech.annexflow.compose", module = "constraintlayout-compose-multiplatform-android")
isChanging = true
}
coreLibraryDesugaring(libs.desugar)
Expand Down
6 changes: 4 additions & 2 deletions compose-table/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ kotlin {
}

dependencies {
implementation(libs.bundles.table.implementation)
debugImplementation(libs.bundles.table.debugImplementation)
testImplementation(libs.bundles.table.test)
androidTestImplementation(libs.bundles.table.androidTest)
implementation(libs.dhis2.mobile.designsystem)
implementation(libs.dhis2.mobile.designsystem) {
exclude(group = "tech.annexflow.compose", module = "constraintlayout-compose-multiplatform-android")

}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading