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

MOBILE-4070 attachments: Collapse mimetypes #4147

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/core/components/attachments/attachments.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
core-loading {
--loading-inline-min-height: 60px;
@use "theme/globals" as *;

:host {
core-loading {
--loading-inline-min-height: 60px;
}

.core-attachments {
@include margin-horizontal(null, var(--mdl-spacing-3));

&-header {
ion-icon {
@include margin-horizontal(null, var(--mdl-spacing-3));
font-size: var(--mdl-typography-icon-fontSize-sm);
}
}
}
}
24 changes: 18 additions & 6 deletions src/core/components/attachments/core-attachments.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,28 @@
<ion-icon name="fas-plus" slot="icon-only" aria-hidden="true" />
</ion-button>
</ion-item>
<ion-item class="ion-text-wrap" *ngIf="fileTypes && fileTypes.mimetypes && fileTypes.mimetypes.length">
<ion-label>
<p>{{ 'core.fileuploader.filesofthesetypes' | translate }}</p>
<ul class="list-with-style">

@if (fileTypes && fileTypes.mimetypes && fileTypes.mimetypes.length) {
<ion-accordion-group>
<ion-accordion toggleIconSlot="start">
<ion-item class="core-attachments-header ion-text-wrap" slot="header">
<ion-label>
<p class="item-heading">{{ 'core.fileuploader.filesofthesetypes' | translate }}</p>
</ion-label>
<ion-icon name="fas-circle-info" aria-hidden="true" slot="end" color="dark" />
</ion-item>

<ul class="core-attachments" slot="content">
<li *ngFor="let typeInfo of fileTypes.info">
<strong *ngIf="typeInfo.name">{{typeInfo.name}} </strong>{{typeInfo.extlist}}
</li>
</ul>
</ion-label>
</ion-item>
</ion-accordion>
</ion-accordion-group>
}



<ng-container *ngFor="let file of files; let index=index">
<!-- Files already attached to the submission, either in online or in offline. -->
<core-file *ngIf="!file.name" [file]="file" [component]="component" [componentId]="componentId" [canDelete]="true"
Expand Down