diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index a07b1fd5ae..4b2159b8d0 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -765,5 +765,17 @@ }, "value": { "message": "Value" + }, + "newCustomField": { + "message": "New Custom Field" + }, + "cfTypeText": { + "message": "Text" + }, + "cfTypeHidden": { + "message": "Hidden" + }, + "cfTypeBoolean": { + "message": "Boolean" } } diff --git a/src/popup/app/vault/vaultAddLoginController.js b/src/popup/app/vault/vaultAddLoginController.js index e9994fa67f..e239fe0bab 100644 --- a/src/popup/app/vault/vaultAddLoginController.js +++ b/src/popup/app/vault/vaultAddLoginController.js @@ -2,8 +2,10 @@ .module('bit.vault') .controller('vaultAddLoginController', function ($scope, $state, $stateParams, loginService, folderService, - cryptoService, $q, toastr, utilsService, $analytics, i18nService) { + cryptoService, $q, toastr, utilsService, $analytics, i18nService, constantsService) { $scope.i18n = i18nService; + $scope.constants = constantsService; + $scope.addFieldType = constantsService.fieldType.text.toString(); var from = $stateParams.from, folderId = $stateParams.folderId; @@ -65,6 +67,25 @@ } }; + $scope.addField = function (type) { + if (!$scope.login.fields) { + $scope.login.fields = []; + } + + $scope.login.fields.push({ + type: parseInt(type), + name: null, + value: null + }); + }; + + $scope.removeField = function (field) { + var index = $scope.login.fields.indexOf(field); + if (index > -1) { + $scope.login.fields.splice(index, 1); + } + }; + $scope.generatePassword = function () { $analytics.eventTrack('Clicked Generate Password'); $state.go('passwordGenerator', { diff --git a/src/popup/app/vault/vaultEditLoginController.js b/src/popup/app/vault/vaultEditLoginController.js index 13dfa4f183..e6f709f05a 100644 --- a/src/popup/app/vault/vaultEditLoginController.js +++ b/src/popup/app/vault/vaultEditLoginController.js @@ -6,6 +6,7 @@ angular $scope.i18n = i18nService; $scope.constants = constantsService; $scope.showAttachments = !utilsService.isEdge(); + $scope.addFieldType = constantsService.fieldType.text.toString(); var loginId = $stateParams.loginId; var fromView = $stateParams.fromView; var from = $stateParams.from; @@ -94,6 +95,25 @@ angular } }; + $scope.addField = function (type) { + if (!$scope.login.fields) { + $scope.login.fields = []; + } + + $scope.login.fields.push({ + type: parseInt(type), + name: null, + value: null + }); + }; + + $scope.removeField = function (field) { + var index = $scope.login.fields.indexOf(field); + if (index > -1) { + $scope.login.fields.splice(index, 1); + } + }; + $scope.generatePassword = function () { if ($scope.login.password) { SweetAlert.swal({ diff --git a/src/popup/app/vault/views/vaultAddLogin.html b/src/popup/app/vault/views/vaultAddLogin.html index c6ae5c2bf7..6dfce6fc45 100644 --- a/src/popup/app/vault/views/vaultAddLogin.html +++ b/src/popup/app/vault/views/vaultAddLogin.html @@ -68,6 +68,45 @@ + +
+
+ {{i18n.customFields}} +
+
+
+ + + +
+ + + + +
+
+
+ + {{i18n.newCustomField}} + + +
+
+
diff --git a/src/popup/app/vault/views/vaultEditLogin.html b/src/popup/app/vault/views/vaultEditLogin.html index 9dab5ec02b..0e078ebc28 100644 --- a/src/popup/app/vault/views/vaultEditLogin.html +++ b/src/popup/app/vault/views/vaultEditLogin.html @@ -73,21 +73,41 @@ -
+
{{i18n.customFields}}
-
- - - - + + + +
+ + + + +
+
+
+ + {{i18n.newCustomField}} + +
diff --git a/src/popup/app/vault/views/vaultViewLogin.html b/src/popup/app/vault/views/vaultViewLogin.html index e8262b4e4c..6eae9ac15e 100644 --- a/src/popup/app/vault/views/vaultViewLogin.html +++ b/src/popup/app/vault/views/vaultViewLogin.html @@ -44,7 +44,7 @@ {{i18n.password}} - {{login.maskedPassword}} + {{login.maskedPassword}} {{login.password}}
@@ -96,7 +96,7 @@ {{field.value || ' '}}
- {{maskValue(field.value)}} + {{maskValue(field.value)}} {{field.value}}
diff --git a/src/popup/less/components.less b/src/popup/less/components.less index 2e5e108014..50a10465a3 100644 --- a/src/popup/less/components.less +++ b/src/popup/less/components.less @@ -318,6 +318,29 @@ display: block; width: 100%; font-weight: normal; + margin-bottom: 5px; + } + + &.list-section-item-table { + display: table; + width: 100%; + } + + .action-button { + padding: 8px 10px 8px 5px; + display: table-cell; + width: 20px; + vertical-align: middle; + } + + .action-button-content { + display: table-cell; + vertical-align: middle; + } + + .field-type { + margin: 5px 0 0 27px; + width: ~"calc(100% - 27px)"; } .btn-list { @@ -387,7 +410,7 @@ } &.list-section-item-checkbox, &.list-section-item-input, &.list-section-item-slider { - label { + label, .item-label { font-size: @font-size-base; color: @text-color; display: inline; diff --git a/src/services/apiService.js b/src/services/apiService.js index 72827f18b5..ac250f7c37 100644 --- a/src/services/apiService.js +++ b/src/services/apiService.js @@ -30,8 +30,8 @@ function initApiService() { } // Desktop - self.baseUrl = 'http://localhost:4000'; - self.identityBaseUrl = 'http://localhost:33656'; + //self.baseUrl = 'http://localhost:4000'; + //self.identityBaseUrl = 'http://localhost:33656'; // Desktop HTTPS //self.baseUrl = 'https://localhost:44377'; @@ -46,8 +46,8 @@ function initApiService() { //self.identityBaseUrl = 'https://preview-identity.bitwarden.com'; // Production - //self.baseUrl = 'https://api.bitwarden.com'; - //self.identityBaseUrl = 'https://identity.bitwarden.com'; + self.baseUrl = 'https://api.bitwarden.com'; + self.identityBaseUrl = 'https://identity.bitwarden.com'; }; // Auth APIs