fix(android): usar código estructural para Instalación y Subinstalación
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
name: Android structural type fix once
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'release/android-0.19.0-final-field-flow'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
fix:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: release/android-0.19.0-final-field-flow
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Use server structural type code for mobile filtering
|
||||
run: |
|
||||
set -Eeuo pipefail
|
||||
python - <<'PY'
|
||||
from pathlib import Path
|
||||
p = Path('android-app/app/src/main/java/com/korexlabs/dhinspeccion/ui/ModernVisitRoot.kt')
|
||||
text = p.read_text()
|
||||
old = ' return modernNormalize(type.typeName ?: type.name)\n'
|
||||
new = ' return modernNormalize(type.code.ifBlank { type.typeName ?: type.name })\n'
|
||||
if old not in text:
|
||||
raise SystemExit('modernItemTypeCode pattern not found')
|
||||
p.write_text(text.replace(old, new, 1))
|
||||
PY
|
||||
|
||||
- name: Commit fix and remove temporary workflow
|
||||
run: |
|
||||
set -Eeuo pipefail
|
||||
git config user.name 'DH Android Finalizer'
|
||||
git config user.email 'android-finalizer@dhv2.local'
|
||||
git rm .github/workflows/android-structural-type-fix-once.yml
|
||||
git add android-app/app/src/main/java/com/korexlabs/dhinspeccion/ui/ModernVisitRoot.kt
|
||||
git commit -m 'fix(android): usar código estructural para Instalación y Subinstalación'
|
||||
git push origin HEAD:release/android-0.19.0-final-field-flow
|
||||
@@ -1077,7 +1077,7 @@ private fun ModernStepHeader(step: Int, title: String) {
|
||||
|
||||
private fun modernItemTypeCode(item: FieldInventoryItem): String {
|
||||
val type = item.type ?: return ""
|
||||
return modernNormalize(type.typeName ?: type.name)
|
||||
return modernNormalize(type.code.ifBlank { type.typeName ?: type.name })
|
||||
}
|
||||
|
||||
private fun modernNormalize(value: String): String = value.trim().lowercase()
|
||||
|
||||
Reference in New Issue
Block a user