1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-21 16:18:28 +01:00

Added new favorite flag to sites.

This commit is contained in:
Kyle Spearrin 2016-06-08 22:45:15 -04:00
parent 4cf404d9c3
commit 7005cee595
7 changed files with 21 additions and 2 deletions

View File

@ -25,6 +25,7 @@
get: { method: 'GET', params: { id: '@id' } }, get: { method: 'GET', params: { id: '@id' } },
list: { method: 'GET', params: {} }, list: { method: 'GET', params: {} },
'import': { url: _apiUri + '/ciphers/import', method: 'POST', params: {} }, 'import': { url: _apiUri + '/ciphers/import', method: 'POST', params: {} },
favorite: { url: _apiUri + '/ciphers/:id/favorite', method: 'PUT', params: { id: '@id' } },
del: { method: 'DELETE', params: { id: '@id' } } del: { method: 'DELETE', params: { id: '@id' } }
}); });

View File

@ -22,6 +22,7 @@ angular
id: encryptedSite.Id, id: encryptedSite.Id,
'type': 1, 'type': 1,
folderId: encryptedSite.FolderId, folderId: encryptedSite.FolderId,
favorite: encryptedSite.Favorite,
name: cryptoService.decrypt(encryptedSite.Name), name: cryptoService.decrypt(encryptedSite.Name),
uri: cryptoService.decrypt(encryptedSite.Uri), uri: cryptoService.decrypt(encryptedSite.Uri),
username: encryptedSite.Username && encryptedSite.Username !== '' ? cryptoService.decrypt(encryptedSite.Username) : null, username: encryptedSite.Username && encryptedSite.Username !== '' ? cryptoService.decrypt(encryptedSite.Username) : null,
@ -77,6 +78,7 @@ angular
id: unencryptedSite.id, id: unencryptedSite.id,
'type': 1, 'type': 1,
folderId: unencryptedSite.folderId === '' ? null : unencryptedSite.folderId, folderId: unencryptedSite.folderId === '' ? null : unencryptedSite.folderId,
favorite: unencryptedSite.favorite != null ? unencryptedSite.favorite : false,
uri: cryptoService.encrypt(unencryptedSite.uri, key), uri: cryptoService.encrypt(unencryptedSite.uri, key),
name: cryptoService.encrypt(unencryptedSite.name, key), name: cryptoService.encrypt(unencryptedSite.name, key),
username: !unencryptedSite.username || unencryptedSite.username === '' ? null : cryptoService.encrypt(unencryptedSite.username, key), username: !unencryptedSite.username || unencryptedSite.username === '' ? null : cryptoService.encrypt(unencryptedSite.username, key),

View File

@ -47,6 +47,7 @@
} }
sites.push({ sites.push({
favorite: value.favorite != null ? value.favorite : false,
uri: value.uri, uri: value.uri,
username: value.username && value.username !== '' ? value.username : null, username: value.username && value.username !== '' ? value.username : null,
password: value.password, password: value.password,
@ -103,6 +104,7 @@
} }
sites.push({ sites.push({
favorite: false,
uri: value.url, uri: value.url,
username: value.username && value.username !== '' ? value.username : null, username: value.username && value.username !== '' ? value.username : null,
password: value.password, password: value.password,

View File

@ -13,7 +13,8 @@
for (var i = 0; i < sites.Data.length; i++) { for (var i = 0; i < sites.Data.length; i++) {
var decSite = { var decSite = {
id: sites.Data[i].Id, id: sites.Data[i].Id,
folderId: sites.Data[i].FolderId folderId: sites.Data[i].FolderId,
favorite: sites.Data[i].Favorite
}; };
try { decSite.name = cryptoService.decrypt(sites.Data[i].Name); } try { decSite.name = cryptoService.decrypt(sites.Data[i].Name); }
@ -74,6 +75,7 @@
site[0].folderId = editedSite.folderId; site[0].folderId = editedSite.folderId;
site[0].name = editedSite.name; site[0].name = editedSite.name;
site[0].username = editedSite.username; site[0].username = editedSite.username;
site[0].favorite = editedSite.favorite;
} }
}); });
}; };

View File

@ -46,7 +46,7 @@
<button type="button" ng-click="deleteSite(site)" class="btn btn-link btn-table" uib-tooltip="Delete"><i class="fa fa-lg fa-trash"></i></button> <button type="button" ng-click="deleteSite(site)" class="btn btn-link btn-table" uib-tooltip="Delete"><i class="fa fa-lg fa-trash"></i></button>
<button type="button" ng-click="editSite(site)" class="btn btn-link btn-table" uib-tooltip="View/Edit"><i class="fa fa-lg fa-pencil"></i></button> <button type="button" ng-click="editSite(site)" class="btn btn-link btn-table" uib-tooltip="View/Edit"><i class="fa fa-lg fa-pencil"></i></button>
</td> </td>
<td>{{site.name}}</td> <td>{{site.name}} <i class="fa fa-star text-muted" uib-tooltip="Favorite" ng-show="site.favorite"></i></td>
<td>{{site.username}}</td> <td>{{site.username}}</td>
</tr> </tr>
</tbody> </tbody>

View File

@ -82,6 +82,12 @@
<label for="notes">Notes</label> <label for="notes">Notes</label>
<textarea id="notes" name="Notes" class="form-control" ng-model="site.notes" api-field></textarea> <textarea id="notes" name="Notes" class="form-control" ng-model="site.notes" api-field></textarea>
</div> </div>
<div class="checkbox">
<label>
<input type="checkbox" ng-model="site.favorite" name="Favorite" />
Favorite
</label>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="addSiteForm.$loading"> <button type="submit" class="btn btn-primary btn-flat" ng-disabled="addSiteForm.$loading">

View File

@ -85,6 +85,12 @@
<label for="notes">Notes</label> <label for="notes">Notes</label>
<textarea id="notes" name="Notes" class="form-control" ng-model="site.notes" api-field></textarea> <textarea id="notes" name="Notes" class="form-control" ng-model="site.notes" api-field></textarea>
</div> </div>
<div class="checkbox">
<label>
<input type="checkbox" ng-model="site.favorite" name="Favorite" />
Favorite
</label>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="editSiteForm.$loading"> <button type="submit" class="btn btn-primary btn-flat" ng-disabled="editSiteForm.$loading">