Skip to content

Commit

Permalink
Use webfonts from jslib instead of downloading them using gulp (bitwa…
Browse files Browse the repository at this point in the history
…rden#157)

* Use webfonts from jslib instead of downloading them using gulp

* Bump jslib
  • Loading branch information
Hinton authored Sep 24, 2021
1 parent 9ad683c commit baa441c
Show file tree
Hide file tree
Showing 14 changed files with 8,853 additions and 13,363 deletions.
25 changes: 0 additions & 25 deletions gulpfile.js

This file was deleted.

2 changes: 1 addition & 1 deletion jslib
Submodule jslib updated 95 files
+76 −0 angular/src/components/add-edit-custom-fields.component.ts
+6 −58 angular/src/components/add-edit.component.ts
+1 −1 angular/src/components/attachments.component.ts
+19 −0 angular/src/components/callout.component.html
+28 −0 angular/src/components/callout.component.ts
+0 −20 angular/src/components/change-password.component.ts
+19 −3 angular/src/components/export.component.ts
+4 −0 angular/src/components/icon.component.ts
+10 −2 angular/src/components/login.component.ts
+0 −78 angular/src/components/modal.component.ts
+58 −0 angular/src/components/modal/dynamic-modal.component.ts
+15 −0 angular/src/components/modal/modal-injector.ts
+51 −0 angular/src/components/modal/modal.ref.ts
+30 −0 angular/src/components/password-reprompt.component.ts
+3 −19 angular/src/components/send/add-edit.component.ts
+2 −1 angular/src/components/send/efflux-dates.component.ts
+1 −9 angular/src/components/send/send.component.ts
+64 −21 angular/src/components/set-password.component.ts
+49 −0 angular/src/components/set-pin.component.ts
+138 −0 angular/src/components/settings/vault-timeout-input.component.ts
+8 −0 angular/src/components/sso.component.ts
+11 −6 angular/src/components/two-factor.component.ts
+35 −0 angular/src/components/view-custom-fields.component.ts
+0 −12 angular/src/components/view.component.ts
+2 −1 angular/src/directives/api-action.directive.ts
+90 −0 angular/src/scss/webfonts.css
+ angular/src/scss/webfonts/Open_Sans-italic-300.woff
+ angular/src/scss/webfonts/Open_Sans-italic-400.woff
+ angular/src/scss/webfonts/Open_Sans-italic-600.woff
+ angular/src/scss/webfonts/Open_Sans-italic-700.woff
+ angular/src/scss/webfonts/Open_Sans-italic-800.woff
+ angular/src/scss/webfonts/Open_Sans-normal-300.woff
+ angular/src/scss/webfonts/Open_Sans-normal-400.woff
+ angular/src/scss/webfonts/Open_Sans-normal-600.woff
+ angular/src/scss/webfonts/Open_Sans-normal-700.woff
+ angular/src/scss/webfonts/Open_Sans-normal-800.woff
+149 −0 angular/src/services/modal.service.ts
+28 −0 angular/src/services/passwordReprompt.service.ts
+4 −0 common/src/abstractions/api.service.ts
+1 −1 common/src/abstractions/auth.service.ts
+5 −0 common/src/abstractions/environment.service.ts
+0 −24 common/src/abstractions/index.ts
+0 −5 common/src/abstractions/platformUtils.service.ts
+4 −2 common/src/abstractions/policy.service.ts
+5 −1 common/src/abstractions/token.service.ts
+1 −0 common/src/abstractions/user.service.ts
+1 −0 common/src/abstractions/vaultTimeout.service.ts
+1 −0 common/src/enums/eventType.ts
+0 −8 common/src/enums/index.ts
+2 −0 common/src/enums/policyType.ts
+1 −1 common/src/importers/onepasswordImporters/cipherImportContext.ts
+1 −1 common/src/importers/onepasswordImporters/onepasswordCsvImporter.ts
+3 −1 common/src/importers/onepasswordImporters/onepasswordMacCsvImporter.ts
+4 −1 common/src/importers/onepasswordImporters/onepasswordWinCsvImporter.ts
+3 −2 common/src/importers/safeInCloudXmlImporter.ts
+1 −1 common/src/importers/zohoVaultCsvImporter.ts
+0 −10 common/src/index.ts
+70 −9 common/src/misc/webauthn_iframe.ts
+0 −10 common/src/models/data/index.ts
+1 −0 common/src/models/domain/authResult.ts
+0 −16 common/src/models/domain/index.ts
+5 −1 common/src/models/domain/organization.ts
+1 −1 common/src/models/domain/sortedCiphersCache.ts
+0 −8 common/src/models/request/index.ts
+1 −0 common/src/models/request/organizationCreateRequest.ts
+3 −0 common/src/models/request/organizationSubscriptionUpdateRequest.ts
+11 −0 common/src/models/request/setPasswordRequest.ts
+2 −0 common/src/models/response/identityTokenResponse.ts
+0 −15 common/src/models/response/index.ts
+12 −0 common/src/models/response/organizationAutoEnrollStatusResponse.ts
+2 −0 common/src/models/response/organizationResponse.ts
+1 −1 common/src/models/response/profileResponse.ts
+0 −9 common/src/models/view/index.ts
+41 −4 common/src/services/api.service.ts
+5 −4 common/src/services/auth.service.ts
+2 −0 common/src/services/constants.service.ts
+1 −0 common/src/services/i18n.service.ts
+0 −20 common/src/services/index.ts
+0 −24 common/src/services/passwordReprompt.service.ts
+28 −0 common/src/services/policy.service.ts
+58 −15 common/src/services/token.service.ts
+9 −0 common/src/services/user.service.ts
+27 −7 common/src/services/vaultTimeout.service.ts
+5 −3 electron/src/biometric.darwin.main.ts
+0 −1 electron/src/electronConstants.ts
+0 −9 electron/src/services/electronPlatformUtils.service.ts
+76 −29 node/src/cli/commands/login.command.ts
+13 −0 node/src/cli/models/response/fileResponse.ts
+0 −9 node/src/cli/services/cliPlatformUtils.service.ts
+2 −1 node/src/services/nodeApi.service.ts
+2 −1 spec/common/importers/lastpassCsvImporter.spec.ts
+4 −2 spec/common/importers/nordpassCsvImporter.spec.ts
+1 −1 spec/common/importers/onepasswordMacCsvImporter.spec.ts
+2 −1 spec/common/importers/onepasswordWinCsvImporter.spec.ts
+1 −1 spec/web/services/webCryptoFunction.service.spec.ts
22,127 changes: 8,832 additions & 13,295 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"lint:fix": "tslint 'src/**/*.ts' --fix",
"build": "concurrently -n Main,Rend -c yellow,cyan \"npm run build:main\" \"npm run build:renderer\"",
"build:main": "webpack --config webpack.main.js",
"build:renderer": "gulp prebuild:renderer && webpack --config webpack.renderer.js",
"build:renderer:watch": "gulp prebuild:renderer && webpack --config webpack.renderer.js --watch",
"build:renderer": "webpack --config webpack.renderer.js",
"build:renderer:watch": "webpack --config webpack.renderer.js --watch",
"build:dist": "npm run reset && npm run rebuild && npm run build",
"build:cli": "webpack --config webpack.cli.js",
"build:cli:watch": "webpack --config webpack.cli.js --watch",
Expand Down Expand Up @@ -150,8 +150,6 @@
"electron-reload": "^1.5.0",
"file-loader": "^6.2.0",
"font-awesome": "4.7.0",
"gulp": "^4.0.2",
"gulp-google-webfonts": "^4.0.0",
"html-loader": "^1.3.2",
"html-webpack-plugin": "^4.5.1",
"mini-css-extract-plugin": "^1.5.0",
Expand Down
15 changes: 7 additions & 8 deletions src/app/accounts/apiKey.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { AuthService } from 'jslib-common/abstractions/auth.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';

import { ModalComponent } from 'jslib-angular/components/modal.component';
import { ModalService } from 'jslib-angular/services/modal.service';

import { Utils } from 'jslib-common/misc/utils';
import { ConfigurationService } from '../../services/configuration.service';

Expand All @@ -33,7 +34,8 @@ export class ApiKeyComponent {

constructor(private authService: AuthService, private apiKeyService: ApiKeyService, private router: Router,
private i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
private configurationService: ConfigurationService, private platformUtilsService: PlatformUtilsService) { }
private configurationService: ConfigurationService, private platformUtilsService: PlatformUtilsService,
private modalService: ModalService) { }

async submit() {
if (this.clientId == null || this.clientId === '') {
Expand Down Expand Up @@ -68,14 +70,11 @@ export class ApiKeyComponent {
} catch { }
}

settings() {
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
const modal = this.environmentModal.createComponent(factory).instance;
const childComponent = modal.show<EnvironmentComponent>(EnvironmentComponent,
this.environmentModal);
async settings() {
const [modalRef, childComponent] = await this.modalService.openViewRef(EnvironmentComponent, this.environmentModal);

childComponent.onSaved.subscribe(() => {
modal.close();
modalRef.close();
});
}
toggleSecret() {
Expand Down
17 changes: 0 additions & 17 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import {
import { DomSanitizer } from '@angular/platform-browser';
import { Router } from '@angular/router';

import { ModalComponent } from 'jslib-angular/components/modal.component';

import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';

import { ApiService } from 'jslib-common/abstractions/api.service';
Expand Down Expand Up @@ -56,7 +54,6 @@ export class AppComponent implements OnInit {
});

private lastActivity: number = null;
private modal: ModalComponent = null;

constructor(private broadcasterService: BroadcasterService, private userService: UserService,
private tokenService: TokenService, private storageService: StorageService,
Expand Down Expand Up @@ -146,20 +143,6 @@ export class AppComponent implements OnInit {
});
}

private openModal<T>(type: Type<T>, ref: ViewContainerRef) {
if (this.modal != null) {
this.modal.close();
}

const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
this.modal = ref.createComponent(factory).instance;
const childComponent = this.modal.show<T>(type, ref);

this.modal.onClosed.subscribe(() => {
this.modal = null;
});
}

private showToast(msg: any) {
const toast: Toast = {
type: msg.type,
Expand Down
6 changes: 0 additions & 6 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { AppComponent } from './app.component';

import { CalloutComponent } from 'jslib-angular/components/callout.component';
import { IconComponent } from 'jslib-angular/components/icon.component';
import { ModalComponent } from 'jslib-angular/components/modal.component';

import { ApiKeyComponent } from './accounts/apiKey.component';
import { EnvironmentComponent } from './accounts/environment.component';
Expand Down Expand Up @@ -59,18 +58,13 @@ import { SearchCiphersPipe } from 'jslib-angular/pipes/search-ciphers.pipe';
FallbackSrcDirective,
I18nPipe,
IconComponent,
ModalComponent,
MoreComponent,
SearchCiphersPipe,
SettingsComponent,
StopClickDirective,
StopPropDirective,
TabsComponent,
],
entryComponents: [
EnvironmentComponent,
ModalComponent,
],
providers: [],
bootstrap: [AppComponent],
})
Expand Down
2 changes: 2 additions & 0 deletions src/app/services/services.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { I18nService } from '../../services/i18n.service';
import { SyncService } from '../../services/sync.service';

import { BroadcasterService } from 'jslib-angular/services/broadcaster.service';
import { ModalService } from 'jslib-angular/services/modal.service';
import { ValidationService } from 'jslib-angular/services/validation.service';

import { ApiKeyService } from 'jslib-common/services/apiKey.service';
Expand Down Expand Up @@ -131,6 +132,7 @@ export function initFactory(): Function {
ValidationService,
AuthGuardService,
LaunchGuardService,
ModalService,
{ provide: AuthServiceAbstraction, useValue: authService },
{ provide: EnvironmentServiceAbstraction, useValue: environmentService },
{ provide: TokenServiceAbstraction, useValue: tokenService },
Expand Down
5 changes: 4 additions & 1 deletion src/bwdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ export class Main {
this.messagingService = new NoopMessagingService();
this.environmentService = new EnvironmentService(this.storageService);
this.apiService = new NodeApiService(this.tokenService, this.platformUtilsService, this.environmentService,
() => refreshToken(this.apiKeyService, this.authService), async (expired: boolean) => await this.logout());
() => refreshToken(this.apiKeyService, this.authService), async (expired: boolean) => await this.logout(),
'Bitwarden_DC/' + this.platformUtilsService.getApplicationVersion() +
' (' + this.platformUtilsService.getDeviceString().toUpperCase() + ')', (clientId, clientSecret) =>
this.authService.logInApiKey(clientId, clientSecret));
this.apiKeyService = new ApiKeyService(this.tokenService, this.storageService);
this.userService = new UserService(this.tokenService, this.storageService);
this.containerService = new ContainerService(this.cryptoService);
Expand Down
2 changes: 1 addition & 1 deletion src/scss/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "../css/webfonts.css";
@import "../../jslib/angular/src/scss/webfonts.css";
@import "bootstrap.scss";
@import "pages.scss";
@import "misc.scss";
Expand Down
2 changes: 1 addition & 1 deletion src/services/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { VaultTimeoutService } from 'jslib-common/abstractions/vaultTimeout.serv

import { AuthService as AuthServiceBase } from 'jslib-common/services/auth.service';

import { AuthResult } from 'jslib-common/models/domain';
import { AuthResult } from 'jslib-common/models/domain/authResult';
import { DeviceRequest } from 'jslib-common/models/request/deviceRequest';
import { TokenRequest } from 'jslib-common/models/request/tokenRequest';
import { IdentityTokenResponse } from 'jslib-common/models/response/identityTokenResponse';
Expand Down
2 changes: 1 addition & 1 deletion src/services/azure-directory.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export class AzureDirectoryService extends BaseDirectoryService implements IDire
console.error(d.error_description);
done(err, null);
} else {
const err = new Error('Unknown error (' + res.statusCode + ').')
const err = new Error('Unknown error (' + res.statusCode + ').');
done(err, null);
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/services/nodeApi.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { NodeApiService as NodeApiServiceBase } from 'jslib-node/services/nodeAp
export class NodeApiService extends NodeApiServiceBase {
constructor(tokenService: TokenService, platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
private refreshTokenCallback: () => Promise<void>, logoutCallback: (expired: boolean) => Promise<void>,
customUserAgent: string = null) {
super(tokenService, platformUtilsService, environmentService, logoutCallback, customUserAgent);
customUserAgent: string = null, apiKeyRefresh: (clientId: string, clientSecret: string) => Promise<any>) {
super(tokenService, platformUtilsService, environmentService, logoutCallback, customUserAgent, apiKeyRefresh);
}

doRefreshToken(): Promise<void> {
Expand Down
1 change: 0 additions & 1 deletion webfonts.list

This file was deleted.

0 comments on commit baa441c

Please sign in to comment.