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

Fileupload | template enhancement #15435

Closed
mehmetcetin01140 opened this issue May 2, 2024 · 0 comments · Fixed by #15508 · May be fixed by Rodolphe33/gestion-personnel#2 or diaz-rigo/austins#4
Closed

Fileupload | template enhancement #15435

mehmetcetin01140 opened this issue May 2, 2024 · 0 comments · Fixed by #15508 · May be fixed by Rodolphe33/gestion-personnel#2 or diaz-rigo/austins#4
Assignees
Labels
Core Team Issue or pull request has been *opened* by a member of Core Team Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@mehmetcetin01140
Copy link
Contributor

mehmetcetin01140 commented May 2, 2024

New callbacks will be added.

HeaderTemplate:

<ng-container *ngTemplateOutlet="headerTemplate; context: { $implicit: files, uploadedFiles: uploadedFiles, chooseCallback: choose.bind(this), clearCallback: clear.bind(this), uploadCallback: upload.bind(this) }"></ng-container>

ContentTemplate:

<ng-container *ngTemplateOutlet="contentTemplate; context: { $implicit: files, uploadedFiles: uploadedFiles, removeUploadedFileCallback: removeUploadedFile.bind(this), progress: progress, messages: msgs }"></ng-container>

New removeUploadFile method & onRemoveUploadedFile emitter will be added:

 /**
     * This event is triggered if an error occurs while loading an image file.
     * @param {RemoveUploadedFileEvent} event - Remove event.
     * @group Emits
     */
    @Output() onRemoveUploadedFile: EventEmitter<RemoveUploadedFileEvent> = new EventEmitter<RemoveUploadedFileEvent>();

    /**
     * Removes uploaded file.
     * @param {Number} index - Index of the file to be removed.
     * @group Method
     */
    removeUploadedFile(index) {
        let removedFile = this.uploadedFiles.splice(index, 1)[0];
        this.uploadedFiles = [...this.uploadedFiles];
        this.onRemoveUploadedFile.emit({ file: removedFile, files: this.uploadedFiles });
    }

New uploadedFiles property will be added, it's accessible by ViewChild:

    public uploadedFiles = [];
@mehmetcetin01140 mehmetcetin01140 added the Core Team Issue or pull request has been *opened* by a member of Core Team label May 2, 2024
@mehmetcetin01140 mehmetcetin01140 added this to the 17.16.0 milestone May 2, 2024
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 2, 2024
@mehmetcetin01140 mehmetcetin01140 added Type: New Feature Issue contains a new feature or new component request Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: New Feature Issue contains a new feature or new component request labels May 2, 2024
@cetincakiroglu cetincakiroglu modified the milestones: 17.16.0, 17.16.1 May 3, 2024
cetincakiroglu added a commit that referenced this issue May 9, 2024
Fixes #15435 - FileUpload | Templating enhancements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Team Issue or pull request has been *opened* by a member of Core Team Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
2 participants