Skip to content

Commit

Permalink
IBX-7409: Changed Content Type to content type (#316)
Browse files Browse the repository at this point in the history
* IBX-7409: Changed Content Type to Content type

* Generated translations

* Changed Content type to content type

* Fixes after CR

* Fixed translations

* Fix translations in forms

* Fixes labels and code prettier remove

* Modified readme file

* Final readme changes

* Copied Readme.mdn from core

* Readme.md newline
  • Loading branch information
Gengar-i authored Jan 22, 2024
1 parent a7ebd0d commit 2ac0538
Show file tree
Hide file tree
Showing 68 changed files with 209 additions and 209 deletions.
2 changes: 1 addition & 1 deletion src/bundle/Core/Command/CleanupVersionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function configure()
'excluded-content-types',
null,
InputOption::VALUE_OPTIONAL,
'Comma-separated list of Content Type identifiers whose versions should not be removed, for instance `article`.',
'Comma-separated list of content type identifiers whose versions should not be removed, for instance `article`.',
self::DEFAULT_EXCLUDED_CONTENT_TYPES
)->setHelp(
<<<EOT
Expand Down
10 changes: 5 additions & 5 deletions src/bundle/Core/Command/ExpireUserPasswordsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected function configure(): void
'user-content-type-identifier',
'ct',
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
'Expire passwords of all users based on specific Content Type'
'Expire passwords of all users based on specific content type'
)
->addOption(
'force',
Expand All @@ -107,7 +107,7 @@ protected function configure(): void
'password-ttl',
't',
InputOption::VALUE_REQUIRED,
'After how many days passwords expire. Set when Content Type needs to be updated.',
'After how many days passwords expire. Set when content type needs to be updated.',
self::DEFAULT_PASSWORD_TTL
)
->setHelp(
Expand Down Expand Up @@ -271,7 +271,7 @@ private function supplySearchCriteria(
if (!empty($userContentTypeIdentifiers)) {
$output->writeln(
sprintf(
"<info>\tUser Content Type Identifier: %s</info>",
"<info>\tUser content type Identifier: %s</info>",
implode(', ', $userContentTypeIdentifiers)
)
);
Expand Down Expand Up @@ -337,7 +337,7 @@ private function updateContentType(
$fieldSettings = $userFieldDefinition->getFieldSettings();

$output->writeln(sprintf(
'<info>Content Type "%s" needs to be updated:</info>',
'<info>Content type "%s" needs to be updated:</info>',
$contentType->identifier
));

Expand Down Expand Up @@ -425,7 +425,7 @@ private function doesContentTypeNeedUpdate(ContentType $contentType, array $proc

if ($count !== 1) {
throw new InvalidArgumentException(sprintf(
'Expected exactly 1 "%s" field type in "%s" Content Type, found %d',
'Expected exactly 1 "%s" field type in "%s" content type, found %d',
self::USER_FIELDTYPE_IDENTIFIER,
$contentType->identifier,
$count
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Core/Command/ResizeOriginalImagesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected function configure()
->addArgument(
'contentTypeIdentifier',
InputArgument::REQUIRED,
'Identifier of a Content Type which has an ezimage Field Type.'
'Identifier of a content type which has an ezimage Field Type.'
)
->addOption(
'filter',
Expand Down Expand Up @@ -150,7 +150,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (!$fieldType || $fieldType->fieldTypeIdentifier !== 'ezimage') {
$output->writeln(
sprintf(
"<error>Field Type with identifier '%s' in Content Type '%s' must be 'ezimage', you provided '%s'.</error>",
"<error>Field Type with identifier '%s' in content type '%s' must be 'ezimage', you provided '%s'.</error>",
$imageFieldIdentifier,
$contentType->identifier,
$fieldType ? $fieldType->fieldTypeIdentifier : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder)
{
$nodeBuilder
->arrayNode('user_content_type_identifier')
->info('User Content Type identifier configuration.')
->info('User content type identifier configuration.')
->example(['user', 'my_custom_user_identifier'])
->requiresAtLeastOneElement()
->prototype('scalar')->end()
Expand Down
28 changes: 14 additions & 14 deletions src/bundle/Core/Features/Context/ContentTypeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use PHPUnit\Framework\Assert as Assertion;

/**
* Sentences for Content Types.
* Sentences for content types.
*/
class ContentTypeContext implements Context
{
Expand All @@ -36,8 +36,8 @@ public function __construct(ContentTypeService $contentTypeService)
}

/**
* @Given (that) a Content Type exists with identifier :identifier with fields:
* @Given (that) a Content Type exists with identifier :identifier in Group with identifier :groupIdentifier with fields:
* @Given (that) a content type exists with identifier :identifier with fields:
* @Given (that) a content type exists with identifier :identifier in Group with identifier :groupIdentifier with fields:
* | Identifier | Type | Name |
* | title | ezstring | Title |
* | body | ezxml | Body |
Expand All @@ -60,7 +60,7 @@ public function ensureContentTypeWithIndentifier(
}

/**
* @Given (that) a Content Type does not exist with identifier :identifier
* @Given (that) a content type does not exist with identifier :identifier
*
* Makes sure a content type with $identifier does not exist.
* If it exists deletes it.
Expand All @@ -74,48 +74,48 @@ public function ensureContentTypeDoesntExist($identifier)
}

/**
* @Then Content Type (with identifier) :identifier exists
* @Then content type (with identifier) :identifier exists
*
* Verifies that a content type with $identifier exists.
*/
public function assertContentTypeExistsByIdentifier($identifier)
{
Assertion::assertTrue(
$this->checkContentTypeExistenceByIdentifier($identifier),
"Couldn't find a Content Type with identifier '$identifier'."
"Couldn't find a content type with identifier '$identifier'."
);
}

/**
* @Then Content Type (with identifier) :identifier does not exist
* @Then content type (with identifier) :identifier does not exist
*
* Verifies that a content type with $identifier does not exist.
*/
public function assertContentTypeDoesntExistsByIdentifier($identifier)
{
Assertion::assertFalse(
$this->checkContentTypeExistenceByIdentifier($identifier),
"Found a Content Type with identifier '$identifier'."
"Found a content type with identifier '$identifier'."
);
}

/**
* @Then Content Type (with identifier) :identifier exists in Group with identifier :groupIdentifier
* @Then content type (with identifier) :identifier exists in Group with identifier :groupIdentifier
*
* Verifies that a content type with $identifier exists in group with identifier $groupIdentifier.
*/
public function assertContentTypeExistsByIdentifierOnGroup($identifier, $groupIdentifier)
{
Assertion::assertTrue(
$this->checkContentTypeExistenceByIdentifier($identifier, $groupIdentifier),
"Couldn't find Content Type with identifier '$identifier' on '$groupIdentifier."
"Couldn't find content type with identifier '$identifier' on '$groupIdentifier."
);
}

/**
* Load and return a content type by its identifier.
*
* @param string $identifier content type identifier
* @param string $identifier Content type identifier
* @param bool $throwIfNotFound if true, throws an exception if it is not found.
*
* @return \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup|null
Expand All @@ -140,9 +140,9 @@ protected function loadContentTypeByIdentifier($identifier, $throwIfNotFound = t
* Creates a content type with $identifier on content type group with identifier $groupIdentifier and with the
* given 'fields' definitions.
*
* @param string $groupIdentifier content type group identifier
* @param string $identifier content type identifier
* @param array $fields content type fields definitions
* @param string $groupIdentifier Content type group identifier
* @param string $identifier Content type identifier
* @param array $fields Content type fields definitions
*
* @return \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType
*/
Expand Down
12 changes: 6 additions & 6 deletions src/bundle/Core/Features/Context/FieldTypeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ private function getActualFieldPosition()
}

/**
* @Given a Content Type with an :fieldType field exists
* @Given a Content Type with an :fieldType with field definition name :name exists
* @Given a content type with an :fieldType field exists
* @Given a content type with an :fieldType with field definition name :name exists
*
* Creates a ContentType with only the desired FieldType.
*/
Expand All @@ -350,8 +350,8 @@ public function createContentTypeWithFieldType($fieldType, $name = null)
}

/**
* @Given a Content Type with a required :fieldType field exists
* @Given a Content Type with a required :fieldType with field definition name :name exists
* @Given a content type with a required :fieldType field exists
* @Given a content type with a required :fieldType with field definition name :name exists
*
* Creates a ContentType with only the desired FieldType.
*/
Expand All @@ -372,8 +372,8 @@ public function createContentOfThisType($field = null, $value = null)
}

/**
* @Given a Content Type with an :fieldType field exists with Properties:
* @Given a Content Type with an :fieldType field with name :name exists with Properties:
* @Given a content type with an :fieldType field exists with Properties:
* @Given a content type with an :fieldType field with name :name exists with Properties:
*/
public function createContentOfThisTypeWithProperties($fieldType, TableNode $properties, $name = null)
{
Expand Down
20 changes: 10 additions & 10 deletions src/bundle/Core/Resources/translations/forms.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@
</header>
<body>
<trans-unit id="f52e45b25ff70b3d1d07c57911ceda58dcdf7431" resname="role.policy.class">
<source>Content Type</source>
<target>Content Type</target>
<source>Content type</source>
<target>Content type</target>
<note>key: role.policy.class</note>
</trans-unit>
<trans-unit id="2f746c35c587bdc84cacf38d0e63e08855e831ab" resname="role.policy.class.all_functions">
<source>Content Type / All functions</source>
<target>Content Type / All functions</target>
<source>Content type / All functions</source>
<target>Content type / All functions</target>
<note>key: role.policy.class.all_functions</note>
</trans-unit>
<trans-unit id="02049080d0f8dea3f723bbd1a280900b0657914e" resname="role.policy.class.create">
<source>Content Type / Create</source>
<target>Content Type / Create</target>
<source>Content type / Create</source>
<target>Content type / Create</target>
<note>key: role.policy.class.create</note>
</trans-unit>
<trans-unit id="17ee6a3320ad9ac02c376bdcb875b266c28e34db" resname="role.policy.class.delete">
<source>Content Type / Delete</source>
<target>Content Type / Delete</target>
<source>Content type / Delete</source>
<target>Content type / Delete</target>
<note>key: role.policy.class.delete</note>
</trans-unit>
<trans-unit id="f47b14b0adc8b08abd44c37e801d6b2c3180a2ee" resname="role.policy.class.update">
<source>Content Type / Update</source>
<target>Content Type / Update</target>
<source>Content type / Update</source>
<target>Content type / Update</target>
<note>key: role.policy.class.update</note>
</trans-unit>
<trans-unit id="ffe83a713e8b33558df040efa1eeadd0b1cc18e0" resname="role.policy.content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@
<target>Content "%contentName%" fields did not validate: %errors%</target>
<note>key: Content "%contentName%" fields did not validate: %errors%</note>
</trans-unit>
<trans-unit id="d131d81a8ed3356159fd8a6f013268356ed5caec" resname="Content Type Field definitions did not validate">
<source>Content Type Field definitions did not validate</source>
<target>Content Type Field definitions did not validate</target>
<note>key: Content Type Field definitions did not validate</note>
</trans-unit>
<trans-unit id="8967aa151e1b84f60c505163d42350eb6a96e948" resname="Content fields did not validate">
<source>Content fields did not validate</source>
<target>Content fields did not validate</target>
<note>key: Content fields did not validate</note>
</trans-unit>
<trans-unit id="8f64e46d8c92143a1a8fde9790a6a2423759a0ce" resname="Content type field definitions did not validate">
<source>Content type field definitions did not validate</source>
<target>Content type field definitions did not validate</target>
<note>key: Content type field definitions did not validate</note>
</trans-unit>
<trans-unit id="dbf0b883e33a6e7c433ffa9a536fd214cda39b5c" resname="Could not find %classType% class '%className%'">
<source>Could not find %classType% class '%className%'</source>
<target>Could not find %classType% class '%className%'</target>
Expand All @@ -81,15 +81,15 @@
<target>Field Type '%fieldType%' not found. It must be implemented or configured to use %nullType%</target>
<note>key: Field Type '%fieldType%' not found. It must be implemented or configured to use %nullType%</note>
</trans-unit>
<trans-unit id="e709d874ef06d490889e00bb7765c720f18ddf5f" resname="Field definition '%identifier%' does not exist in given Content Type">
<source>Field definition '%identifier%' does not exist in given Content Type</source>
<target>Field definition '%identifier%' does not exist in given Content Type</target>
<note>key: Field definition '%identifier%' does not exist in given Content Type</note>
<trans-unit id="5dc8e460be7495d772cdb7bc4d4bd2913e480273" resname="Field definition '%identifier%' does not exist in given content type">
<source>Field definition '%identifier%' does not exist in given content type</source>
<target>Field definition '%identifier%' does not exist in given content type</target>
<note>key: Field definition '%identifier%' does not exist in given content type</note>
</trans-unit>
<trans-unit id="5cfc2b732a8368cdd7f3d64ca4ab90a1af2939fb" resname="Field definition '%identifier%' does not exist in the given Content Type">
<source>Field definition '%identifier%' does not exist in the given Content Type</source>
<target>Field definition '%identifier%' does not exist in the given Content Type</target>
<note>key: Field definition '%identifier%' does not exist in the given Content Type</note>
<trans-unit id="1469ef88c3de1616907207891c1611a07459534a" resname="Field definition '%identifier%' does not exist in the given content type">
<source>Field definition '%identifier%' does not exist in the given content type</source>
<target>Field definition '%identifier%' does not exist in the given content type</target>
<note>key: Field definition '%identifier%' does not exist in the given content type</note>
</trans-unit>
<trans-unit id="c6f0fd742d6b8ce0686dc4e7a3a070efbf924204" resname="Invalid URL wildcards provided.">
<source>Invalid URL wildcards provided.</source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ public static function getTranslationMessages(): array
->setDesc('Content / Version remove'),

(new Message('role.policy.class', self::TRANSLATION_DOMAIN))
->setDesc('Content Type'),
->setDesc('Content type'),
(new Message('role.policy.class.all_functions', self::TRANSLATION_DOMAIN))
->setDesc('Content Type / All functions'),
->setDesc('Content type / All functions'),
(new Message('role.policy.class.create', self::TRANSLATION_DOMAIN))
->setDesc('Content Type / Create'),
->setDesc('Content type / Create'),
(new Message('role.policy.class.delete', self::TRANSLATION_DOMAIN))
->setDesc('Content Type / Delete'),
->setDesc('Content type / Delete'),
(new Message('role.policy.class.update', self::TRANSLATION_DOMAIN))
->setDesc('Content Type / Update'),
->setDesc('Content type / Update'),

(new Message('role.policy.state', self::TRANSLATION_DOMAIN))
->setDesc('State'),
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Limitation/Target/Builder/VersionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function createFromAnyContentTypeOf(array $contentTypeIds): self
{
foreach ($contentTypeIds as $contentTypeId) {
if (!\is_int($contentTypeId)) {
throw new InvalidArgumentException('$contentTypeIds', 'All Content Type IDs must be integers');
throw new InvalidArgumentException('$contentTypeIds', 'All content type IDs must be integers');
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Persistence/Content/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Relation extends ValueObject
public $sourceContentVersionNo;

/**
* Source Content Type Field Definition Id.
* Source content type Field Definition Id.
*
* @var mixed
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CreateStruct extends ValueObject
public $sourceContentVersionNo;

/**
* Source Content Type Field Definition Id.
* Source content type Field Definition Id.
*
* @var mixed
*/
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/Persistence/Content/Type/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function deleteGroup($groupId);
public function loadGroup($groupId);

/**
* Return list of unique Content Type Groups, with group id as key.
* Return list of unique content type groups, with group id as key.
*
* Missing items (NotFound) will be missing from the array and not cause an exception, it's up
* to calling logic to determine if this should cause exception or not.
Expand Down Expand Up @@ -80,7 +80,7 @@ public function loadAllGroups();
public function loadContentTypes($groupId, $status = Type::STATUS_DEFINED);

/**
* Return list of unique Content Types, with type id as key.
* Return list of unique content types, with type id as key.
*
* Missing items (NotFound) will be missing from the array and not cause an exception, it's up
* to calling logic to determine if this should cause exception or not.
Expand Down Expand Up @@ -175,7 +175,7 @@ public function createDraft($modifierId, $contentTypeId);
/**
* Copy a Type incl fields and group-relations from a given status to a new Type with status {@link Type::STATUS_DRAFT}.
*
* New Content Type will have $userId as creator / modifier, created / modified should be updated, new remoteId created
* New content type will have $userId as creator / modifier, created / modified should be updated, new remoteId created
* and identifier should be 'copy_of_<originalBaseIdentifier>_<newTypeId>' or another unique string.
*
* @param mixed $userId
Expand Down
Loading

0 comments on commit 2ac0538

Please sign in to comment.