Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multi-format media files #5625

Merged
merged 10 commits into from
Jul 4, 2024
Merged

Allow multi-format media files #5625

merged 10 commits into from
Jul 4, 2024

Conversation

AngelFQC
Copy link
Member

@AngelFQC AngelFQC commented Jul 2, 2024

No description provided.

@AngelFQC AngelFQC linked an issue Jul 2, 2024 that may be closed by this pull request
@AngelFQC AngelFQC force-pushed the 5600 branch 2 times, most recently from 2e63a93 to 482774f Compare July 2, 2024 22:35
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

Attention: Patch coverage is 54.01460% with 63 lines in your changes missing coverage. Please review.

Project coverage is 39.08%. Comparing base (11d197c) to head (b81a686).
Report is 30 commits behind head on master.

Files Patch % Lines
...e/Migrations/Schema/V200/Version20240702222600.php 7.69% 24 Missing ⚠️
...e/Migrations/Schema/V200/Version20230913162700.php 0.00% 18 Missing ⚠️
src/CoreBundle/Entity/ResourceNode.php 86.11% 5 Missing ⚠️
src/CoreBundle/Repository/Node/UserRepository.php 0.00% 4 Missing ⚠️
...reBundle/Controller/Api/BaseResourceFileAction.php 25.00% 3 Missing ⚠️
...e/Migrations/Schema/V200/Version20170525122900.php 0.00% 3 Missing ⚠️
...e/Migrations/Schema/V200/Version20240515124400.php 0.00% 2 Missing ⚠️
src/CoreBundle/Controller/ResourceController.php 93.33% 1 Missing ⚠️
src/CoreBundle/Controller/TemplateController.php 0.00% 1 Missing ⚠️
...e/Migrations/Schema/V200/Version20201215142610.php 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5625      +/-   ##
============================================
- Coverage     39.13%   39.08%   -0.05%     
- Complexity    10961    10988      +27     
============================================
  Files           864      867       +3     
  Lines         45332    45407      +75     
============================================
+ Hits          17739    17746       +7     
- Misses        27593    27661      +68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -149,6 +147,10 @@ class ResourceFile implements Stringable
#[Gedmo\Timestampable(on: 'update')]
#[ORM\Column(type: 'datetime')]
protected $updatedAt;

#[ORM\ManyToOne(inversedBy: 'resourceFiles')]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

@@ -149,6 +147,10 @@
#[Gedmo\Timestampable(on: 'update')]
#[ORM\Column(type: 'datetime')]
protected $updatedAt;

#[ORM\ManyToOne(inversedBy: 'resourceFiles')]
private ?ResourceNode $resourceNode = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

@@ -339,4 +332,16 @@

return $this;
}

public function getResourceNode(): ?ResourceNode
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

@@ -339,4 +332,16 @@

return $this;
}

public function getResourceNode(): ?ResourceNode
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

return $this->resourceNode;
}

public function setResourceNode(?ResourceNode $resourceNode): static
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

return $this->resourceNode;
}

public function setResourceNode(?ResourceNode $resourceNode): static
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

return $this->resourceNode;
}

public function setResourceNode(?ResourceNode $resourceNode): static
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scope keyword "static" must be followed by a single space

@@ -68,7 +68,7 @@
],
]
)]
#[ApiFilter(filterClass: OrderFilter::class, properties: ['id', 'title', 'resourceFile', 'createdAt', 'updatedAt'])]
#[ApiFilter(filterClass: OrderFilter::class, properties: ['id', 'title', 'createdAt', 'updatedAt'])]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

protected ?ResourceFile $resourceFile = null;
//#[ORM\OneToOne(inversedBy: 'resourceNode', targetEntity: ResourceFile::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
//#[ORM\JoinColumn(name: 'resource_file_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#protected ?ResourceFile $resourceFile = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

* @var Collection<int, ResourceFile>
*/
#[Groups(['resource_node:read', 'resource_node:write', 'document:read', 'document:write', 'message:read'])]
#[ORM\OneToMany(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

@AngelFQC AngelFQC marked this pull request as ready for review July 2, 2024 23:57
@@ -2214,10 +2214,10 @@ public static function get_document_preview(
'rootOpen' => '<ul id="doc_list" class="list-group lp_resource">',
'rootClose' => '</ul>',
//'childOpen' => '<li class="doc_resource lp_resource_element ">',
'childOpen' => function ($child) {
'childOpen' => function ($child) {;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opening brace must be the last content on the line

cascade: ['persist', 'remove'],
fetch: 'EXTRA_LAZY',
)]
private Collection $resourceFiles;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

@@ -198,6 +204,7 @@
$this->comments = new ArrayCollection();
$this->createdAt = new DateTime();
$this->fileEditableText = false;
$this->resourceFiles = new ArrayCollection();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected at least 12 spaces, found 8

@@ -478,8 +485,8 @@

public function hasEditableTextContent(): bool
{
if ($this->hasResourceFile()) {
$mimeType = $this->getResourceFile()->getMimeType();
if ($resourceFile = $this->resourceFiles->first()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 12 spaces, found 8

if ($this->hasResourceFile()) {
$mimeType = $this->getResourceFile()->getMimeType();
if ($resourceFile = $this->resourceFiles->first()) {
$mimeType = $resourceFile->getMimeType();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected at least 16 spaces, found 12

}

public function getIcon(): string
public function getIcon(?string $additionalClass = null): string
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

}

public function getIcon(): string
public function getIcon(?string $additionalClass = null): string
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

@@ -521,13 +509,17 @@
}
}

if ($additionalClass) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 12 spaces, found 8

@@ -521,13 +509,17 @@
}
}

if ($additionalClass) {
$class .= " $additionalClass";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected at least 16 spaces, found 12

return '<i class="'.$class.'"></i>';
}

public function isResourceFileAnImage(): bool
{
if ($this->hasResourceFile()) {
$mimeType = $this->getResourceFile()->getMimeType();
if ($resourceFile = $this->resourceFiles->first()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 12 spaces, found 8

Copy link

codeclimate bot commented Jul 4, 2024

An error occurred when fetching issues.

View more on Code Climate.

@ywarnier ywarnier merged commit 95b92f6 into chamilo:master Jul 4, 2024
5 of 9 checks passed
@AngelFQC AngelFQC deleted the 5600 branch October 14, 2024 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C2] Allow multi-format media files
2 participants