Skip to content

Commit

Permalink
updated/reordered CMS fields, removed price field, removed hint text (#…
Browse files Browse the repository at this point in the history
…7769)

* reordered CMS fields and added new verbose names to match data entry sheet

* updated migrations

* passing tests

* Sideway to Sideways

* merge with main

* feedback and updated migrations

Co-authored-by: Daniel Miranda <daniel@mozillafoundation.org>
  • Loading branch information
danielfmiranda and Daniel Miranda authored Nov 8, 2021
1 parent 42736d8 commit 3c04321
Show file tree
Hide file tree
Showing 6 changed files with 409 additions and 154 deletions.
4 changes: 0 additions & 4 deletions network-api/networkapi/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ def setUp(self):
company='Percy Corp',
blurb='This is a general product specifically created for visual regression testing',
product_url='http://example.com/general-percy',
price=999,
worst_case='Visual regression fails',
# general product fields
camera_app='Yes',
Expand Down Expand Up @@ -303,7 +302,6 @@ def setUp(self):
company='Percy Corp',
blurb='This is a general product specifically created for visual regression testing',
product_url='http://example.com/general-percy',
price=999,
worst_case='Visual regression fails',
# software product fields
)
Expand All @@ -326,7 +324,6 @@ def test_product_page_import_mappings(self):
self.assertEqual(mappings["Company"], "company")
self.assertEqual(mappings["Blurb"], "blurb")
self.assertEqual(mappings["Product link"], "product_url")
self.assertEqual(mappings["Price"], "price")
self.assertEqual(mappings["Worst case"], "worst_case")
self.assertEqual(mappings["Signup requires email"], "signup_requires_email")
self.assertEqual(mappings["Signup requires phone number"], "signup_requires_phone")
Expand Down Expand Up @@ -401,7 +398,6 @@ def test_product_page_export_fields(self):
self.assertIn("Company", export_fields)
self.assertIn("Blurb", export_fields)
self.assertIn("Product link", export_fields)
self.assertIn("Price", export_fields)
self.assertIn("Worst case", export_fields)
self.assertIn("Signup requires email", export_fields)
self.assertIn("Signup requires phone number", export_fields)
Expand Down
6 changes: 0 additions & 6 deletions network-api/networkapi/wagtailpages/factory/buyersguide.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from factory import (
Faker,
post_generation,
LazyAttribute,
LazyFunction,
)
from factory.django import DjangoModelFactory
Expand Down Expand Up @@ -96,7 +95,6 @@ class Meta:
company = Faker('company')
blurb = Faker('sentence')
product_url = Faker('url')
price = LazyAttribute(lambda _: randint(49, 1500))
worst_case = Faker('sentence')
first_published_at = Faker('past_datetime', start_date='-2d', tzinfo=timezone.utc)
last_published_at = Faker('past_datetime', start_date='-1d', tzinfo=timezone.utc)
Expand Down Expand Up @@ -168,8 +166,6 @@ class SoftwareProductPageFactory(ProductPageFactory):
class Meta:
model = SoftwareProductPage

price = 0

handles_recordings_how = Faker('sentence')
recording_alert = LazyFunction(get_extended_yes_no_value)
recording_alert_helptext = Faker('sentence')
Expand Down Expand Up @@ -206,7 +202,6 @@ def create_general_product_visual_regression_product(seed, pni_homepage):
company='Percy Corp',
blurb='This is a general product specifically created for visual regression testing',
product_url='http://example.com/general-percy',
price=999,
worst_case='Visual regression fails',
# general product fields
camera_app='Yes',
Expand Down Expand Up @@ -248,7 +243,6 @@ def create_software_product_visual_regression_product(seed, pni_homepage):
company='Percy Corp',
blurb='This is a general product specifically created for visual regression testing',
product_url='http://example.com/general-percy',
price=999,
worst_case='Visual regression fails',
# software product fields
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,326 @@
# Generated by Django 3.1.11 on 2021-11-04 21:26

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import networkapi.wagtailpages.fields
import wagtail.core.fields


class Migration(migrations.Migration):

dependencies = [
('wagtailimages', '0023_add_choose_permissions'),
('wagtailpages', '0049_auto_20211101_1811'),
]

operations = [
migrations.RemoveField(
model_name='generalproductpage',
name='ai_is_untrustworthy_helptext',
),
migrations.RemoveField(
model_name='productpage',
name='price',
),
migrations.AlterField(
model_name='generalproductpage',
name='ai_can_user_control',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='does the user have control over the AI features?'),
),
migrations.AlterField(
model_name='generalproductpage',
name='ai_can_user_control_helptext',
field=models.TextField(blank=True, max_length=5000, verbose_name='control of AI description'),
),
migrations.AlterField(
model_name='generalproductpage',
name='ai_helptext',
field=models.TextField(blank=True, max_length=5000, verbose_name='general AI description'),
),
migrations.AlterField(
model_name='generalproductpage',
name='ai_is_transparent',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='is the company transparent about how the AI works?'),
),
migrations.AlterField(
model_name='generalproductpage',
name='ai_is_transparent_helptext',
field=models.TextField(blank=True, max_length=5000, verbose_name='aI transparency description'),
),
migrations.AlterField(
model_name='generalproductpage',
name='ai_is_untrustworthy',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='is this AI untrustworthy?'),
),
migrations.AlterField(
model_name='generalproductpage',
name='ai_is_untrustworthy_ding',
field=models.BooleanField(default=False, verbose_name='mini-ding for bad AI'),
),
migrations.AlterField(
model_name='generalproductpage',
name='ai_what_can_it_do',
field=wagtail.core.fields.RichTextField(blank=True, verbose_name='what kind of decisions does the AI make about you or for you?'),
),
migrations.AlterField(
model_name='generalproductpage',
name='biometric_data_collected',
field=models.TextField(blank=True, max_length=5000, verbose_name='body Related'),
),
migrations.AlterField(
model_name='generalproductpage',
name='camera_app',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='camera: App'),
),
migrations.AlterField(
model_name='generalproductpage',
name='camera_device',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='camera: Device'),
),
migrations.AlterField(
model_name='generalproductpage',
name='company_track_record',
field=models.CharField(choices=[('Great', 'Great'), ('Average', 'Average'), ('Needs Improvement', 'Needs Improvement'), ('Bad', 'Bad')], default='Average', max_length=20, verbose_name="company's known track record?"),
),
migrations.AlterField(
model_name='generalproductpage',
name='data_control_policy_is_bad',
field=models.BooleanField(default=False, verbose_name='mini-ding for bad data control?'),
),
migrations.AlterField(
model_name='generalproductpage',
name='how_can_you_control_your_data',
field=models.TextField(blank=True, max_length=5000, verbose_name='how can you control your data?'),
),
migrations.AlterField(
model_name='generalproductpage',
name='location_app',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='tracks location: App'),
),
migrations.AlterField(
model_name='generalproductpage',
name='location_device',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='tracks location: Device'),
),
migrations.AlterField(
model_name='generalproductpage',
name='microphone_app',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='microphone: App'),
),
migrations.AlterField(
model_name='generalproductpage',
name='microphone_device',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='microphone: Device'),
),
migrations.AlterField(
model_name='generalproductpage',
name='offline_capable',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='can this product be used offline?'),
),
migrations.AlterField(
model_name='generalproductpage',
name='offline_use_description',
field=models.TextField(blank=True, max_length=5000, verbose_name='offline description'),
),
migrations.AlterField(
model_name='generalproductpage',
name='personal_data_collected',
field=models.TextField(blank=True, max_length=5000, verbose_name='personal'),
),
migrations.AlterField(
model_name='generalproductpage',
name='social_data_collected',
field=models.TextField(blank=True, max_length=5000, verbose_name='social'),
),
migrations.AlterField(
model_name='generalproductpage',
name='track_record_details',
field=models.TextField(blank=True, max_length=5000, verbose_name='known track record description'),
),
migrations.AlterField(
model_name='generalproductpage',
name='track_record_is_bad',
field=models.BooleanField(default=False, verbose_name='mini-ding for bad track record'),
),
migrations.AlterField(
model_name='generalproductpage',
name='uses_ai',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='does the product use AI?'),
),
migrations.AlterField(
model_name='productpage',
name='adult_content',
field=models.BooleanField(default=False, verbose_name='adult Content'),
),
migrations.AlterField(
model_name='productpage',
name='blurb',
field=wagtail.core.fields.RichTextField(blank=True, verbose_name='intro Blurb'),
),
migrations.AlterField(
model_name='productpage',
name='company',
field=models.CharField(blank=True, max_length=100, verbose_name='company Name'),
),
migrations.AlterField(
model_name='productpage',
name='data_collection_policy_is_bad',
field=models.BooleanField(default=False, verbose_name='mini-ding for bad data use?'),
),
migrations.AlterField(
model_name='productpage',
name='how_does_it_use_data_collected',
field=models.TextField(blank=True, max_length=5000, verbose_name='how does the company use this data?'),
),
migrations.AlterField(
model_name='productpage',
name='image',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
),
migrations.AlterField(
model_name='productpage',
name='manage_vulnerabilities',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='manages security vulnerabilities'),
),
migrations.AlterField(
model_name='productpage',
name='manage_vulnerabilities_helptext',
field=models.TextField(blank=True, max_length=5000, verbose_name='description'),
),
migrations.AlterField(
model_name='productpage',
name='meets_minimum_security_standards',
field=models.BooleanField(blank=True, null=True, verbose_name='does this product meet our Minimum Security Standards?'),
),
migrations.AlterField(
model_name='productpage',
name='mozilla_says',
field=models.BooleanField(blank=True, help_text="Use 'Yes' for Thumbs Up, 'No' for Thumbs Down, and 'Unknown' for Thumb Sideways", null=True, verbose_name='mozilla Says'),
),
migrations.AlterField(
model_name='productpage',
name='privacy_ding',
field=models.BooleanField(default=False, verbose_name='*privacy not included ding'),
),
migrations.AlterField(
model_name='productpage',
name='privacy_policy',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(),
),
migrations.AlterField(
model_name='productpage',
name='privacy_policy_helptext',
field=models.TextField(blank=True, max_length=5000, verbose_name='description'),
),
migrations.AlterField(
model_name='productpage',
name='product_url',
field=models.URLField(blank=True, max_length=2048, verbose_name='product URL'),
),
migrations.AlterField(
model_name='productpage',
name='review_date',
field=models.DateField(default=django.utils.timezone.now, verbose_name='review Date'),
),
migrations.AlterField(
model_name='productpage',
name='security_updates',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(),
),
migrations.AlterField(
model_name='productpage',
name='security_updates_helptext',
field=models.TextField(blank=True, max_length=5000, verbose_name='description'),
),
migrations.AlterField(
model_name='productpage',
name='show_ding_for_minimum_security_standards',
field=models.BooleanField(default=False, verbose_name='mini-ding for doesnt meet Minimum Security Standards'),
),
migrations.AlterField(
model_name='productpage',
name='signup_requirement_explanation',
field=models.TextField(blank=True, max_length=5000, verbose_name='signup requirement description'),
),
migrations.AlterField(
model_name='productpage',
name='signup_requires_email',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='email'),
),
migrations.AlterField(
model_name='productpage',
name='signup_requires_phone',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='phone'),
),
migrations.AlterField(
model_name='productpage',
name='signup_requires_third_party_account',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='third-party account'),
),
migrations.AlterField(
model_name='productpage',
name='strong_password_helptext',
field=models.TextField(blank=True, max_length=5000, verbose_name='description'),
),
migrations.AlterField(
model_name='productpage',
name='time_researched',
field=models.PositiveIntegerField(default=0, verbose_name='time spent on research'),
),
migrations.AlterField(
model_name='productpage',
name='user_friendly_privacy_policy',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='user-friendly privacy information?'),
),
migrations.AlterField(
model_name='productpage',
name='user_friendly_privacy_policy_helptext',
field=models.TextField(blank=True, max_length=5000, verbose_name='user-friendly privacy description'),
),
migrations.AlterField(
model_name='productpage',
name='uses_bluetooth',
field=models.BooleanField(default=False, verbose_name='uses Bluetooth'),
),
migrations.AlterField(
model_name='productpage',
name='uses_encryption',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(verbose_name='encryption'),
),
migrations.AlterField(
model_name='productpage',
name='uses_encryption_helptext',
field=models.TextField(blank=True, max_length=5000, verbose_name='description'),
),
migrations.AlterField(
model_name='productpage',
name='uses_wifi',
field=models.BooleanField(default=False, verbose_name='uses WiFi'),
),
migrations.AlterField(
model_name='productpage',
name='worst_case',
field=wagtail.core.fields.RichTextField(blank=True, verbose_name='what could happen if something goes wrong?'),
),
migrations.AlterField(
model_name='softwareproductpage',
name='easy_to_learn_and_use',
field=networkapi.wagtailpages.fields.ExtendedBoolean(),
),
migrations.AlterField(
model_name='softwareproductpage',
name='handles_recordings_how',
field=models.TextField(blank=True, max_length=5000),
),
migrations.AlterField(
model_name='softwareproductpage',
name='medical_privacy_compliant',
field=networkapi.wagtailpages.fields.ExtendedBoolean(),
),
migrations.AlterField(
model_name='softwareproductpage',
name='recording_alert',
field=networkapi.wagtailpages.fields.ExtendedYesNoField(null=True),
),
]
Loading

0 comments on commit 3c04321

Please sign in to comment.