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

chore: rebase 3.0.1 onto main #3652

Closed
wants to merge 7 commits into from
Closed
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
54 changes: 54 additions & 0 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Continuous Delivery

env:

main_project_module: app

on:
workflow_dispatch:
push:
branches:
- main
- develop
- release/*

jobs:
deployment_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Set Current Date
- name: Set current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"

# Set Repository Name As Env Variable
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: Set Up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'

- name: Change wrapper permissions
run: chmod +x ./gradlew

# Create APK Debug
- name: Build apk debug project (APK) - ${{ env.main_project_module }} module
run: ./gradlew assembleDhisDebug

- name: Read version name from file
working-directory: ./gradle
id: read-version
run: echo "vName=$(grep 'vName' libs.versions.toml | awk -F' = ' '{print $2}' | tr -d '"')" >> "$GITHUB_OUTPUT"

# Upload Artifact Build
- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.repository_name }} - Android APK - ${{ steps.date.outputs.date }}
path: ${{ env.main_project_module }}/build/outputs/apk/dhis/debug/dhis2-v${{ steps.read-version.outputs.vName }}-dhis-debug.apk
32 changes: 32 additions & 0 deletions .github/workflows/deploy-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This is a basic workflow that is manually triggered

name: Deploy Release

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
name:
# Friendly description to be shown in the UI instead of 'name'
description: 'Person to greet'
# Default value if no value is explicitly provided
default: 'World'
# Input has to be provided for the workflow to run
required: true
# The data type of the input
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
greet:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- name: Send greeting
run: echo "Hello ${{ inputs.name }}"
3 changes: 0 additions & 3 deletions app/src/androidTest/java/org/dhis2/usescases/BaseTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import org.dhis2.commons.idlingresource.SearchIdlingResourceSingleton
import org.dhis2.commons.prefs.Preference
import org.dhis2.form.ui.idling.FormCountingIdlingResource
import org.dhis2.usescases.eventsWithoutRegistration.EventIdlingResourceSingleton
import org.dhis2.usescases.eventsWithoutRegistration.eventDetails.ui.EventDetailIdlingResourceSingleton
import org.dhis2.usescases.programEventDetail.eventList.EventListIdlingResourceSingleton
import org.dhis2.usescases.teiDashboard.dashboardfragments.teidata.TeiDataIdlingResourceSingleton
import org.junit.After
Expand Down Expand Up @@ -87,7 +86,6 @@ open class BaseTest {
SearchIdlingResourceSingleton.countingIdlingResource,
TeiDataIdlingResourceSingleton.countingIdlingResource,
EventIdlingResourceSingleton.countingIdlingResource,
EventDetailIdlingResourceSingleton.countingIdlingResource,
)
}

Expand All @@ -100,7 +98,6 @@ open class BaseTest {
SearchIdlingResourceSingleton.countingIdlingResource,
TeiDataIdlingResourceSingleton.countingIdlingResource,
EventIdlingResourceSingleton.countingIdlingResource,
EventDetailIdlingResourceSingleton.countingIdlingResource,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class TeiDashboardTest : BaseTest() {
}
}

@Ignore("next button is sometimes not reached. Review feature.")
@Test
fun shouldShowQRWhenClickOnShare() {
prepareTeiCompletedProgrammeAndLaunchActivity(rule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.NoMatchingViewException
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItem
import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition
Expand Down Expand Up @@ -395,7 +397,15 @@ class TeiDashboardRobot(val composeTestRule: ComposeTestRule) : BaseRobot() {
}

fun clickOnTimelineEvents() {
onView(withText(R.string.show_events_timeline)).perform(click())
try {
onView(withText(R.string.show_events_timeline)).perform(click())
}catch (e: NoMatchingViewException){
checkIfGroupedEventsIsVisible()
}
}

private fun checkIfGroupedEventsIsVisible(){
onView(withText(R.string.group_events_by_stage)).check(matches(isDisplayed()))
}

fun checkEventWasScheduled(eventName: String, position: Int) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import kotlinx.coroutines.launch
import org.dhis2.commons.extensions.truncate
import org.dhis2.commons.locationprovider.LocationProvider
import org.dhis2.form.data.GeometryController
import org.dhis2.usescases.eventsWithoutRegistration.EventIdlingResourceSingleton
import org.dhis2.usescases.eventsWithoutRegistration.eventDetails.domain.ConfigureEventCatCombo
import org.dhis2.usescases.eventsWithoutRegistration.eventDetails.domain.ConfigureEventCoordinates
import org.dhis2.usescases.eventsWithoutRegistration.eventDetails.domain.ConfigureEventDetails
Expand Down Expand Up @@ -141,7 +142,7 @@ class EventDetailsViewModel(
}

private fun setUpEventDetails() {
EventDetailIdlingResourceSingleton.increment()
EventIdlingResourceSingleton.increment()
viewModelScope.launch {
configureEventDetails(
selectedDate = eventDate.value.currentDate,
Expand All @@ -154,21 +155,21 @@ class EventDetailsViewModel(
.flowOn(Dispatchers.IO)
.collect {
_eventDetails.value = it
EventDetailIdlingResourceSingleton.decrement()
EventIdlingResourceSingleton.decrement()
}
}
}

fun setUpEventReportDate(selectedDate: Date? = null) {
EventDetailIdlingResourceSingleton.increment()
EventIdlingResourceSingleton.increment()
viewModelScope.launch {
configureEventReportDate(selectedDate)
.flowOn(Dispatchers.IO)
.collect {
_eventDate.value = it
setUpEventDetails()
setUpOrgUnit(selectedDate = it.currentDate)
EventDetailIdlingResourceSingleton.decrement()
EventIdlingResourceSingleton.decrement()
}
}
}
Expand All @@ -195,14 +196,14 @@ class EventDetailsViewModel(
}

fun setUpCategoryCombo(categoryOption: Pair<String, String?>? = null) {
EventDetailIdlingResourceSingleton.increment()
EventIdlingResourceSingleton.increment()
viewModelScope.launch {
configureEventCatCombo(categoryOption)
.flowOn(Dispatchers.IO)
.collect {
_eventCatCombo.value = it
setUpEventDetails()
EventDetailIdlingResourceSingleton.decrement()
EventIdlingResourceSingleton.decrement()
}
}
}
Expand All @@ -213,7 +214,7 @@ class EventDetailsViewModel(
}

private fun setUpCoordinates(value: String? = "") {
EventDetailIdlingResourceSingleton.increment()
EventIdlingResourceSingleton.increment()
viewModelScope.launch {
configureEventCoordinates(value)
.flowOn(Dispatchers.IO)
Expand All @@ -233,20 +234,20 @@ class EventDetailsViewModel(
)
_eventCoordinates.value = eventCoordinates
setUpEventDetails()
EventDetailIdlingResourceSingleton.decrement()
EventIdlingResourceSingleton.decrement()
}
}
}

fun setUpEventTemp(status: EventTempStatus? = null, isChecked: Boolean = true) {
EventDetailIdlingResourceSingleton.increment()
EventIdlingResourceSingleton.increment()
if (isChecked) {
configureEventTemp(status).apply {
_eventTemp.value = this
setUpEventDetails()
}
}
EventDetailIdlingResourceSingleton.decrement()
EventIdlingResourceSingleton.decrement()
}

fun getSelectableDates(eventDate: EventDate): SelectableDates {
Expand Down
Loading
Loading