Skip to content

Commit

Permalink
Merge pull request #581 from bcgov/develop
Browse files Browse the repository at this point in the history
Release-2.1.0-235
  • Loading branch information
PINAKIN-KANSARA-EY committed Feb 28, 2024
2 parents c0691e7 + 65815bb commit c839d60
Show file tree
Hide file tree
Showing 91 changed files with 4,050 additions and 366 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/android-develop-pr-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
alias: ${{ secrets.KEYSTORE_ALIAS_DEBUG }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD_DEBUG }}
keyPassword: ${{ secrets.KEYSTORE_KEY_PASSWORD_DEBUG }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

- name: upload dev apk
uses: actions/upload-artifact@v3
Expand All @@ -93,6 +95,8 @@ jobs:
alias: ${{ secrets.KEYSTORE_ALIAS_DEBUG }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD_DEBUG }}
keyPassword: ${{ secrets.KEYSTORE_KEY_PASSWORD_DEBUG }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

- name: upload stage apk
uses: actions/upload-artifact@v3
Expand All @@ -110,6 +114,8 @@ jobs:
alias: ${{ secrets.KEYSTORE_ALIAS_DEBUG }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD_DEBUG }}
keyPassword: ${{ secrets.KEYSTORE_KEY_PASSWORD_DEBUG }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

- name: upload prod apk
uses: actions/upload-artifact@v3
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ jobs:
alias: ${{ secrets.KEYSTORE_ALIAS_DEBUG }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD_DEBUG }}
keyPassword: ${{ secrets.KEYSTORE_KEY_PASSWORD_DEBUG }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

- name: upload mock apk
uses: actions/upload-artifact@v3
Expand All @@ -76,6 +78,8 @@ jobs:
alias: ${{ secrets.KEYSTORE_ALIAS_DEBUG }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD_DEBUG }}
keyPassword: ${{ secrets.KEYSTORE_KEY_PASSWORD_DEBUG }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

- name: upload dev apk
uses: actions/upload-artifact@v3
Expand All @@ -93,6 +97,8 @@ jobs:
alias: ${{ secrets.KEYSTORE_ALIAS_DEBUG }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD_DEBUG }}
keyPassword: ${{ secrets.KEYSTORE_KEY_PASSWORD_DEBUG }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

- name: upload stage apk
uses: actions/upload-artifact@v3
Expand All @@ -110,6 +116,8 @@ jobs:
alias: ${{ secrets.KEYSTORE_ALIAS_DEBUG }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD_DEBUG }}
keyPassword: ${{ secrets.KEYSTORE_KEY_PASSWORD_DEBUG }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

- name: upload prod apk
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ captures/
.idea/deploymentTargetDropDown.xml
.idea/androidTestResultsUserPreferences.xml
.idea/kotlinc.xml
.idea/migrations.xml
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
Expand Down
38 changes: 37 additions & 1 deletion .idea/inspectionProfiles/ktlint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions app/src/main/java/ca/bc/gov/bchealth/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import ca.bc.gov.bchealth.utils.showServiceDownMessage
import ca.bc.gov.bchealth.utils.viewBindings
import ca.bc.gov.bchealth.viewmodel.AnalyticsFeatureViewModel
import ca.bc.gov.bchealth.workers.FetchAuthenticatedHealthRecordsWorker
import ca.bc.gov.common.BuildConfig.FLAG_SERVICE_TAB
import ca.bc.gov.common.model.settings.AnalyticsFeature
import ca.bc.gov.repository.bcsc.BACKGROUND_AUTH_RECORD_FETCH_WORK_NAME
import com.google.android.material.snackbar.Snackbar
Expand Down Expand Up @@ -63,11 +62,7 @@ class MainActivity : AppCompatActivity() {
supportFragmentManager.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
val navController = navHostFragment.navController
binding.bottomNav.inflateMenu(
if (FLAG_SERVICE_TAB) {
R.menu.bottom_nav_services_menu
} else {
R.menu.bottom_nav_menu
}
R.menu.bottom_nav_menu
)
binding.bottomNav.setupWithNavController(navController)
binding.bottomNav.setOnItemSelectedListener {
Expand Down
23 changes: 23 additions & 0 deletions app/src/main/java/ca/bc/gov/bchealth/SplashViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class SplashViewModel @Inject constructor(
init {
onBoardingRepository.checkIfReOnBoardingRequired(BuildConfig.VERSION_CODE)
initializeAppData()
addBCCancerQuickLink()
}

fun checkAppVersion() {
Expand Down Expand Up @@ -113,6 +114,21 @@ class SplashViewModel @Inject constructor(
}
}

private fun addBCCancerQuickLink() = viewModelScope.launch {
try {
val appFeature = appFeatureRepository.getAppFeature(AppFeatureName.HEALTH_RECORDS)
val tile = QuickAccessTileDto(
featureId = appFeature.id,
tileName = QuickAccessLinkName.BC_CANCER_SCREENING,
tilePayload = "CancerScreening",
showAsQuickAccess = false
)
quickAccessTileRepository.insert(tile)
} catch (e: Exception) {
e.printStackTrace()
}
}

private fun serviceQuickLinkTilesItem(id: Long): List<QuickAccessTileDto> {
return listOf(
QuickAccessTileDto(
Expand Down Expand Up @@ -179,7 +195,14 @@ class SplashViewModel @Inject constructor(
tileName = QuickAccessLinkName.IMAGING_REPORTS,
tilePayload = "ImagingReports",
showAsQuickAccess = false
),
QuickAccessTileDto(
featureId = id,
tileName = QuickAccessLinkName.BC_CANCER_SCREENING,
tilePayload = "CancerScreening",
showAsQuickAccess = false
)

)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
package ca.bc.gov.bchealth.compose.component

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material.Card
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.layoutId
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.constraintlayout.compose.ConstraintLayout
import androidx.constraintlayout.compose.ConstraintSet
import androidx.constraintlayout.compose.Dimension
import ca.bc.gov.bchealth.R
import ca.bc.gov.bchealth.compose.BasePreview
import ca.bc.gov.bchealth.compose.theme.HealthGatewayTheme
import ca.bc.gov.bchealth.compose.theme.bannerBackgroundBlue
import ca.bc.gov.bchealth.ui.custom.MyHealthClickableText

private const val BANNER_ICON_ID = "banner_icon_id"
private const val BANNER_BODY_1_ID = "banner_body_1_id"
private const val BANNER_BODY_2_ID = "banner_body_2_id"

@Composable
fun BCCancerBannerUi(
onLinkClick: (String) -> Unit,
modifier: Modifier = Modifier,
body1: String,
clickableText: String,
body2: String
) {

Card(
modifier,
backgroundColor = bannerBackgroundBlue
) {
BoxWithConstraints(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.padding(16.dp)
) {
val constraint = immunizationBannerConstraints()
ConstraintLayout(constraint, modifier = Modifier.fillMaxWidth()) {

Image(
modifier = Modifier.layoutId(BANNER_ICON_ID),
painter = painterResource(id = R.drawable.ic_info),
contentDescription = null
)

Text(
modifier = Modifier.layoutId(BANNER_BODY_1_ID),
text = body1,
style = MaterialTheme.typography.body1,
color = MaterialTheme.colors.primary
)

MyHealthClickableText(
modifier = Modifier.layoutId(BANNER_BODY_2_ID),
style = MaterialTheme.typography.body1,
fullText = body2,
clickableText = clickableText,
action = { onLinkClick(clickableText) }
)
}
}
}
}

private fun immunizationBannerConstraints(): ConstraintSet {
return ConstraintSet {
val bannerIconId = createRefFor(BANNER_ICON_ID)
val bannerBody1Id = createRefFor(BANNER_BODY_1_ID)
val bannerBody2Id = createRefFor(BANNER_BODY_2_ID)

constrain(bannerIconId) {
start.linkTo(parent.start)
top.linkTo(bannerBody1Id.top, 4.dp)
}

constrain(bannerBody1Id) {
start.linkTo(bannerIconId.end, 16.dp)
top.linkTo(parent.top)
end.linkTo(parent.end, 16.dp)
width = Dimension.fillToConstraints
}

constrain(bannerBody2Id) {
start.linkTo(bannerBody1Id.start)
top.linkTo(bannerBody1Id.bottom)
end.linkTo(bannerBody1Id.end)
bottom.linkTo(parent.bottom)
width = Dimension.fillToConstraints
}
}
}

@BasePreview
@Composable
private fun ImmunizationBannerUIPreview() {
HealthGatewayTheme {
BCCancerBannerUi(
onLinkClick = {},
body1 = stringResource(id = R.string.records_immunization_banner_top),
clickableText = stringResource(id = R.string.records_immunization_banner_click),
body2 = stringResource(id = R.string.records_immunization_banner_click),
)
}
}
13 changes: 3 additions & 10 deletions app/src/main/java/ca/bc/gov/bchealth/compose/component/Button.kt
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,7 @@ fun HGTextButton(
modifier,
enabled,
defaultHeight,
contentPadding = if (leadingIcon != null) {
ButtonDefaults.ButtonWithIconContentPadding
} else {
ButtonDefaults.TextButtonContentPadding
}
contentPadding = ButtonDefaults.TextButtonContentPadding
) {
HGButtonContent(
{
Expand All @@ -235,6 +231,7 @@ fun HGTextButton(
modifier: Modifier = Modifier,
enabled: Boolean = true,
defaultHeight: Dp = HGButtonDefaults.LargeButtonHeight,
contentPadding: PaddingValues = ButtonDefaults.TextButtonContentPadding,
content: @Composable () -> Unit,
leadingIcon: @Composable (() -> Unit)? = null
) {
Expand All @@ -243,11 +240,7 @@ fun HGTextButton(
modifier,
enabled,
defaultHeight,
contentPadding = if (leadingIcon != null) {
ButtonDefaults.ButtonWithIconContentPadding
} else {
ButtonDefaults.TextButtonContentPadding
}
contentPadding = contentPadding
) {
HGButtonContent(
content,
Expand Down
Loading

0 comments on commit c839d60

Please sign in to comment.