File

projects/congarevenuecloud/elements/src/lib/files/files.component.ts

Description

The files component is used for showing a list of attachments associated with an order in a table view.

Preview

Usage

Example :
import { FilesModule } from '@congarevenuecloud/elements';

@NgModule({
imports: [FilesModule, ...]
})
export class AppModule {}
Example :
```typescript
<apt-files
          [recordId]="recordId"
></apt-files>
Example :

Implements

OnChanges OnDestroy

Metadata

Index

Methods
Inputs

Constructor

constructor(storefrontService: StorefrontService, attachmentService: AttachmentService, fileService: FileService, productInformationService: ProductInformationService)
Parameters :
Name Type Optional
storefrontService StorefrontService No
attachmentService AttachmentService No
fileService FileService No
productInformationService ProductInformationService No

Inputs

orderGenerated
Type : boolean

Flag to determine whether order is generated or not

record
Type : AObject

Represents the type of the object which is an instance of AObject

recordId
Type : string

Represents the identifier for the object

Methods

download
download(file: IFile)

Downloads the file represented by the provided IFile object. If the file is a standalone file, it is downloaded using the fileService. If the file is an attachment, its URL is retrieved using the productInformationService, and the file is opened in a new browser window.

Parameters :
Name Type Optional Description
file IFile No

The IFile object representing the file to be downloaded.

Returns : void
<h5 class="py-2 text-uppercase">
    {{'DETAILS.ATTACHMENTS' | translate}}
    <span *ngIf="fileList$ | async as fileList">({{fileList.length}})</span>
</h5>
<div class="row">
    <div class="col">
        <table class="table table-sm">
            <thead>
                <tr>
                    <th scope="col">#</th>
                    <th scope="col">Name</th>
                    <th scope="col">Type</th>
                    <th scope="col">File Size</th>
                    <th scope="col">Created Date</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let file of fileList$ | async">
                    <th scope="row">{{file.index}}</th>
                    <td><a class="text-underline" (click)="download(file)" target="_blank">{{file.title}}</a></td>
                    <td class="text-truncate">{{file.type}}</td>
                    <td>{{file.size}}</td>
                    <td>{{file.created_date | date:'short'}}</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>

./files.component.scss

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""