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' } },
list: { method: 'GET', 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' } }
});

View File

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

View File

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

View File

@ -13,7 +13,8 @@
for (var i = 0; i < sites.Data.length; i++) {
var decSite = {
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); }
@ -74,6 +75,7 @@
site[0].folderId = editedSite.folderId;
site[0].name = editedSite.name;
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="editSite(site)" class="btn btn-link btn-table" uib-tooltip="View/Edit"><i class="fa fa-lg fa-pencil"></i></button>
</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>
</tr>
</tbody>

View File

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

View File

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