Skip to content

Commit

Permalink
Merge branch 'feature-toolbar' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Oct 15, 2023
2 parents 696155d + 8cee2a5 commit be084b5
Show file tree
Hide file tree
Showing 31 changed files with 518 additions and 1,671 deletions.
3 changes: 0 additions & 3 deletions projects/aas-lib/src/lib/aas-lib.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { StoreModule } from '@ngrx/store';
import { FormsModule } from '@angular/forms';

import { ToolbarComponent } from './toolbar/toolbar.component';
import { NotifyComponent } from './notify/notify.component';
import { LocalizeComponent } from './localize/localize.component';
import { LoginFormComponent } from './auth/login-form/login-form.component';
Expand Down Expand Up @@ -42,7 +41,6 @@ import { SecuredImageComponent } from './secured-image/secured-image.component';
@NgModule({
declarations: [
NotifyComponent,
ToolbarComponent,
LocalizeComponent,
LoginFormComponent,
RegisterFormComponent,
Expand Down Expand Up @@ -75,7 +73,6 @@ import { SecuredImageComponent } from './secured-image/secured-image.component';
],
exports: [
NotifyComponent,
ToolbarComponent,
LocalizeComponent,
LoginFormComponent,
RegisterFormComponent,
Expand Down
31 changes: 13 additions & 18 deletions projects/aas-lib/src/lib/download.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,20 @@ export class DownloadService {
* @param id The AAS identifier.
* @param name The file name.
*/
public downloadDocumentAsync(url: string, id: string, name: string): Promise<void> {
return new Promise<void>((resolve, reject) => {
this.http.get(
`/api/v1/containers/${encodeBase64Url(url)}/documents/${encodeBase64Url(id)}`,
{
responseType: 'blob'
}).pipe(map(blob => {
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.setAttribute('download', name);
a.click();
URL.revokeObjectURL(a.href);
})).subscribe({
error: (error) => reject(error),
complete: () => resolve()
});
});
public downloadDocument(url: string, id: string, name: string): Observable<void> {
return this.http.get(
`/api/v1/containers/${encodeBase64Url(url)}/documents/${encodeBase64Url(id)}`,
{
responseType: 'blob'
}).pipe(map(blob => {
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.setAttribute('download', name);
a.click();
URL.revokeObjectURL(a.href);
}));
}

/**
* Uploads the specified aasx file.
* @param file A file.
Expand Down
109 changes: 0 additions & 109 deletions projects/aas-lib/src/lib/toolbar/toolbar.component.html

This file was deleted.

7 changes: 0 additions & 7 deletions projects/aas-lib/src/lib/toolbar/toolbar.component.scss

This file was deleted.

164 changes: 0 additions & 164 deletions projects/aas-lib/src/lib/toolbar/toolbar.component.ts

This file was deleted.

Loading

0 comments on commit be084b5

Please sign in to comment.