mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-17 00:33:35 +00:00
save on destroy
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
<form (ngSubmit)="submit()">
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@@ -203,8 +202,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button appBlurClick type="submit" class="btn btn-primary">
|
|
||||||
<i class="fa fa-save fa-fw"></i>
|
|
||||||
{{'save' | i18n}}
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
|
|||||||
@@ -1,14 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
ComponentFactoryResolver,
|
OnDestroy,
|
||||||
OnInit,
|
OnInit,
|
||||||
ViewChild,
|
|
||||||
ViewContainerRef,
|
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import { ToasterService } from 'angular2-toaster';
|
|
||||||
import { Angulartics2 } from 'angulartics2';
|
|
||||||
|
|
||||||
import { I18nService } from 'jslib/abstractions/i18n.service';
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
||||||
|
|
||||||
import { ConfigurationService } from '../../services/configuration.service';
|
import { ConfigurationService } from '../../services/configuration.service';
|
||||||
@@ -24,7 +19,7 @@ import { SyncConfiguration } from '../../models/syncConfiguration';
|
|||||||
selector: 'app-settings',
|
selector: 'app-settings',
|
||||||
templateUrl: 'settings.component.html',
|
templateUrl: 'settings.component.html',
|
||||||
})
|
})
|
||||||
export class SettingsComponent implements OnInit {
|
export class SettingsComponent implements OnInit, OnDestroy {
|
||||||
directory: DirectoryType;
|
directory: DirectoryType;
|
||||||
directoryType = DirectoryType;
|
directoryType = DirectoryType;
|
||||||
ldap = new LdapConfiguration();
|
ldap = new LdapConfiguration();
|
||||||
@@ -33,9 +28,7 @@ export class SettingsComponent implements OnInit {
|
|||||||
sync = new SyncConfiguration();
|
sync = new SyncConfiguration();
|
||||||
directoryOptions: any[];
|
directoryOptions: any[];
|
||||||
|
|
||||||
constructor(analytics: Angulartics2, toasterService: ToasterService,
|
constructor(private i18nService: I18nService, private configurationService: ConfigurationService) {
|
||||||
i18nService: I18nService, private componentFactoryResolver: ComponentFactoryResolver,
|
|
||||||
private configurationService: ConfigurationService) {
|
|
||||||
this.directoryOptions = [
|
this.directoryOptions = [
|
||||||
{ name: i18nService.t('select'), value: null },
|
{ name: i18nService.t('select'), value: null },
|
||||||
{ name: 'Active Directory / LDAP', value: DirectoryType.Ldap },
|
{ name: 'Active Directory / LDAP', value: DirectoryType.Ldap },
|
||||||
@@ -55,6 +48,10 @@ export class SettingsComponent implements OnInit {
|
|||||||
this.sync = (await this.configurationService.getSync()) || this.sync;
|
this.sync = (await this.configurationService.getSync()) || this.sync;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async ngOnDestroy() {
|
||||||
|
await this.submit();
|
||||||
|
}
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
if (this.ldap.ad) {
|
if (this.ldap.ad) {
|
||||||
this.sync.creationDateAttribute = 'whenCreated';
|
this.sync.creationDateAttribute = 'whenCreated';
|
||||||
|
|||||||
Reference in New Issue
Block a user