more fixes
This commit is contained in:
parent
176b9a8ed0
commit
fd146afb69
|
@ -1,5 +1,5 @@
|
||||||
var CipherRequest = function (cipher, type) {
|
var CipherRequest = function (cipher) {
|
||||||
this.type = type;
|
this.type = cipher.type;
|
||||||
this.folderId = cipher.folderId;
|
this.folderId = cipher.folderId;
|
||||||
this.organizationId = cipher.organizationId;
|
this.organizationId = cipher.organizationId;
|
||||||
this.name = cipher.name ? cipher.name.encryptedString : null;
|
this.name = cipher.name ? cipher.name.encryptedString : null;
|
||||||
|
@ -7,7 +7,7 @@
|
||||||
this.favorite = cipher.favorite;
|
this.favorite = cipher.favorite;
|
||||||
|
|
||||||
var constantsService = chrome.extension.getBackgroundPage().bg_constantsService;
|
var constantsService = chrome.extension.getBackgroundPage().bg_constantsService;
|
||||||
switch (type) {
|
switch (this.type) {
|
||||||
case constantsService.cipherType.login:
|
case constantsService.cipherType.login:
|
||||||
this.login = {
|
this.login = {
|
||||||
uri: cipher.login.uri ? cipher.login.uri.encryptedString : null,
|
uri: cipher.login.uri ? cipher.login.uri.encryptedString : null,
|
||||||
|
|
|
@ -420,15 +420,33 @@ function buildDomainModel(model, obj, map, alreadyEncrypted, notEncList) {
|
||||||
break;
|
break;
|
||||||
case self.constantsService.cipherType.secureNote:
|
case self.constantsService.cipherType.secureNote:
|
||||||
model.secureNote = decObj;
|
model.secureNote = decObj;
|
||||||
model.subTitle = '-';
|
model.subTitle = null;
|
||||||
break;
|
break;
|
||||||
case self.constantsService.cipherType.card:
|
case self.constantsService.cipherType.card:
|
||||||
model.card = decObj;
|
model.card = decObj;
|
||||||
model.subTitle = model.identity.brand;
|
model.subTitle = model.card.brand;
|
||||||
|
if (model.card.brand) {
|
||||||
|
model.subTitle = model.card.brand;
|
||||||
|
}
|
||||||
|
if (model.card.number && model.card.number.length >= 4) {
|
||||||
|
if (model.subTitle !== '') {
|
||||||
|
model.subTitle += ', ';
|
||||||
|
}
|
||||||
|
model.subTitle += ('*' + model.card.number.substr(model.card.number.length - 4));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case self.constantsService.cipherType.identity:
|
case self.constantsService.cipherType.identity:
|
||||||
model.identity = decObj;
|
model.identity = decObj;
|
||||||
|
model.subTitle = '';
|
||||||
|
if (model.identity.firstName) {
|
||||||
model.subTitle = model.identity.firstName;
|
model.subTitle = model.identity.firstName;
|
||||||
|
}
|
||||||
|
if (model.identity.lastName) {
|
||||||
|
if (model.subTitle !== '') {
|
||||||
|
model.subTitle += ' ';
|
||||||
|
}
|
||||||
|
model.subTitle += model.identity.lastName;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -314,8 +314,7 @@ function initLoginService() {
|
||||||
var deferred = Q.defer();
|
var deferred = Q.defer();
|
||||||
|
|
||||||
var self = this,
|
var self = this,
|
||||||
// TODO
|
request = new CipherRequest(cipher);
|
||||||
request = new CipherRequest(cipher, 1); // 1 = Login
|
|
||||||
|
|
||||||
if (!cipher.id) {
|
if (!cipher.id) {
|
||||||
self.apiService.postCipher(request).then(apiSuccess, function (response) {
|
self.apiService.postCipher(request).then(apiSuccess, function (response) {
|
||||||
|
|
Loading…
Reference in New Issue