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

Remove education dialog for error pills in Drafts list #6528

Draft
wants to merge 1 commit into
base: master
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 @@ -69,7 +69,7 @@ public void whenEditingANonFinalizedForm_withViolatedConstraintsOnCurrentScreen_
.clickSave()
.pressBackAndDiscardChanges()

.clickDrafts(1, false)
.clickDrafts(1)
.clickOnForm("Two Question Required")
.assertText("Another Reuben");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void whenEditingANonFinalizedForm_withViolatedConstraintsOnCurrentScreen_
.pressBack(new SaveOrDiscardFormDialog<>(new MainMenuPage()))
.clickSaveChanges()

.clickDrafts(1, false)
.clickDrafts(1)
.clickOnForm("Two Question Required")
.assertText("Another Reuben");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class BulkFinalizationTest {

.clickOptionsIcon(string.finalize_all_drafts)
.clickOnString(string.finalize_all_drafts)
.clickOnTextInDialog(string.finalize, EditSavedFormPage(false))
.clickOnTextInDialog(string.finalize, EditSavedFormPage())
.checkIsSnackbarWithQuantityDisplayed(plurals.bulk_finalize_failure, 1)
}

Expand All @@ -119,7 +119,7 @@ class BulkFinalizationTest {
.clickOnForm("One Question")
.killAndReopenApp(rule, recentAppsRule, MainMenuPage())

.clickDrafts(false)
.clickDrafts()
.clickFinalizeAll(1)
.clickFinalize()
.checkIsSnackbarWithMessageDisplayed(string.bulk_finalize_unsupported, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class SwitchProjectTest {
.pressBack(MainMenuPage())

// Check instances
.clickDrafts(1, false)
.clickDrafts(1)
.assertText("Two Question")
.pressBack(MainMenuPage())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class BulkFinalizationConfirmationDialogPage(private val count: Int) : Page<Bulk
}

fun clickFinalize(): EditSavedFormPage {
return this.clickOnTextInDialog(R.string.finalize, EditSavedFormPage(false))
return this.clickOnTextInDialog(R.string.finalize, EditSavedFormPage())
}

fun clickCancel(): EditSavedFormPage {
return this.clickOnTextInDialog(R.string.cancel, EditSavedFormPage(false))
return this.clickOnTextInDialog(R.string.cancel, EditSavedFormPage())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,13 @@
import org.odk.collect.android.R;

public class EditSavedFormPage extends Page<EditSavedFormPage> {
private final boolean firstOpen;

public EditSavedFormPage(boolean first) {
this.firstOpen = first;
}

@Override
public EditSavedFormPage assertOnPage() {
closeDraftsPillsEducationDialog();
assertText(org.odk.collect.strings.R.string.review_data);
return this;
}

private void closeDraftsPillsEducationDialog() {
if (firstOpen) {
assertTextInDialog(org.odk.collect.strings.R.string.new_feature);
clickOKOnDialog();
}
}

public EditSavedFormPage checkInstanceState(String instanceName, String desiredStatus) {
int desiredImageId = getInstanceIcon(desiredStatus);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,13 @@ private void goToBlankForm(String formName) {
}

public EditSavedFormPage clickDrafts() {
return clickDrafts(true);
}

public EditSavedFormPage clickDrafts(boolean firstOpen) {
onView(withId(R.id.review_data)).perform(click());
return new EditSavedFormPage(firstOpen).assertOnPage();
return new EditSavedFormPage().assertOnPage();
}

public EditSavedFormPage clickDrafts(int formCount) {
return clickDrafts(formCount, true);
}

public EditSavedFormPage clickDrafts(int formCount, boolean firstOpen) {
assertNumberOfEditableForms(formCount);
return clickDrafts(firstOpen);
return clickDrafts();
}

public MainMenuPage assertNumberOfFinalizedForms(int number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

import org.odk.collect.android.R;
import org.odk.collect.android.adapters.InstanceListCursorAdapter;
import org.odk.collect.android.dao.CursorLoaderFactory;
Expand All @@ -59,8 +57,6 @@
import org.odk.collect.lists.EmptyListView;
import org.odk.collect.material.MaterialProgressDialogFragment;
import org.odk.collect.settings.SettingsProvider;
import org.odk.collect.settings.keys.MetaKeys;
import org.odk.collect.strings.R.string;

import java.util.Arrays;

Expand Down Expand Up @@ -117,16 +113,6 @@ public void onCreate(Bundle savedInstanceState) {
if (formMode == null || ApplicationConstants.FormModes.EDIT_SAVED.equalsIgnoreCase(formMode)) {
setTitle(getString(org.odk.collect.strings.R.string.review_data));
editMode = true;

if (!settingsProvider.getMetaSettings().getBoolean(MetaKeys.DRAFTS_PILLS_EDUCATION_SHOWN)) {
new MaterialAlertDialogBuilder(this)
.setTitle(string.new_feature)
.setMessage(string.drafts_pills_education_message)
.setPositiveButton(string.ok, null)
.show();

settingsProvider.getMetaSettings().save(MetaKeys.DRAFTS_PILLS_EDUCATION_SHOWN, true);
}
} else {
setTitle(getString(org.odk.collect.strings.R.string.view_sent_forms));
EmptyListView emptyListView = findViewById(android.R.id.empty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ object MetaKeys {
const val LAST_LAUNCHED = "last_launched"
const val LAST_USED_PEN_COLOR = "last_used_pen_color"
const val PERMISSIONS_REQUESTED = "permissions_requested"
const val DRAFTS_PILLS_EDUCATION_SHOWN = "drafts_pills_education_shown"
}
6 changes: 2 additions & 4 deletions strings/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1026,10 +1026,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">Zrušte zaškrtnutím, aby se skrylo z konceptů</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">Nová funkce</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">Návrh seznamu nyní zobrazuje validační chyby. Při každém uložení formuláře jako návrhu je aktualizován jeho validační stav. Návrhy označené jako \"Chyby\" buď nemají vyplněné povinné otázky, nebo obsahují hodnoty, které nejsou povolené.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">Nic není k zobrazení</string>
<!--Message displayed when the list of blank forms is empty-->
<string name="empty_list_of_blank_forms_title">Žádné prázdné formuláře</string>
Expand Down
6 changes: 2 additions & 4 deletions strings/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1063,10 +1063,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">Abwählen um von Entwürfen zu verbergen</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">Neue Funktion</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">Die Entwurfsliste zeigt jetzt Validierungsfehler an. Bei jedem Speichern als Entwurf eines Formulars wird dessen Validierungsstatus aktualisiert.\n\nEntwürfe, die mit \"Fehler\" markiert sind, haben entweder fehlende Antworten bei Pflichtfragen oder ungültige Antworten.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">Keine Inhalte vorhanden.</string>
<!--Message displayed when the list of blank forms is empty-->
<string name="empty_list_of_blank_forms_title">Keine leeren Formulare</string>
Expand Down
6 changes: 2 additions & 4 deletions strings/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,10 +1075,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">Desmarque para ocultarse de los borradores</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">Nueva función</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">La lista borrador ahora muestra errores de validación. Cada vez que guarda un formulario como borrador, su estado de validación se actualiza.\n\nA los borradores marcados con \"Errores\" les faltan preguntas obligatorias o tienen valores que no están permitidos.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">No hay nada disponible para mostrar.</string>
<!--Message displayed when the list of blank forms is empty-->
<string name="empty_list_of_blank_forms_title">No hay formularios en blanco</string>
Expand Down
6 changes: 2 additions & 4 deletions strings/src/main/res/values-fa-rAF/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">برای پنهان شدن از پیش نویس ها، علامت را بردارید.</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">ویژگی های جدید</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">فهرست پیش‌نویس اکنون خطاهای اعتبارسنجی را نشان می‌دهد. هر بار که فرمی را به‌عنوان پیش‌نویس ذخیره می‌کنید، وضعیت اعتبارسنجی آن به‌روزرسانی می‌شود.\n\nپیش‌نویس‌هایی که با «خطاها» علامت‌گذاری شده‌اند، یا سؤالات لازم را ندارند یا مقادیری دارند که مجاز نیستند.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">چیزی برای نمایش در دسترس نیست</string>
<!--Message displayed when the list of blank forms is empty-->
<!--Subtext displayed when the list of blank forms is empty-->
Expand Down
6 changes: 2 additions & 4 deletions strings/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">برای پنهان شدن از پیش نویس ها، علامت را بردارید.</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">ویژگی های جدید</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">فهرست پیش‌نویس اکنون خطاهای اعتبارسنجی را نشان می‌دهد. هر بار که فرمی را به‌عنوان پیش‌نویس ذخیره می‌کنید، وضعیت اعتبارسنجی آن به‌روزرسانی می‌شود.\n\nپیش‌نویس‌هایی که با «خطاها» علامت‌گذاری شده‌اند، یا سؤالات لازم را ندارند یا مقادیری دارند که مجاز نیستند.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">چیزی برای نمایش در دسترس نیست</string>
<!--Message displayed when the list of blank forms is empty-->
<!--Subtext displayed when the list of blank forms is empty-->
Expand Down
6 changes: 2 additions & 4 deletions strings/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1063,10 +1063,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">Poista rasti piilottaaksesi Luonnos-näkymästä</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">Uusi ominaisuus</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">Luonnoslista näyttää nyt varmennusvirheet. Lomakkeen varmennustila päivitetään aina kun tallennat lomakkeen luonnoksena.\n\nLuonnoksissa, joissa on merkintä \"Virhe\", on joko puuttuvia vaadittuja vastauksia tai arvoja, joita ei sallita.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">Ei näytettävää</string>
<!--Message displayed when the list of blank forms is empty-->
<string name="empty_list_of_blank_forms_title">Ei tyhjiä lomakkeita</string>
Expand Down
6 changes: 2 additions & 4 deletions strings/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1076,10 +1076,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">Décochez pour masquer dans les ébauches.</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">Nouvelle fonctionnalité</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">La liste des ébauches montre désormais les erreurs de validation. Chaque fois que vous enregistrez une ébauche, son statut de validation est mis à jour.\n\nLes ébauches marquées avec \"Erreurs\" ont des questions obligatoires non renseignées ou contiennent des valeurs non autorisées.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">Rien à afficher</string>
<!--Message displayed when the list of blank forms is empty-->
<string name="empty_list_of_blank_forms_title">Aucun Formulaire Vierge</string>
Expand Down
6 changes: 2 additions & 4 deletions strings/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1074,10 +1074,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">Deseleziona per nasconderlo dalle bozze</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">Nuova funzionalità</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">La lista bozza ora mostra gli errori di convalida. Ogni volta che salvi un formulario come bozza, il suo stato di convalida viene aggiornato.\n\nLe bozze contrassegnate con \"Errori\" mancano di domande obbligatorie o contengono valori non consentiti.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">Niente disponibile da visualizzare</string>
<!--Message displayed when the list of blank forms is empty-->
<string name="empty_list_of_blank_forms_title">Nessun formulario vuoto</string>
Expand Down
6 changes: 2 additions & 4 deletions strings/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1041,10 +1041,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">Desmarque para não aparecer em Rascunhos</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">Nova funcionalidade</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">A lista de rascunhos agora mostra os erros de validação. A cada vez que você salva um formulário como rascunho o status de validação dele é atualizado. \n\nRascunhos marcados como \"Erro\" não tem dados em questões de preenchimento obrigatório ou contém dados que não são permitidos.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">Não há nada para exibir</string>
<!--Message displayed when the list of blank forms is empty-->
<string name="empty_list_of_blank_forms_title">Não há formulários em branco</string>
Expand Down
6 changes: 2 additions & 4 deletions strings/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -976,10 +976,8 @@
<!--Title of section of features that the user can uncheck to hide from the Drafts screen-->
<string name="uncheck_to_hide_from_drafts">Снимите галочку, чтобы скрыть из черновиков</string>
<!--Title for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="new_feature">Новая функция</string>
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<string name="drafts_pills_education_message">Список черновиков теперь показывает ошибки при проверке. Каждый раз, когда вы сохраняете форму как черновик, ее статус проверки обновляется.\n\nЧерновики, помеченные как «Ошибки», либо не содержат обязательных вопросов, либо содержат недопустимые значения.</string>
<!--Message displayed when the list of questions is empty-->
<!--Message for dialog explaining the drafts marked with "Error" shown to the user the first time they view the Drafts screen-->
<!--Message displayed when the list of questions is empty-->
<string name="empty_list_of_questions">Ничего недоступно для отображения</string>
<!--Message displayed when the list of blank forms is empty-->
<string name="empty_list_of_blank_forms_title">Нет пустых форм</string>
Expand Down
Loading