Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to create new credentials against an already-saved site #177

Merged
merged 4 commits into from
Nov 8, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/unit/search.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ describe('search method', () => {
},
expect.any(Function),
],
[
{
className: 'login',
textContent: '__KEY_createAnotherEntryButtonText__',
},
expect.any(Function),
],
]);

expect(global.sendNativeAppMessage.mock.calls).toEqual([[{ host: 'mih', type: 'queryHost' }]]);
Expand Down
4 changes: 4 additions & 0 deletions web-extension/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"message": "neuen Eintrag erstellen",
"description": "Text of create new entry button"
},
"createAnotherEntryButtonText": {
"message": "sie einen weiteren Eintrag erstellen",
Pharb marked this conversation as resolved.
Show resolved Hide resolved
"description": "Text of create another entry button"
},
"copiedToClipboardMessage": {
"message": "kopiert in die Zwischenablage",
"description": "Text to display when an entry was copied to clipboard"
Expand Down
4 changes: 4 additions & 0 deletions web-extension/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"message": "create new login entry",
"description": "Text of create new entry button"
},
"createAnotherEntryButtonText": {
"message": "create another login entry",
"description": "Text of create another entry button"
},
"copiedToClipboardMessage": {
"message": "copied to clipboard",
"description": "Text to display when an entry was copied to clipboard"
Expand Down
11 changes: 11 additions & 0 deletions web-extension/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,19 @@ function _displaySearchResults(response, isHostQuery) {

results.appendChild(entry);
});

results.appendChild(_createAnotherEntryButton());
}

const _createAnotherEntryButton = () =>
createButtonWithCallback(
{
className: 'login',
textContent: i18n.getMessage('createAnotherEntryButtonText'),
},
switchToCreateNewDialog
);

const _createSearchResultLoginButton = (item, isHostQuery) =>
createButtonWithCallback(
{
Expand Down