-
Notifications
You must be signed in to change notification settings - Fork 486
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
Conversation
2e63a93
to
482774f
Compare
Codecov ReportAttention: Patch coverage is
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. |
@@ -149,6 +147,10 @@ class ResourceFile implements Stringable | |||
#[Gedmo\Timestampable(on: 'update')] | |||
#[ORM\Column(type: 'datetime')] | |||
protected $updatedAt; | |||
|
|||
#[ORM\ManyToOne(inversedBy: 'resourceFiles')] |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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'])] |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
@@ -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) {; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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
… it is not used - refs chamilo#5600
An error occurred when fetching issues. View more on Code Climate. |
No description provided.