Skip to content

Commit 90d552c

Browse files
Merge pull request ecamp#5669 from carlobeltrame/safety-considerations
Rename safety concept to safety considerations
2 parents 8569a22 + 22aac19 commit 90d552c

32 files changed

+175
-148
lines changed

api/fixtures/activity1-aside-top.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ App\Entity\ContentNode\SingleText:
2727
instanceName: 'singleText1'
2828
contentType: '@contentTypeNotes'
2929
data: { html: <word()> }
30-
safetyConcept1:
30+
safetyConsiderations1:
3131
root: '@columnLayout1'
3232
parent: '@responsiveLayout1'
3333
slot: 'aside-top'
3434
position: 3
35-
instanceName: 'safetyConcept1'
36-
contentType: '@contentTypeSafetyConcept'
35+
instanceName: 'safetyConsiderations1'
36+
contentType: '@contentTypeSafetyConsiderations'
3737
data: { html: <sentence()> }

api/fixtures/categories.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ App\Entity\Category:
77
numberingStyle: 1
88
rootContentNode: '@columnLayout2'
99
preferredContentTypes:
10-
- '@contentTypeSafetyConcept'
10+
- '@contentTypeSafetyConsiderations'
1111
category2:
1212
camp: '@camp1'
1313
short: LP

api/fixtures/contentTypes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
App\Entity\ContentType:
2-
contentTypeSafetyConcept:
3-
name: 'SafetyConcept'
2+
contentTypeSafetyConsiderations:
3+
name: 'SafetyConsiderations'
44
active: true
55
entityClass: 'App\Entity\ContentNode\SingleText'
66
contentTypeStoryContext:

api/fixtures/performance_test/activities.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ App\Entity\ContentNode\SingleText:
110110
instanceName: 'singleText<current()>'
111111
contentType: '@contentTypeNotes'
112112
data: { html: <word()> }
113-
additional_safetyConcept1_{1..400}:
113+
additional_safetyConsiderations1_{1..400}:
114114
root: '@additional_columnLayout1_<current()>'
115115
parent: '@additional_responsiveLayout1_<current()>'
116116
slot: 'aside-top'
117117
position: 3
118-
instanceName: 'safetyConcept<current()>'
119-
contentType: '@contentTypeSafetyConcept'
118+
instanceName: 'safetyConsiderations<current()>'
119+
contentType: '@contentTypeSafetyConsiderations'
120120
data: { html: <sentence()> }
121121
additional_singleText_camp1_{1..200}:
122122
root: '@additional_columnLayout_camp1_<current()>'
@@ -126,11 +126,11 @@ App\Entity\ContentNode\SingleText:
126126
instanceName: 'singleText<current()>'
127127
contentType: '@contentTypeNotes'
128128
data: { html: <word()> }
129-
additional_safetyConcept_camp1_{1..200}:
129+
additional_safetyConsiderations_camp1_{1..200}:
130130
root: '@additional_columnLayout_camp1_<current()>'
131131
parent: '@additional_responsiveLayout_camp1_<current()>'
132132
slot: 'aside-top'
133133
position: 3
134-
instanceName: 'safetyConcept<current()>'
135-
contentType: '@contentTypeSafetyConcept'
134+
instanceName: 'safetyConsiderations<current()>'
135+
contentType: '@contentTypeSafetyConsiderations'
136136
data: { html: <sentence()> }

api/fixtures/performance_test/categories.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ App\Entity\Category:
77
numberingStyle: 1
88
rootContentNode: '@additionalColumnLayoutForCampNumber1_<current()>'
99
preferredContentTypes:
10-
- '@contentTypeSafetyConcept'
10+
- '@contentTypeSafetyConsiderations'
1111
additionalCategoryForCampNumber2_{1..400}:
1212
camp: '@additionalCamp_<current()>'
1313
short: LP
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
/**
11+
* Auto-generated Migration: Please modify to your needs!
12+
*/
13+
final class Version20240817181500 extends AbstractMigration {
14+
public function getDescription(): string {
15+
return 'Renames safety concept to safety considerations';
16+
}
17+
18+
public function up(Schema $schema): void {
19+
// this up() migration is auto-generated, please modify it to your needs
20+
$this->addSql("UPDATE content_type SET name = 'SafetyConsiderations' WHERE name = 'SafetyConcept';");
21+
}
22+
23+
public function down(Schema $schema): void {
24+
// this down() migration is auto-generated, please modify it to your needs
25+
$this->addSql("UPDATE content_type SET name = 'SafetyConcept' WHERE name = 'SafetyConsiderations';");
26+
}
27+
}

api/src/Entity/ContentNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function __construct() {
160160
/**
161161
* The name of the content type of this content node. Read-only, for convenience.
162162
*/
163-
#[ApiProperty(example: 'SafetyConcept')]
163+
#[ApiProperty(example: 'SafetyConsiderations')]
164164
#[Groups(['read'])]
165165
public function getContentTypeName(): string {
166166
return $this->contentType?->name;

api/src/Entity/ContentType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ContentType extends BaseEntity {
3333
* A name in UpperCamelCase of the content type. This value may be used as a technical
3434
* identifier of this content type, it is guaranteed to stay fixed.
3535
*/
36-
#[ApiProperty(writable: false, example: 'SafetyConcept')]
36+
#[ApiProperty(writable: false, example: 'SafetyConsiderations')]
3737
#[Groups(['read'])]
3838
#[ORM\Column(type: 'string', length: 32, unique: true)]
3939
public ?string $name = null;

api/tests/Api/Categories/CreateCategoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ public function testCreateCategoryPurgesCacheTags() {
561561
$this->assertResponseStatusCodeSame(201);
562562

563563
$camp1 = static::getFixture('camp1');
564-
$contentType = static::getFixture('contentTypeSafetyConcept');
564+
$contentType = static::getFixture('contentTypeSafetyConsiderations');
565565
self::assertEqualsCanonicalizing([
566566
'/categories',
567567
'/camps/'.$camp1->getId().'/categories',
@@ -606,7 +606,7 @@ public function getExampleWritePayload($attributes = [], $except = []) {
606606
array_merge([
607607
'copyCategorySource' => null,
608608
'camp' => $this->getIriFor('camp1'),
609-
'preferredContentTypes' => [$this->getIriFor('contentTypeSafetyConcept')],
609+
'preferredContentTypes' => [$this->getIriFor('contentTypeSafetyConsiderations')],
610610
], $attributes),
611611
[],
612612
$except

api/tests/Api/Categories/UpdateCategoryTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testPatchCategoryIsDeniedForAnonymousUser() {
1717
'numberingStyle' => 'I',
1818
'preferredContentTypes' => [
1919
$this->getIriFor('contentTypeColumnLayout'),
20-
$this->getIriFor('contentTypeSafetyConcept'),
20+
$this->getIriFor('contentTypeSafetyConsiderations'),
2121
],
2222
], 'headers' => ['Content-Type' => 'application/merge-patch+json']]);
2323
$this->assertResponseStatusCodeSame(401);
@@ -37,7 +37,7 @@ public function testPatchCategoryIsDeniedForUnrelatedUser() {
3737
'numberingStyle' => 'I',
3838
'preferredContentTypes' => [
3939
$this->getIriFor('contentTypeColumnLayout'),
40-
$this->getIriFor('contentTypeSafetyConcept'),
40+
$this->getIriFor('contentTypeSafetyConsiderations'),
4141
],
4242
], 'headers' => ['Content-Type' => 'application/merge-patch+json']])
4343
;
@@ -58,7 +58,7 @@ public function testPatchCategoryIsDeniedForInactiveCollaborator() {
5858
'numberingStyle' => 'I',
5959
'preferredContentTypes' => [
6060
$this->getIriFor('contentTypeColumnLayout'),
61-
$this->getIriFor('contentTypeSafetyConcept'),
61+
$this->getIriFor('contentTypeSafetyConsiderations'),
6262
],
6363
], 'headers' => ['Content-Type' => 'application/merge-patch+json']])
6464
;
@@ -79,7 +79,7 @@ public function testPatchCategoryIsDeniedForGuest() {
7979
'numberingStyle' => 'I',
8080
'preferredContentTypes' => [
8181
$this->getIriFor('contentTypeColumnLayout'),
82-
$this->getIriFor('contentTypeSafetyConcept'),
82+
$this->getIriFor('contentTypeSafetyConsiderations'),
8383
],
8484
], 'headers' => ['Content-Type' => 'application/merge-patch+json']])
8585
;
@@ -100,7 +100,7 @@ public function testPatchCategoryIsAllowedForMember() {
100100
'numberingStyle' => 'I',
101101
'preferredContentTypes' => [
102102
$this->getIriFor('contentTypeColumnLayout'),
103-
$this->getIriFor('contentTypeSafetyConcept'),
103+
$this->getIriFor('contentTypeSafetyConsiderations'),
104104
],
105105
], 'headers' => ['Content-Type' => 'application/merge-patch+json']])
106106
;
@@ -127,7 +127,7 @@ public function testPatchCategoryIsAllowedForManager() {
127127
'numberingStyle' => 'I',
128128
'preferredContentTypes' => [
129129
$this->getIriFor('contentTypeColumnLayout'),
130-
$this->getIriFor('contentTypeSafetyConcept'),
130+
$this->getIriFor('contentTypeSafetyConsiderations'),
131131
],
132132
], 'headers' => ['Content-Type' => 'application/merge-patch+json']]);
133133
$this->assertResponseStatusCodeSame(200);
@@ -153,7 +153,7 @@ public function testPatchCategoryInCampPrototypeIsDeniedForUnrelatedUser() {
153153
'numberingStyle' => 'I',
154154
'preferredContentTypes' => [
155155
$this->getIriFor('contentTypeColumnLayout'),
156-
$this->getIriFor('contentTypeSafetyConcept'),
156+
$this->getIriFor('contentTypeSafetyConsiderations'),
157157
],
158158
], 'headers' => ['Content-Type' => 'application/merge-patch+json']]);
159159
$this->assertResponseStatusCodeSame(403);
@@ -529,12 +529,12 @@ public function testPatchCategoryPurgesCacheTags() {
529529

530530
$contentTypeColumnLayout = static::getFixture('contentTypeColumnLayout');
531531
$contentTypeNotes = static::getFixture('contentTypeNotes');
532-
$contentTypeSafetyConcept = static::getFixture('contentTypeSafetyConcept');
532+
$contentTypeSafetyConsiderations = static::getFixture('contentTypeSafetyConsiderations');
533533
self::assertEqualsCanonicalizing([
534534
$category->getId(),
535535
$contentTypeColumnLayout->getId().'#categories',
536536
$contentTypeNotes->getId().'#categories',
537-
$contentTypeSafetyConcept->getId().'#categories', // SafetyConcept was previously in the list, so this is purged because it was removed
537+
$contentTypeSafetyConsiderations->getId().'#categories', // SafetyConsiderations was previously in the list, so this is purged because it was removed
538538
], $cacheManager->getInvalidatedTags());
539539
}
540540
}

api/tests/Api/ContentNodes/ContentNode/ListContentNodesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testListContentNodesIsAllowedForLoggedInUserButFiltered() {
4545
['href' => $this->getIriFor('columnLayout2campPrototype')],
4646
['href' => $this->getIriFor('singleText1')],
4747
['href' => $this->getIriFor('singleText2')],
48-
['href' => $this->getIriFor('safetyConcept1')],
48+
['href' => $this->getIriFor('safetyConsiderations1')],
4949
['href' => $this->getIriFor('materialNode1')],
5050
['href' => $this->getIriFor('materialNode2')],
5151
['href' => $this->getIriFor('storyboard1')],
@@ -75,7 +75,7 @@ public function testListContentNodesFilteredByPeriodIsAllowedForCollaborator() {
7575
['href' => $this->getIriFor('columnLayout3')],
7676
['href' => $this->getIriFor('singleText1')],
7777
['href' => $this->getIriFor('singleText2')],
78-
['href' => $this->getIriFor('safetyConcept1')],
78+
['href' => $this->getIriFor('safetyConsiderations1')],
7979
['href' => $this->getIriFor('materialNode1')],
8080
['href' => $this->getIriFor('storyboard1')],
8181
['href' => $this->getIriFor('storyboard2')],

api/tests/Api/ContentNodes/CreateContentNodeTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function testCreateRejectsParentsWhichDontSupportChildren(string $idOfPar
110110
public function testCreateValidatesIncompatibleContentType() {
111111
// given
112112
/** @var ContentType $contentType */
113-
$contentType = static::getFixture(ColumnLayout::class === $this->entityClass ? 'contentTypeSafetyConcept' : 'contentTypeColumnLayout');
113+
$contentType = static::getFixture(ColumnLayout::class === $this->entityClass ? 'contentTypeSafetyConsiderations' : 'contentTypeColumnLayout');
114114

115115
// when
116116
$this->create($this->getExampleWritePayload(['contentType' => $this->getIriFor($contentType)]));

api/tests/Api/ContentNodes/SingleText/ListSingleTextTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function setUp(): void {
1616
$this->contentNodesCamp1and2 = [
1717
$this->getIriFor('singleText1'),
1818
$this->getIriFor('singleText2'),
19-
$this->getIriFor('safetyConcept1'),
19+
$this->getIriFor('safetyConsiderations1'),
2020
];
2121

2222
$this->contentNodesCampUnrelated = [

api/tests/Api/ContentTypes/DeleteContentTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
class DeleteContentTypeTest extends ECampApiTestCase {
1111
public function testDeleteContentTypeIsNotAllowed() {
12-
$contentType = static::getFixture('contentTypeSafetyConcept');
12+
$contentType = static::getFixture('contentTypeSafetyConsiderations');
1313
static::createClientWithCredentials()->request('DELETE', '/content_types/'.$contentType->getId());
1414

1515
$this->assertResponseStatusCodeSame(405); // method not allowed

api/tests/Api/ContentTypes/ReadContentTypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ReadContentTypeTest extends ECampApiTestCase {
1212
public function testGetSingleContentTypeIsAllowedForAnonymousUser() {
1313
/** @var ContentType $contentType */
14-
$contentType = static::getFixture('contentTypeSafetyConcept');
14+
$contentType = static::getFixture('contentTypeSafetyConsiderations');
1515
static::createBasicClient()->request('GET', '/content_types/'.$contentType->getId());
1616
$this->assertResponseStatusCodeSame(200);
1717
$this->assertJsonContains([
@@ -28,7 +28,7 @@ public function testGetSingleContentTypeIsAllowedForAnonymousUser() {
2828

2929
public function testGetSingleContentTypeIsAllowedForLoggedInUser() {
3030
/** @var ContentType $contentType */
31-
$contentType = static::getFixture('contentTypeSafetyConcept');
31+
$contentType = static::getFixture('contentTypeSafetyConsiderations');
3232
static::createClientWithCredentials()->request('GET', '/content_types/'.$contentType->getId());
3333
$this->assertResponseStatusCodeSame(200);
3434
$this->assertJsonContains([

api/tests/Api/ContentTypes/UpdateContentTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
class UpdateContentTypeTest extends ECampApiTestCase {
1111
public function testPatchContentTypeIsNotAllowed() {
12-
$contentType = static::getFixture('contentTypeSafetyConcept');
12+
$contentType = static::getFixture('contentTypeSafetyConsiderations');
1313
static::createClientWithCredentials()->request('PATCH', '/content_types/'.$contentType->getId(), ['json' => [
1414
'title' => 'Hello World',
1515
'location' => 'Stoos',

api/tests/Api/SnapshotTests/ReadItemFixtureMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static function get(string $collectionEndpoint, array $fixtures): mixed {
1313
'/categories' => $fixtures['category1'],
1414
'/content_node/column_layouts' => $fixtures['columnLayout2'],
1515
'/content_node/responsive_layouts' => $fixtures['responsiveLayout1'],
16-
'/content_types' => $fixtures['contentTypeSafetyConcept'],
16+
'/content_types' => $fixtures['contentTypeSafetyConsiderations'],
1717
'/day_responsibles' => $fixtures['dayResponsible1'],
1818
'/days' => $fixtures['day1period1'],
1919
'/material_items' => $fixtures['materialItem1'],

0 commit comments

Comments
 (0)