Skip to content

Commit

Permalink
b
Browse files Browse the repository at this point in the history
  • Loading branch information
polterguy committed Dec 18, 2023
1 parent 3013483 commit 18a086d
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 304 deletions.
5 changes: 0 additions & 5 deletions backend/files/system/auth/email-templates/README.md

This file was deleted.

85 changes: 0 additions & 85 deletions backend/files/system/auth/email-templates/register.html

This file was deleted.

82 changes: 0 additions & 82 deletions backend/files/system/auth/email-templates/reset-password.html

This file was deleted.

79 changes: 0 additions & 79 deletions backend/files/system/auth/import-users.put.hl

This file was deleted.

18 changes: 0 additions & 18 deletions frontend/src/app/_general/services/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,6 @@ export class FileService {
});
}

/**
* Imports users
*/
public importUsers(file: any) {

const formData: FormData = new FormData();
formData.append('file', file);
return this.httpService.put<any>('/magic/system/auth/import-users', formData);
}

/**
* Uploads a file to your backend.
*/
public uploadStaticWebsite(data: FormData) {

return this.httpService.put<any>('/magic/system/file-system/overwrite-folder', data);
}

/**
* Downloads a file from backend.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@

<div class="d-flex justify-content-end button-row align-items-center w-100">

<button
mat-button
color="primary"
*ngIf="tab === 'user'"
(click)="csvFile.click()">
Import users
</button>

<button
mat-flat-button
color="primary"
Expand All @@ -26,13 +18,5 @@
Add {{tab}}
</button>

<input
type="file"
[(ngModel)]="csvFileInput"
#csvFile
class="d-none"
accept=".csv"
(change)="uploadUsers($event.target.files)">

</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import { Component, EventEmitter, Input, Output } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { GeneralService } from 'src/app/_general/services/general.service';
import { FileService } from 'src/app/_general/services/file.service';
import { Role } from '../../_models/role.model';
import { ManageRoleDialogComponent } from '../manage-role-dialog/manage-role-dialog.component';
import { NewUserDialogComponent } from '../new-user-dialog/new-user-dialog.component';
Expand All @@ -28,23 +26,7 @@ export class SharedTopBarComponent {
@Output() getUsersList = new EventEmitter<any>();
@Output() getRolesList = new EventEmitter<any>();

csvFileInput: any = null;

constructor(
private dialog: MatDialog,
private fileService: FileService,
private generalService: GeneralService) { }

uploadUsers(files: any) {

this.fileService.importUsers(files.item(0)).subscribe({
next: (res: any) => {
this.csvFileInput = null;
this.getUsersList.emit({ search: this.searchTerm });
this.generalService.showFeedback(`${res.count} users were successfully imported`);
}, error: (error: any) => this.generalService.showFeedback(error?.error?.message ?? error, 'errorMessage')
});
}
constructor(private dialog: MatDialog) { }

filterList(event: { searchKey: string }) {

Expand Down Expand Up @@ -97,10 +79,12 @@ export class SharedTopBarComponent {
*/

private getUsers() {

this.getUsersList.emit({ search: this.searchTerm });
}

private getRoles() {

this.getRolesList.emit({ search: this.searchTerm });
}
}

0 comments on commit 18a086d

Please sign in to comment.