Skip to content

Commit

Permalink
Deploying to gh-pages from @ db7955b 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorCapCoder committed May 2, 2024
1 parent db48fe4 commit dbbd63b
Show file tree
Hide file tree
Showing 166 changed files with 14,068 additions and 12,459 deletions.
725 changes: 725 additions & 0 deletions classes/MissingMediaLicenseLoggableException.html

Large diffs are not rendered by default.

30 changes: 27 additions & 3 deletions coverage.html
Original file line number Diff line number Diff line change
Expand Up @@ -7001,7 +7001,7 @@
<td>MediaBoardConfig</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/2)</span>
<span class="coverage-count">(0/3)</span>
</td>
</tr>
<tr class="low">
Expand Down Expand Up @@ -7373,7 +7373,7 @@
<td>MediaAvailableLineUc</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/5)</span>
<span class="coverage-count">(0/6)</span>
</td>
</tr>
<tr class="low">
Expand Down Expand Up @@ -21188,6 +21188,18 @@
<span class="coverage-count">(0/2)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./classes/MissingMediaLicenseLoggableException.html">apps/server/src/modules/tool/tool-launch/error/missing-licence.loggable-exception.ts</a>
</td>
<td>class</td>
<td>MissingMediaLicenseLoggableException</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/9)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
Expand Down Expand Up @@ -21521,7 +21533,7 @@
<td>ToolLaunchUc</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/3)</span>
<span class="coverage-count">(0/4)</span>
</td>
</tr>
<tr class="low">
Expand Down Expand Up @@ -22124,6 +22136,18 @@
<span class="coverage-count">(0/8)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
<a href="./injectables/MediaUserLicenseService.html">apps/server/src/modules/user-license/service/media-user-license.service.ts</a>
</td>
<td>injectable</td>
<td>MediaUserLicenseService</td>
<td align="right" data-sort="0">
<span class="coverage-percent">0 %</span>
<span class="coverage-count">(0/2)</span>
</td>
</tr>
<tr class="low">
<td>
<!-- miscellaneous -->
Expand Down
7,482 changes: 3,759 additions & 3,723 deletions graph/dependencies.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 146 additions & 10 deletions injectables/MediaAvailableLineUc.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ <h6><b>Methods</b></h6>
<span class="modifier">Async</span>
<a href="#checkUsersPermissions" >checkUsersPermissions</a>
</li>
<li>
<span class="modifier">Private</span>
<span class="modifier">Async</span>
<a href="#filterUnlicensedTools" >filterUnlicensedTools</a>
</li>
<li>
<span class="modifier">Public</span>
<span class="modifier">Async</span>
Expand All @@ -165,12 +170,12 @@ <h3 id="constructor">Constructor</h3>
<tbody>
<tr>
<td class="col-md-4">
<code>constructor(authorizationService: <a href="../injectables/AuthorizationService.html" target="_self">AuthorizationService</a>, boardDoAuthorizableService: <a href="../injectables/BoardDoAuthorizableService.html" target="_self">BoardDoAuthorizableService</a>, mediaAvailableLineService: <a href="../injectables/MediaAvailableLineService.html" target="_self">MediaAvailableLineService</a>, configService: <a href="../classes/MediaBoard.html" target="_self">ConfigService&lt;MediaBoardConfig | &gt;</a>, mediaBoardService: <a href="../injectables/MediaBoardService.html" target="_self">MediaBoardService</a>)</code>
<code>constructor(authorizationService: <a href="../injectables/AuthorizationService.html" target="_self">AuthorizationService</a>, boardDoAuthorizableService: <a href="../injectables/BoardDoAuthorizableService.html" target="_self">BoardDoAuthorizableService</a>, mediaAvailableLineService: <a href="../injectables/MediaAvailableLineService.html" target="_self">MediaAvailableLineService</a>, configService: <a href="../classes/MediaBoard.html" target="_self">ConfigService&lt;MediaBoardConfig | &gt;</a>, mediaBoardService: <a href="../injectables/MediaBoardService.html" target="_self">MediaBoardService</a>, userLicenseService: <a href="../injectables/UserLicenseService.html" target="_self">UserLicenseService</a>, mediaUserLicenseService: <a href="../injectables/MediaUserLicenseService.html" target="_self">MediaUserLicenseService</a>)</code>
</td>
</tr>
<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="14" class="link-to-prism">apps/server/src/modules/board/uc/media-board/media-available-line.uc.ts:14</a></div>
<div class="io-line">Defined in <a href="" data-line="16" class="link-to-prism">apps/server/src/modules/board/uc/media-board/media-available-line.uc.ts:16</a></div>
</td>
</tr>

Expand Down Expand Up @@ -247,6 +252,30 @@ <h3 id="constructor">Constructor</h3>
</td>

</tr>
<tr>
<td>userLicenseService</td>

<td>
<code><a href="../injectables/UserLicenseService.html" target="_self" >UserLicenseService</a></code>
</td>

<td>
No
</td>

</tr>
<tr>
<td>mediaUserLicenseService</td>

<td>
<code><a href="../injectables/MediaUserLicenseService.html" target="_self" >MediaUserLicenseService</a></code>
</td>

<td>
No
</td>

</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -283,8 +312,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="57"
class="link-to-prism">apps/server/src/modules/board/uc/media-board/media-available-line.uc.ts:57</a></div>
<div class="io-line">Defined in <a href="" data-line="65"
class="link-to-prism">apps/server/src/modules/board/uc/media-board/media-available-line.uc.ts:65</a></div>
</td>
</tr>

Expand Down Expand Up @@ -323,8 +352,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="47"
class="link-to-prism">apps/server/src/modules/board/uc/media-board/media-available-line.uc.ts:47</a></div>
<div class="io-line">Defined in <a href="" data-line="55"
class="link-to-prism">apps/server/src/modules/board/uc/media-board/media-available-line.uc.ts:55</a></div>
</td>
</tr>

Expand Down Expand Up @@ -382,6 +411,88 @@ <h3 id="methods">
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
<a name="filterUnlicensedTools"></a>
<span class="name">
<span class="modifier">Private</span>
<span class="modifier">Async</span>
<span ><b>filterUnlicensedTools</b></span>
<a href="#filterUnlicensedTools"><span class="icon ion-ios-link"></span></a>
</span>
</td>
</tr>
<tr>
<td class="col-md-4">
<span class="modifier-icon icon ion-ios-reset"></span>
<code>filterUnlicensedTools(userId: <a href="../undefineds/EntityId.html" target="_self">EntityId</a>, matchedTools: [])</code>
</td>
</tr>


<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="71"
class="link-to-prism">apps/server/src/modules/board/uc/media-board/media-available-line.uc.ts:71</a></div>
</td>
</tr>


<tr>
<td class="col-md-4">

<div class="io-description">
<b>Parameters :</b>

<table class="params">
<thead>
<tr>
<td>Name</td>
<td>Type</td>
<td>Optional</td>
</tr>
</thead>
<tbody>
<tr>
<td>userId</td>
<td>
<code><a href="../miscellaneous/typealiases.html#EntityId" target="_self" >EntityId</a></code>
</td>

<td>
No
</td>


</tr>
<tr>
<td>matchedTools</td>
<td>
<code>[]</code>
</td>

<td>
No
</td>


</tr>
</tbody>
</table>
</div>
<div class="io-description">
<b>Returns : </b> <code>Promise&lt;[]&gt;</code>

</div>
<div class="io-description">

</div>
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
Expand All @@ -405,8 +516,8 @@ <h3 id="methods">

<tr>
<td class="col-md-4">
<div class="io-line">Defined in <a href="" data-line="23"
class="link-to-prism">apps/server/src/modules/board/uc/media-board/media-available-line.uc.ts:23</a></div>
<div class="io-line">Defined in <a href="" data-line="27"
class="link-to-prism">apps/server/src/modules/board/uc/media-board/media-available-line.uc.ts:27</a></div>
</td>
</tr>

Expand Down Expand Up @@ -472,6 +583,8 @@ <h3 id="methods">
<div class="tab-pane fade tab-source-code" id="source">
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { AuthorizationContextBuilder, AuthorizationService } from &#x27;@modules/authorization&#x27;;
import { SchoolExternalTool } from &#x27;@modules/tool/school-external-tool/domain&#x27;;
import { MediaUserLicense, UserLicenseService } from &#x27;@modules/user-license&#x27;;
import { MediaUserLicenseService } from &#x27;@modules/user-license/service&#x27;;
import { Injectable } from &#x27;@nestjs/common&#x27;;
import { ConfigService } from &#x27;@nestjs/config&#x27;;
import { FeatureDisabledLoggableException } from &#x27;@shared/common/loggable-exception&#x27;;
Expand All @@ -489,7 +602,9 @@ <h3 id="methods">
private readonly boardDoAuthorizableService: BoardDoAuthorizableService,
private readonly mediaAvailableLineService: MediaAvailableLineService,
private readonly configService: ConfigService&lt;MediaBoardConfig, true&gt;,
private readonly mediaBoardService: MediaBoardService
private readonly mediaBoardService: MediaBoardService,
private readonly userLicenseService: UserLicenseService,
private readonly mediaUserLicenseService: MediaUserLicenseService
) {}

public async getMediaAvailableLine(userId: EntityId, boardId: EntityId): Promise&lt;MediaAvailableLine&gt; {
Expand All @@ -505,11 +620,15 @@ <h3 id="methods">
const availableExternalTools: ExternalTool[] &#x3D;
await this.mediaAvailableLineService.getAvailableExternalToolsForSchool(schoolExternalToolsForAvailableMediaLine);

const matchedTools: [ExternalTool, SchoolExternalTool][] &#x3D; this.mediaAvailableLineService.matchTools(
let matchedTools: [ExternalTool, SchoolExternalTool][] &#x3D; this.mediaAvailableLineService.matchTools(
availableExternalTools,
schoolExternalToolsForAvailableMediaLine
);

if (this.configService.get(&#x27;FEATURE_SCHULCONNEX_MEDIA_LICENSE_ENABLED&#x27;)) {
matchedTools &#x3D; await this.filterUnlicensedTools(userId, matchedTools);
}

const mediaAvailableLine: MediaAvailableLine &#x3D;
this.mediaAvailableLineService.createMediaAvailableLine(matchedTools);

Expand All @@ -531,6 +650,23 @@ <h3 id="methods">
throw new FeatureDisabledLoggableException(&#x27;FEATURE_MEDIA_SHELF_ENABLED&#x27;);
}
}

private async filterUnlicensedTools(
userId: EntityId,
matchedTools: [ExternalTool, SchoolExternalTool][]
): Promise&lt;[ExternalTool, SchoolExternalTool][]&gt; {
const mediaUserLicenses: MediaUserLicense[] &#x3D; await this.userLicenseService.getMediaUserLicensesForUser(userId);

matchedTools &#x3D; matchedTools.filter((tool: [ExternalTool, SchoolExternalTool]): boolean &#x3D;&gt; {
const externalToolMediumId &#x3D; tool[0]?.medium?.mediumId;
if (externalToolMediumId) {
return this.mediaUserLicenseService.hasLicenseForExternalTool(externalToolMediumId, mediaUserLicenses);
}
return true;
});

return matchedTools;
}
}
</code></pre>
</div>
Expand Down
Loading

0 comments on commit dbbd63b

Please sign in to comment.