Skip to content
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
2 changes: 1 addition & 1 deletion app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@
tools:node="merge" />

<activity
android:name="org.commcare.activities.connect.PersonalIdCredentialActivity"/>
android:name="org.commcare.activities.connect.PersonalIdWorkHistoryActivity"/>

<service
android:name="org.commcare.services.CommCareFirebaseMessagingService"
Expand Down
6 changes: 3 additions & 3 deletions app/res/drawable/personal_id_credential_pending.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
android:width="1dp"
android:color="@color/personal_id_credential_yellow_pending_bg" />
android:color="@color/personal_id_work_history_yellow_pending_bg" />

<solid android:color="@color/personal_id_credential_yellow_pending_bg" />
<solid android:color="@color/personal_id_work_history_yellow_pending_bg" />

<padding
android:left="1dp"
Expand All @@ -13,4 +13,4 @@
android:top="1dp" />

<corners android:radius="16dp" />
</shape>
</shape>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:background="@color/white">

<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_credentials"
android:id="@+id/tab_work_history"
android:layout_width="match_parent"
android:backgroundTint="@color/white"
android:layout_height="?actionBarSize"
Expand All @@ -26,13 +26,13 @@
app:tabTextColor="@color/connect_grey" />

<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vpCredentials"
android:id="@+id/vp_work_history"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tab_credentials" />
app:layout_constraintTop_toBottomOf="@id/tab_work_history" />

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvLearnMore"
Expand All @@ -44,7 +44,7 @@
android:drawablePadding="10dp"
android:paddingHorizontal="20dp"
android:paddingVertical="10dp"
android:text="@string/personalid_credential_learn_more_about_credentials"
android:text="@string/personalid_work_history_learn_more"
android:textColor="@color/white"
android:textSize="15sp"
app:drawableTint="@color/white"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.commcare.fragments.personalId.EarnedCredentialFragment">
tools:context="org.commcare.fragments.personalId.WorkHistoryEarnedFragment">

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvNoCredentialsAvailable"
android:id="@+id/tvNoWorkHistoryAvailable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@color/personal_id_credentials_earned"
android:background="@color/personal_id_work_history_earned"
android:gravity="start"
android:lineSpacingExtra="10dp"
android:padding="20dp"
android:visibility="gone"
android:text="@string/personalid_credential_no_credentials_currently_available"
android:text="@string/personalid_work_history_no_records_available"
android:textColor="@color/connect_yellow_dot"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvEarnedCredential"
android:id="@+id/rvEarnedWorkHistory"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="10dp"
Expand All @@ -36,4 +36,4 @@
android:orientation="vertical"
tools:listitem="@layout/item_earned_credential" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="org.commcare.fragments.personalId.PendingCredentialFragment">
tools:context="org.commcare.fragments.personalId.WorkHistoryPendingFragment">

<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvNoPendingCredential"
android:id="@+id/tvNoPendingWorkHistory"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="15dp"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="14sp"
android:visibility="gone"
android:text="@string/personalid_credential_no_pending_credential"
android:text="@string/personalid_work_history_no_pending_records"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvPendingCredential"
android:id="@+id/rvPendingWorkHistory"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="10dp"
Expand All @@ -34,4 +34,4 @@
android:layout_marginHorizontal="15dp"
tools:listitem="@layout/item_pending_credential" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
6 changes: 3 additions & 3 deletions app/res/layout/item_earned_credential.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
android:gravity="center"
android:paddingHorizontal="15dp"
android:text="3 Months of Activity"
android:textColor="@color/personal_id_credential_earned_activity"
android:textColor="@color/personal_id_work_history_earned_activity"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@id/ivRibbin"
app:layout_constraintEnd_toEndOf="@id/ivRibbin"
Expand All @@ -81,7 +81,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:src="@drawable/ic_personalid_credential_ribbin"
android:src="@drawable/ic_personalid_work_history_ribbin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvActivity" />
Expand Down Expand Up @@ -110,7 +110,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="Completed on 21/02/2024"
android:textColor="@color/personal_id_credential_earned_grey"
android:textColor="@color/personal_id_work_history_earned_grey"
android:textSize="11sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
12 changes: 6 additions & 6 deletions app/res/layout/item_pending_credential.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:backgroundTint="@color/personal_id_credential_grey_pending"
app:cardBackgroundColor="@color/personal_id_credential_grey_pending"
android:backgroundTint="@color/personal_id_work_history_grey_pending"
app:cardBackgroundColor="@color/personal_id_work_history_grey_pending"
app:cardCornerRadius="16dp">

<androidx.constraintlayout.widget.ConstraintLayout
Expand All @@ -17,7 +17,7 @@
android:id="@+id/ivPending"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_personalid_credential_pending_person"
android:src="@drawable/ic_personalid_work_history_pending_person"
app:layout_constraintEnd_toEndOf="@id/tvPending"
Comment on lines +20 to 21
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

🧩 Analysis chain

Drawable/string updates aligned; check locale coverage and plan resource naming cleanup.

Please verify @string/personalid_work_history_pending exists in all locale files and the new drawable is present. Optional: background/color resources still use personal_id_credential_*; consider mirroring under *_work_history later for consistency.

Check for missing translations:

Also applies to: 33-34


🏁 Script executed:

#!/bin/bash
# List any strings.xml missing the new key
fd -a 'values*/*strings.xml' app/res | while read -r f; do
  if ! rg -q 'name="personalid_work_history_pending"' "$f"; then
    echo "Missing in: $f"
  fi
done

Length of output: 0


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Working directory: $(pwd)"
echo

# Find all strings xml files under any res/values* directories
echo "Finding strings.xml files under */res/values* ..."
mapfile -t strings_files < <(find . -type f -path "*/res/values*/strings*.xml" -print)
if [ ${#strings_files[@]} -eq 0 ]; then
  echo "No strings.xml files found under res/values*"
else
  echo "Found ${#strings_files[@]} strings file(s):"
  for f in "${strings_files[@]}"; do printf " - %s\n" "$f"; done
fi
echo

# Check presence of the string key
echo "Checking for name=\"personalid_work_history_pending\" in each strings file..."
present=0
missing=0
for f in "${strings_files[@]}"; do
  if grep -q 'name="personalid_work_history_pending"' "$f"; then
    echo "Present: $f"
    present=$((present+1))
  else
    echo "Missing: $f"
    missing=$((missing+1))
  fi
done
echo "Summary: present=$present missing=$missing total=${#strings_files[@]}"
echo

# Search for exact drawable filename under res/drawable* directories
echo "Searching for drawable files named ic_personalid_work_history_pending_person.* under res/drawable* ..."
mapfile -t exact_drawables < <(find . -type f -path "*/res/drawable*" -iname "ic_personalid_work_history_pending_person.*" -print)
if [ ${#exact_drawables[@]} -gt 0 ]; then
  echo "Exact drawable file(s) found:"
  for d in "${exact_drawables[@]}"; do printf " - %s\n" "$d"; done
else
  echo "No exact drawable filename match found. Doing fuzzy search for 'personalid_work_history_pending' in drawable dirs..."
  mapfile -t fuzzy_drawables < <(find . -type f -path "*/res/drawable*" -iname "*personalid_work_history_pending*" -print)
  if [ ${#fuzzy_drawables[@]} -gt 0 ]; then
    echo "Fuzzy drawable match(es) found:"
    for d in "${fuzzy_drawables[@]}"; do printf " - %s\n" "$d"; done
  else
    echo "No drawable matches found."
  fi
fi
echo

# Search for occurrences of 'personal_id_credential_' in res xml files (colors/backgrounds, etc.)
echo "Searching for usages of 'personal_id_credential_' in res xml files..."
mapfile -t credential_matches < <(find . -type f -path "*/res/*" -iname "*.xml" -exec grep -nH "personal_id_credential_" {} \; || true)
if [ ${#credential_matches[@]} -eq 0 ]; then
  echo "No occurrences of 'personal_id_credential_' found in res xml files."
else
  echo "Occurrences found:"
  for m in "${credential_matches[@]}"; do printf " - %s\n" "$m"; done
fi

Length of output: 145


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Working directory: $(pwd)"
echo

# Collect strings.xml files (robust to shells without /dev/fd/process-substitution)
strings_tmp=$(mktemp)
find . -type f -path "*/res/values*/strings*.xml" -print0 > "$strings_tmp" || true

if [ ! -s "$strings_tmp" ]; then
  echo "No strings.xml files found under res/values*"
else
  echo "Found strings.xml files:"
  xargs -0 -n1 < "$strings_tmp" | sed 's/^/ - /'
fi
echo

if [ -s "$strings_tmp" ]; then
  echo "Checking for name=\"personalid_work_history_pending\" in each strings.xml..."
  xargs -0 -n1 < "$strings_tmp" | while IFS= read -r f; do
    if grep -q 'name="personalid_work_history_pending"' "$f"; then
      echo "Present: $f"
    else
      echo "Missing : $f"
    fi
  done
  total=$(xargs -0 -n1 < "$strings_tmp" | wc -l)
  present_count=$(xargs -0 -n1 < "$strings_tmp" | xargs -I{} grep -nH 'name="personalid_work_history_pending"' {} 2>/dev/null | wc -l || true)
  echo "Summary: total=$total present=$present_count missing=$((total - present_count))"
fi
echo

# Drawable checks
echo "Searching for drawable ic_personalid_work_history_pending_person.* under res/drawable* ..."
drawables=$(find . -type f -path "*/res/drawable*" -iname "ic_personalid_work_history_pending_person.*" -print || true)
if [ -n "$drawables" ]; then
  echo "Exact drawable(s) found:"
  printf "%s\n" "$drawables" | sed 's/^/ - /'
else
  echo "No exact drawable match found. Fuzzy search for 'personalid_work_history_pending' in res/drawable* ..."
  find . -type f -path "*/res/drawable*" -iname "*personalid_work_history_pending*" -print | sed 's/^/ - /' || echo "No fuzzy matches found."
fi
echo

# Search for 'personal_id_credential_' usages in res XML files
echo "Searching for 'personal_id_credential_' in res XML files..."
find . -type f -path "*/res/*" -iname "*.xml" -print0 | xargs -0 grep -nH "personal_id_credential_" || echo "No occurrences found."
echo

rm -f "$strings_tmp"

Length of output: 3102


Add missing translations and confirm drawable; plan resource-naming cleanup

  • missing key personalid_work_history_pending in: ./app/res/values-large/strings.xml, ./app/res/values-lt/strings.xml, ./app/res/values-no/strings.xml, ./app/res/values-small/strings.xml, ./app/res/values-sw720dp-land/strings.xml, ./app/res/values-xlarge/strings.xml, ./commcare-support-library/src/main/res/values/strings.xml — add translations or ensure a fallback.
  • drawable present: ./app/res/drawable/ic_personalid_work_history_pending_person.xml.
  • occurrences of legacy naming (personal_id_credential_*) found in: ./app/res/drawable/personal_id_credential_pending.xml, ./app/res/layout/item_earned_credential.xml, ./app/res/layout/item_pending_credential.xml, ./app/res/values/colors.xml — consider mirroring names to *_work_history for consistency later.
🤖 Prompt for AI Agents
In app/res/layout/item_pending_credential.xml lines 20-21, the layout references
the string key personalid_work_history_pending which is missing from multiple
localized string files; add that key with appropriate translations to
./app/res/values-large/strings.xml, ./app/res/values-lt/strings.xml,
./app/res/values-no/strings.xml, ./app/res/values-small/strings.xml,
./app/res/values-sw720dp-land/strings.xml, ./app/res/values-xlarge/strings.xml
and ./commcare-support-library/src/main/res/values/strings.xml (or ensure the
base ./app/res/values/strings.xml provides a fallback), verify the drawable
./app/res/drawable/ic_personalid_work_history_pending_person.xml exists and is
referenced correctly, and to prepare for a future resource-name cleanup update
or create mirrored names for legacy personal_id_credential_* resources
(./app/res/drawable/personal_id_credential_pending.xml,
./app/res/layout/item_earned_credential.xml,
./app/res/layout/item_pending_credential.xml, ./app/res/values/colors.xml) so
both naming schemes resolve until you perform a coordinated rename.

app:layout_constraintStart_toStartOf="@id/tvPending"
app:layout_constraintTop_toTopOf="parent" />
Expand All @@ -30,8 +30,8 @@
android:background="@drawable/personal_id_credential_pending"
android:paddingHorizontal="10dp"
android:paddingVertical="2dp"
android:text="@string/personalid_credential_pending"
android:textColor="@color/personal_id_credential_yellow_pending"
android:text="@string/personalid_work_history_pending"
android:textColor="@color/personal_id_work_history_yellow_pending"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/ivPending"
Expand Down Expand Up @@ -68,4 +68,4 @@
app:layout_constraintTop_toBottomOf="@+id/tvAppName" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView>
6 changes: 3 additions & 3 deletions app/res/menu/menu_work_history.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/cloud_sync"
android:title="@string/personalid_credential_cloud_sync"
android:contentDescription="@string/personalid_credential_cloud_sync"
android:title="@string/personalid_work_history_sync"
android:contentDescription="@string/personalid_work_history_sync"
android:icon="@drawable/ic_backup"
app:iconTint="@color/white"
app:showAsAction="always"/>

<item
android:id="@+id/more"
android:title="@string/personalid_credential_cloud_sync"
android:title="@string/personalid_work_history_sync"
android:contentDescription="action"
android:icon="@drawable/ic_connect_action_overflow"
app:showAsAction="always"/>
Expand Down
32 changes: 14 additions & 18 deletions app/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -470,24 +470,20 @@
<string name="personalid_camera_permission_msg">Para tomar una foto, CommCare necesita permiso para usar la cámara de tu dispositivo.</string>
<string name="personalid_capture_photo">Tomar foto</string>
<string name="personalid_configuration_locked_account">Su cuenta ha sido bloqueada. Por favor, contacte con el servicio de asistencia.</string>
<string name="personalid_credential_my_worker_history">Mi Historial Laboral</string>
<string name="personalid_credential">Historial Laboral</string>
<string name="personalid_credential_worked_on">Trabajado en:</string>
<string name="personalid_credential_earned_on">Obtenido el:</string>
<string name="personalid_credential_active_for">Activo durante:</string>
<string name="personalid_credential_learn_more_about_credentials">Más Información Sobre las Credenciales</string>
<string name="personalid_credential_view_credential">Ver Credencial</string>
<string name="personalid_credential_no_credentials_currently_available">No hay credenciales disponibles actualmente. Haga clic en Actualizar o vuelva a consultar más tarde.</string>
<string name="personalid_credential_earned">Ganado</string>
<string name="personalid_credential_pending">Pendiente</string>
<string name="personalid_credential_cloud_sync">Sincronización en la Nube</string>
<string name="personalid_credential_level_1_month_active">1 Mes de\nActividad</string>
<string name="personalid_credential_level_2_month_active">2 Meses de\nActividad</string>
<string name="personalid_credential_level_3_month_active">3 Meses de\nActividad</string>
<string name="personalid_credential_level_6_month_active">6 Meses de\nActividad</string>
<string name="personalid_credential_level_9_month_active">9 Meses de\nActividad</string>
<string name="personalid_credential_level_12_month_active">12 Meses de\nActividad</string>
<string name="personalid_credential_no_pending_credential">No hay credenciales pendientes</string>
<string name="personalid_work_history_title">Mi Historial Laboral</string>
<string name="personalid_work_history">Historial Laboral</string>
<string name="personalid_work_history_learn_more">Más Información Sobre las Credenciales</string>
<string name="personalid_work_history_no_records_available">No hay registros de historial laboral disponibles actualmente. Haga clic en Actualizar o vuelva a consultar más tarde.</string>
<string name="personalid_work_history_earned">Ganado</string>
<string name="personalid_work_history_pending">Pendiente</string>
<string name="personalid_work_history_sync">Sincronizar</string>
<string name="personalid_work_history_level_1_month_active">1 Mes de\nActividad</string>
<string name="personalid_work_history_level_2_month_active">2 Meses de\nActividad</string>
<string name="personalid_work_history_level_3_month_active">3 Meses de\nActividad</string>
<string name="personalid_work_history_level_6_month_active">6 Meses de\nActividad</string>
<string name="personalid_work_history_level_9_month_active">9 Meses de\nActividad</string>
<string name="personalid_work_history_level_12_month_active">12 Meses de\nActividad</string>
<string name="personalid_work_history_no_pending_records">No hay registros pendientes en este momento</string>

<string name="personalid_notification">Notificaciones</string>

Expand Down
32 changes: 14 additions & 18 deletions app/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -472,24 +472,20 @@ License.
<string name="personalid_camera_permission_title">Autorisation pour la caméra</string>
<string name="personalid_camera_permission_msg">Afin de prendre une photo, CommCare a besoin de l\'autorisation d\'utiliser l\'appareil photo de votre appareil.</string>
<string name="personalid_capture_photo">Prendre une photo</string>
<string name="personalid_credential_my_worker_history">Mon Historique de Travail</string>
<string name="personalid_credential">Historique de Travail</string>
<string name="personalid_credential_worked_on">Travaillé Sur :</string>
<string name="personalid_credential_earned_on">Gagné Le :</string>
<string name="personalid_credential_active_for">Actif Pendant :</string>
<string name="personalid_credential_learn_more_about_credentials">En Savoir Plus Sur les Titres de Compétences</string>
<string name="personalid_credential_view_credential">Voir le Titre de Compétences</string>
<string name="personalid_credential_no_credentials_currently_available">Aucune information d\'identification n\'est actuellement disponible. Cliquez sur Actualiser ou revenez plus tard.</string>
<string name="personalid_credential_earned">Gagné</string>
<string name="personalid_credential_pending">En attente</string>
<string name="personalid_credential_cloud_sync">Synchronisation Cloud</string>
<string name="personalid_credential_level_1_month_active">1 Mois d\'\nActivité</string>
<string name="personalid_credential_level_2_month_active">2 Mois d\'\nActivité</string>
<string name="personalid_credential_level_3_month_active">3 Mois d\'\nActivité</string>
<string name="personalid_credential_level_6_month_active">6 Mois d\'\nActivité</string>
<string name="personalid_credential_level_9_month_active">9 Mois d\'\nActivité</string>
<string name="personalid_credential_level_12_month_active">12 Mois d\'\nActivité</string>
<string name="personalid_credential_no_pending_credential">Il n\'y a aucune lettre de créance en attente</string>
<string name="personalid_work_history_title">Mon Historique de Travail</string>
<string name="personalid_work_history">Historique de Travail</string>
<string name="personalid_work_history_learn_more">En Savoir Plus Sur les Titres de Compétences</string>
<string name="personalid_work_history_no_records_available">Aucun enregistrement d\'historique de travail n\'est actuellement disponible. Cliquez sur Actualiser ou revenez plus tard.</string>
<string name="personalid_work_history_earned">Gagné</string>
<string name="personalid_work_history_pending">En attente</string>
<string name="personalid_work_history_sync">Synchroniser</string>
<string name="personalid_work_history_level_1_month_active">1 Mois d\'\nActivité</string>
<string name="personalid_work_history_level_2_month_active">2 Mois d\'\nActivité</string>
<string name="personalid_work_history_level_3_month_active">3 Mois d\'\nActivité</string>
<string name="personalid_work_history_level_6_month_active">6 Mois d\'\nActivité</string>
<string name="personalid_work_history_level_9_month_active">9 Mois d\'\nActivité</string>
<string name="personalid_work_history_level_12_month_active">12 Mois d\'\nActivité</string>
<string name="personalid_work_history_no_pending_records">Il n\'y a aucun enregistrement en attente pour le moment</string>

<string name="personalid_notification">Notifications</string>

Expand Down
Loading
Loading