1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-15 15:53:41 +00:00

Use webfonts from jslib instead of downloading them using gulp (#157)

* Use webfonts from jslib instead of downloading them using gulp

* Bump jslib
This commit is contained in:
Oscar Hinton
2021-09-24 18:23:33 +02:00
committed by GitHub
parent 9ad683ca09
commit baa441cb90
14 changed files with 3281 additions and 7791 deletions

View File

@@ -1,25 +0,0 @@
const gulp = require('gulp');
const googleWebFonts = require('gulp-google-webfonts');
const del = require('del');
const paths = {
cssDir: './src/css/',
};
function clean() {
return del([paths.cssDir]);
}
function webfonts() {
return gulp.src('./webfonts.list')
.pipe(googleWebFonts({
fontsDir: 'webfonts',
cssFilename: 'webfonts.css',
format: 'woff',
}))
.pipe(gulp.dest(paths.cssDir));
}
exports.clean = clean;
exports.webfonts = gulp.series(clean, webfonts);
exports['prebuild:renderer'] = webfonts;;

2
jslib

Submodule jslib updated: c70c8ecc24...2c892eb3a2

10983
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -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",
@@ -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",

View File

@@ -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';
@@ -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 === '') {
@@ -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() {

View File

@@ -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';
@@ -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,
@@ -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,

View File

@@ -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';
@@ -59,7 +58,6 @@ import { SearchCiphersPipe } from 'jslib-angular/pipes/search-ciphers.pipe';
FallbackSrcDirective,
I18nPipe,
IconComponent,
ModalComponent,
MoreComponent,
SearchCiphersPipe,
SettingsComponent,
@@ -67,10 +65,6 @@ import { SearchCiphersPipe } from 'jslib-angular/pipes/search-ciphers.pipe';
StopPropDirective,
TabsComponent,
],
entryComponents: [
EnvironmentComponent,
ModalComponent,
],
providers: [],
bootstrap: [AppComponent],
})

View File

@@ -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';
@@ -131,6 +132,7 @@ export function initFactory(): Function {
ValidationService,
AuthGuardService,
LaunchGuardService,
ModalService,
{ provide: AuthServiceAbstraction, useValue: authService },
{ provide: EnvironmentServiceAbstraction, useValue: environmentService },
{ provide: TokenServiceAbstraction, useValue: tokenService },

View File

@@ -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);

View File

@@ -1,4 +1,4 @@
@import "../css/webfonts.css";
@import "../../jslib/angular/src/scss/webfonts.css";
@import "bootstrap.scss";
@import "pages.scss";
@import "misc.scss";

View File

@@ -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';

View File

@@ -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);
}
});

View File

@@ -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> {

View File

@@ -1 +0,0 @@
Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext