Skip to content

Commit

Permalink
Merge pull request #5779 from lognaturel/bulk-finalize-strings
Browse files Browse the repository at this point in the history
Update bulk finalization strings
  • Loading branch information
lognaturel committed Oct 21, 2023
2 parents 7b70b37 + cc353d9 commit cb3324d
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class FormEndTest {
.assertNumberOfFinalizedForms(0)

.clickDrafts(1)
.assertText(string.complete)
.assertTextDoesNotExist(string.incomplete)
.assertText(string.draft_no_errors)
.assertTextDoesNotExist(string.draft_errors)
}

@Test
Expand All @@ -58,8 +58,8 @@ class FormEndTest {
.assertNumberOfFinalizedForms(0)

.clickDrafts(1)
.assertText(string.incomplete)
.assertTextDoesNotExist(string.complete)
.assertText(string.draft_errors)
.assertTextDoesNotExist(string.draft_no_errors)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class BulkFinalizationTest {
.clickFinalize()
.checkIsSnackbarWithQuantityDisplayed(plurals.bulk_finalize_failure, 1)

.clickOptionsIcon(string.finalize_all_forms)
.clickOnString(string.finalize_all_forms)
.clickOptionsIcon(string.finalize_all_drafts)
.clickOnString(string.finalize_all_drafts)
.clickOnButtonInDialog(string.finalize, EditSavedFormPage(false))
.checkIsSnackbarWithQuantityDisplayed(plurals.bulk_finalize_failure, 1)
}
Expand All @@ -106,8 +106,8 @@ class BulkFinalizationTest {
.killAndReopenApp(MainMenuPage())

.clickDrafts(false)
.clickOptionsIcon(string.finalize_all_forms)
.clickOnString(string.finalize_all_forms)
.clickOptionsIcon(string.finalize_all_drafts)
.clickOnString(string.finalize_all_drafts)
.checkIsSnackbarWithQuantityDisplayed(plurals.bulk_finalize_failure, 1)
.assertText("One Question")
.pressBack(MainMenuPage())
Expand Down Expand Up @@ -199,7 +199,7 @@ class BulkFinalizationTest {
.clickSettings()
.clickAccessControl()
.clickFormEntrySettings()
.clickOnString(string.finalize_all_forms)
.clickOnString(string.finalize_all_drafts)
.pressBack(AccessControlPage())
.pressBack(ProjectSettingsPage())
.pressBack(MainMenuPage())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public EditSavedFormPage assertOnPage() {

private void closeDraftsPillsEducationDialog() {
if (firstOpen) {
assertText(org.odk.collect.strings.R.string.drafts_pills_education_title);
assertText(org.odk.collect.strings.R.string.new_feature);
clickOKOnDialog();
}
}
Expand Down Expand Up @@ -108,8 +108,8 @@ public EditSavedFormPage searchInBar(String query) {
}

public BulkFinalizationConfirmationDialogPage clickFinalizeAll(int count) {
this.clickOptionsIcon(org.odk.collect.strings.R.string.finalize_all_forms)
.clickOnString(org.odk.collect.strings.R.string.finalize_all_forms);
this.clickOptionsIcon(org.odk.collect.strings.R.string.finalize_all_drafts)
.clickOnString(org.odk.collect.strings.R.string.finalize_all_drafts);

return new BulkFinalizationConfirmationDialogPage(count).assertOnPage();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void onCreate(Bundle savedInstanceState) {

if (!settingsProvider.getMetaSettings().getBoolean(MetaKeys.DRAFTS_PILLS_EDUCATION_SHOWN)) {
new MaterialAlertDialogBuilder(this)
.setTitle(string.drafts_pills_education_title)
.setTitle(string.new_feature)
.setMessage(string.drafts_pills_education_message)
.setPositiveButton(string.ok, null)
.show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ object InstanceListItemView {
if (instance.status == Instance.STATUS_INVALID || instance.status == Instance.STATUS_INCOMPLETE) {
pill.visibility = View.VISIBLE
pill.setIcon(R.drawable.baseline_rule_24)
pill.setText(string.incomplete)
pill.setText(string.draft_errors)
pill.setPillBackgroundColor(getThemeAttributeValue(context, com.google.android.material.R.attr.colorErrorContainer))
pill.setTextColor(getThemeAttributeValue(context, com.google.android.material.R.attr.colorOnErrorContainer))
pill.setIconTint(getThemeAttributeValue(context, com.google.android.material.R.attr.colorOnErrorContainer))
} else if (instance.status == Instance.STATUS_VALID) {
pill.visibility = View.VISIBLE
pill.setIcon(R.drawable.baseline_check_24)
pill.setText(string.complete)
pill.setText(string.draft_no_errors)
pill.setPillBackgroundColor(getThemeAttributeValue(context, R.attr.colorSurfaceContainerHighest))
pill.setTextColor(getThemeAttributeValue(context, R.attr.colorOnSurfaceContainerHighest))
pill.setIconTint(getThemeAttributeValue(context, R.attr.colorOnSurfaceContainerHighest))
Expand Down
2 changes: 1 addition & 1 deletion collect_app/src/main/res/menu/drafts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<item
android:id="@+id/bulk_finalize"
android:showAsAction="never"
android:title="@string/finalize_all_forms">
android:title="@string/finalize_all_drafts">
</item>
</menu>
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
app:iconSpaceReserved="false">
<CheckBoxPreference
android:key="bulk_finalize"
android:title="@string/finalize_all_forms"
android:title="@string/finalize_all_drafts"
app:iconSpaceReserved="false" />
</PreferenceCategory>
</PreferenceScreen>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class InstanceListItemViewTest {
InstanceListItemView.setInstance(binding.root, instance, false)

assertThat(binding.chip.visibility, equalTo(View.VISIBLE))
assertThat(binding.chip.text, equalTo(context.getString(string.incomplete)))
assertThat(binding.chip.text, equalTo(context.getString(string.draft_errors)))
}

@Test
Expand All @@ -46,7 +46,7 @@ class InstanceListItemViewTest {
InstanceListItemView.setInstance(binding.root, instance, false)

assertThat(binding.chip.visibility, equalTo(View.VISIBLE))
assertThat(binding.chip.text, equalTo(context.getString(string.complete)))
assertThat(binding.chip.text, equalTo(context.getString(string.draft_no_errors)))
}

@Test
Expand All @@ -57,7 +57,7 @@ class InstanceListItemViewTest {
InstanceListItemView.setInstance(binding.root, instance, false)

assertThat(binding.chip.visibility, equalTo(View.VISIBLE))
assertThat(binding.chip.text, equalTo(context.getString(string.incomplete)))
assertThat(binding.chip.text, equalTo(context.getString(string.draft_errors)))
}

@Test
Expand All @@ -77,12 +77,12 @@ class InstanceListItemViewTest {
InstanceListItemView.setInstance(binding.root, valid, false)

assertThat(binding.chip.visibility, equalTo(View.VISIBLE))
assertThat(binding.chip.text, equalTo(context.getString(string.complete)))
assertThat(binding.chip.text, equalTo(context.getString(string.draft_no_errors)))

val invalid = InstanceFixtures.instance(status = Instance.STATUS_INVALID)
InstanceListItemView.setInstance(binding.root, invalid, false)

assertThat(binding.chip.visibility, equalTo(View.VISIBLE))
assertThat(binding.chip.text, equalTo(context.getString(string.incomplete)))
assertThat(binding.chip.text, equalTo(context.getString(string.draft_errors)))
}
}
60 changes: 31 additions & 29 deletions strings/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1220,46 +1220,48 @@
<!-- Message showed on main menu to inform users that the ability to edit finalized forms is going away -->
<string name="edit_finalized_form_deprecation_message">In later versions, finalized forms will no longer be editable.</string>

<!-- Label for option that finalizes all the forms the user is currently looking at -->
<string name="finalize_all_forms" oat:toReview="true">Finalize all forms</string>
<!-- Label for Drafts list option that attempts to finalize all the drafts the user is currently looking at. Finalizing a draft locks it so it can't be edited and makes it eligible for autosend -->
<string name="finalize_all_drafts">Finalize all drafts</string>

<!-- Message shown when finalizing all forms has succeeded and how many totally have been finalized -->
<plurals name="bulk_finalize_success" oat:toReview="true">
<item quantity="one">Success! %d form finalized.</item>
<item quantity="other">Success! %d forms finalized.</item>
<!-- Dialog title that asks if the user wants to finalize all drafts -->
<plurals name="bulk_finalize_confirmation">
<item quantity="one">Do you want to finalize %d draft?</item>
<item quantity="other">Do you want to finalize %d drafts?</item>
</plurals>

<!-- Message shown when no forms finalized successfully -->
<plurals name="bulk_finalize_failure" oat:toReview="true">
<item quantity="one">%d form has an error. Address issues before finalizing all forms.</item>
<item quantity="other">%d forms have errors. Address issues before finalizing all forms.</item>
<!-- Explanation for how bulk finalize works shown in a dialog before the user confirms if they want to proceed or cancel -->
<string name="bulk_finalize_explanation">Once you finalize all drafts, they will be in "Ready to send" and you will not be able to make edits. Any drafts that have errors will not be finalized.\n\nYou will not be able to undo this action.</string>

<!-- Message shown after bulk finalization when finalizing all drafts has succeeded -->
<plurals name="bulk_finalize_success">
<item quantity="one">Success! %d draft finalized.</item>
<item quantity="other">Success! %d drafts finalized.</item>
</plurals>

<!-- Message shown when some forms finalize successfully and others fail -->
<string name="bulk_finalize_partial_success" oat:toReview="true">%d forms finalized. %d forms have errors. Address issues before finalizing all forms.</string>
<!-- Message shown after bulk finalization when no drafts finalized successfully -->
<plurals name="bulk_finalize_failure">
<item quantity="one">%d draft has errors that must be addressed before finalizing.</item>
<item quantity="other">%d drafts have errors that must be addressed before finalizing.</item>
</plurals>

<!-- Message above a form draft that has not yet been completed -->
<string name="incomplete" oat:toReview="true">Incomplete</string>
<!-- Message shown after bulk finalization when some drafts finalize successfully and others fail -->
<string name="bulk_finalize_partial_success">%d drafts finalized. %d drafts have errors that must be addressed before finalizing.</string>

<!-- Message above a form draft that has been completed -->
<string name="complete" oat:toReview="true">Complete</string>
<!-- Message shown when some drafts finalize successfully but others need to be finalized manually -->
<string name="bulk_finalize_unsupported">%d drafts finalized. Drafts that are left need to be finalized manually.</string>

<!-- Message shown when some forms finalize successfully but others need to be finalized manually -->
<string name="bulk_finalize_unsupported" oat:toReview="true">%d forms finalized. Some forms need to be finalized manually.</string>
<!-- Displayed above a draft that has constraints that aren't met or required questions that aren't answered or both. Should match the wording for the 'Check for errors' feature. -->
<string name="draft_errors">Errors</string>

<!-- Explanation for how bulk finalize works shown in a dialog before the user confirms if they want to proceed or cancel -->
<string name="bulk_finalize_explanation" oat:toReview="true">Once you finalize all forms, they will be in "Ready to send" and you will not be able to make edits. Any forms that have errors will not be finalized.\n\nYou will not be able to undo this action.</string>

<!-- Dialog title that asks if the user wants to finalize all drafts -->
<plurals name="bulk_finalize_confirmation" oat:toReview="true">
<item quantity="one">Do you want to finalize %d form?</item>
<item quantity="other">Do you want to finalize %d forms?</item>
</plurals>
<!-- Displayed above a draft that has no constraint violations and in which all required questions have been answered. Should match the wording for the 'Check for errors' feature. -->
<string name="draft_no_errors">No errors</string>

<!-- Title of section of features that the user can uncheck to hide from the Drafts screen -->
<string name="uncheck_to_hide_from_drafts">Uncheck to hide from Drafts</string>

<!-- Title and 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_title" oat:toReview="true">Drafts have changed</string>
<string name="drafts_pills_education_message" oat:toReview="true">The draft list now shows validation errors. Drafts marked with \"Errors\" are either missing required questions or have values that are not allowed. Each time you save a form as draft, its validation status is updated.</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">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">The draft list now shows validation errors. Each time you save a form as draft, its validation status is updated.\n\nDrafts marked with \"Errors\" are either missing required questions or have values that are not allowed.</string>
</resources>

0 comments on commit cb3324d

Please sign in to comment.