Use azure direct upload for send and attachments (#1744)

* Use azure direct upload for send and attachments

* Add required attachment changes

* update jslib
This commit is contained in:
Matt Gibson 2021-03-29 10:16:31 -05:00 committed by GitHub
parent e60d7924a2
commit b69bbd3501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 11 deletions

2
jslib

@ -1 +1 @@
Subproject commit 07355694792999042e6373ebd1b3571329a969cc
Subproject commit 5c961ce847dd9ba13784ff9ba268753aae3a8c2e

View File

@ -682,7 +682,7 @@
"message": "Select a file."
},
"maxFileSize": {
"message": "Maximum file size is 100 MB."
"message": "Maximum file size is 500 MB."
},
"featureUnavailable": {
"message": "Feature Unavailable"

View File

@ -23,6 +23,7 @@ import {
import { ConsoleLogService } from 'jslib/services/consoleLog.service';
import { EventService } from 'jslib/services/event.service';
import { ExportService } from 'jslib/services/export.service';
import { FileUploadService } from 'jslib/services/fileUpload.service';
import { NotificationsService } from 'jslib/services/notifications.service';
import { PolicyService } from 'jslib/services/policy.service';
import { SearchService } from 'jslib/services/search.service';
@ -56,6 +57,7 @@ import {
import { CryptoFunctionService as CryptoFunctionServiceAbstraction } from 'jslib/abstractions/cryptoFunction.service';
import { EventService as EventServiceAbstraction } from 'jslib/abstractions/event.service';
import { ExportService as ExportServiceAbstraction } from 'jslib/abstractions/export.service';
import { FileUploadService as FileUploadServiceAbstraction } from 'jslib/abstractions/fileUpload.service';
import { NotificationsService as NotificationsServiceAbstraction } from 'jslib/abstractions/notifications.service';
import { PolicyService as PolicyServiceAbstraction } from 'jslib/abstractions/policy.service';
import { SearchService as SearchServiceAbstraction } from 'jslib/abstractions/search.service';
@ -124,6 +126,7 @@ export default class MainBackground {
analytics: Analytics;
popupUtilsService: PopupUtilsService;
sendService: SendServiceAbstraction;
fileUploadService: FileUploadServiceAbstraction
onUpdatedRan: boolean;
onReplacedRan: boolean;
@ -180,15 +183,16 @@ export default class MainBackground {
(expired: boolean) => this.logout(expired));
this.userService = new UserService(this.tokenService, this.storageService);
this.settingsService = new SettingsService(this.userService, this.storageService);
this.fileUploadService = new FileUploadService(this.consoleLogService, this.apiService);
this.cipherService = new CipherService(this.cryptoService, this.userService, this.settingsService,
this.apiService, this.storageService, this.i18nService, () => this.searchService);
this.apiService, this.fileUploadService, this.storageService, this.i18nService, () => this.searchService);
this.folderService = new FolderService(this.cryptoService, this.userService, this.apiService,
this.storageService, this.i18nService, this.cipherService);
this.collectionService = new CollectionService(this.cryptoService, this.userService, this.storageService,
this.i18nService);
this.searchService = new SearchService(this.cipherService, this.consoleLogService);
this.sendService = new SendService(this.cryptoService, this.userService, this.apiService, this.storageService,
this.i18nService, this.cryptoFunctionService);
this.sendService = new SendService(this.cryptoService, this.userService, this.apiService, this.fileUploadService,
this.storageService, this.i18nService, this.cryptoFunctionService);
this.stateService = new StateService();
this.policyService = new PolicyService(this.userService, this.storageService);
this.vaultTimeoutService = new VaultTimeoutService(this.cipherService, this.folderService,
@ -288,7 +292,7 @@ export default class MainBackground {
await this.webRequestBackground.init();
await this.windowsBackground.init();
return new Promise(resolve => {
return new Promise<void>(resolve => {
setTimeout(async () => {
await this.environmentService.setUrlsFromStorage();
await this.setIcon();
@ -717,7 +721,7 @@ export default class MainBackground {
// Browser API Helpers
private contextMenusRemoveAll() {
return new Promise(resolve => {
return new Promise<void>(resolve => {
chrome.contextMenus.removeAll(() => {
resolve();
if (chrome.runtime.lastError) {
@ -728,7 +732,7 @@ export default class MainBackground {
}
private contextMenusCreate(options: any) {
return new Promise(resolve => {
return new Promise<void>(resolve => {
chrome.contextMenus.create(options, () => {
resolve();
if (chrome.runtime.lastError) {
@ -757,7 +761,7 @@ export default class MainBackground {
// which doesn't resolve within a reasonable time.
theAction.setIcon(options);
} else {
return new Promise(resolve => {
return new Promise<void>(resolve => {
theAction.setIcon(options, () => resolve());
});
}

View File

@ -25,6 +25,7 @@ import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service
import { EnvironmentService } from 'jslib/abstractions/environment.service';
import { EventService } from 'jslib/abstractions/event.service';
import { ExportService } from 'jslib/abstractions/export.service';
import { FileUploadService } from 'jslib/abstractions/fileUpload.service';
import { FolderService } from 'jslib/abstractions/folder.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
import { MessagingService } from 'jslib/abstractions/messaging.service';
@ -126,6 +127,7 @@ export function initFactory(platformUtilsService: PlatformUtilsService, i18nServ
{ provide: StateServiceAbstraction, useValue: stateService },
{ provide: SearchServiceAbstraction, useValue: searchService },
{ provide: AuditService, useFactory: getBgService<AuditService>('auditService'), deps: [] },
{ provide: FileUploadService, useFactory: getBgService<FileUploadService>('fileUploadService'), deps: [] },
{ provide: CipherService, useFactory: getBgService<CipherService>('cipherService'), deps: [] },
{
provide: CryptoFunctionService,

View File

@ -2,6 +2,7 @@ import { Location } from '@angular/common';
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ApiService } from 'jslib/abstractions/api.service';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { CryptoService } from 'jslib/abstractions/crypto.service';
import { I18nService } from 'jslib/abstractions/i18n.service';
@ -19,9 +20,9 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
constructor(cipherService: CipherService, i18nService: I18nService,
cryptoService: CryptoService, userService: UserService,
platformUtilsService: PlatformUtilsService, private location: Location,
platformUtilsService: PlatformUtilsService, apiService: ApiService, private location: Location,
private route: ActivatedRoute, private router: Router) {
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, window);
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService, window);
}
async ngOnInit() {