passbolt-styleguide 5.17.0 → 5.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RELEASE_NOTES.md +5 -2
- package/build/css/help.min.css +2 -2
- package/build/css/public.min.css +2 -2
- package/build/css/themes/default/api_authentication.min.css +2 -2
- package/build/css/themes/default/api_cloud.min.css +2 -2
- package/build/css/themes/default/api_main.min.css +2 -2
- package/build/css/themes/default/api_reports.min.css +2 -2
- package/build/css/themes/default/api_webinstaller.min.css +2 -2
- package/build/css/themes/default/ext_app.min.css +2 -2
- package/build/css/themes/default/ext_authentication.min.css +2 -2
- package/build/css/themes/default/ext_external.min.css +2 -2
- package/build/css/themes/default/ext_in_form_cta.min.css +2 -2
- package/build/css/themes/default/ext_in_form_menu.min.css +2 -2
- package/build/css/themes/default/ext_quickaccess.min.css +2 -2
- package/build/css/themes/midgar/api_authentication.min.css +2 -2
- package/build/css/themes/midgar/api_main.min.css +2 -2
- package/build/css/themes/midgar/api_reports.min.css +2 -2
- package/build/css/themes/midgar/ext_app.min.css +2 -2
- package/build/css/themes/midgar/ext_authentication.min.css +2 -2
- package/build/css/themes/midgar/ext_in_form_cta.min.css +2 -2
- package/build/css/themes/midgar/ext_in_form_menu.min.css +2 -2
- package/build/css/themes/midgar/ext_quickaccess.min.css +2 -2
- package/build/css/themes/solarized_dark/api_authentication.min.css +2 -2
- package/build/css/themes/solarized_dark/api_main.min.css +2 -2
- package/build/css/themes/solarized_dark/api_reports.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_app.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_authentication.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_in_form_cta.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_in_form_menu.min.css +2 -2
- package/build/css/themes/solarized_dark/ext_quickaccess.min.css +2 -2
- package/build/css/themes/solarized_light/api_authentication.min.css +2 -2
- package/build/css/themes/solarized_light/api_main.min.css +2 -2
- package/build/css/themes/solarized_light/api_reports.min.css +2 -2
- package/build/css/themes/solarized_light/ext_app.min.css +2 -2
- package/build/css/themes/solarized_light/ext_authentication.min.css +2 -2
- package/build/css/themes/solarized_light/ext_in_form_cta.min.css +2 -2
- package/build/css/themes/solarized_light/ext_in_form_menu.min.css +2 -2
- package/build/css/themes/solarized_light/ext_quickaccess.min.css +2 -2
- package/package.json +1 -1
- package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.js +14 -4
- package/src/react-quickaccess/components/ResourceCreatePage/ResourceCreatePage.test.js +26 -2
- package/src/react-quickaccess/contexts/ExtQuickAccessContext.js +0 -14
package/RELEASE_NOTES.md
CHANGED
package/build/css/help.min.css
CHANGED
package/build/css/public.min.css
CHANGED
package/package.json
CHANGED
|
@@ -45,6 +45,18 @@ import CloseSVG from "../../../img/svg/close.svg";
|
|
|
45
45
|
import DiceSVG from "../../../img/svg/dice.svg";
|
|
46
46
|
import SettingsSVG from "../../../img/svg/settings.svg";
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Tab names that should not be used to prefill the resource name.
|
|
50
|
+
* @type {Array<string>}
|
|
51
|
+
*/
|
|
52
|
+
const IGNORE_NAMES = ["newtab"];
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Tab URIs that should not be used to prefill the resource uri (browsers new tab pages).
|
|
56
|
+
* @type {Array<string>}
|
|
57
|
+
*/
|
|
58
|
+
const IGNORE_URIS = ["chrome://newtab/", "about:newtab", "edge://newtab/"];
|
|
59
|
+
|
|
48
60
|
class ResourceCreatePage extends React.Component {
|
|
49
61
|
/**
|
|
50
62
|
* @constructor
|
|
@@ -205,8 +217,6 @@ class ResourceCreatePage extends React.Component {
|
|
|
205
217
|
let uri = "";
|
|
206
218
|
let username = "";
|
|
207
219
|
let password = "";
|
|
208
|
-
const ignoreNames = ["newtab"];
|
|
209
|
-
const ignoreUris = ["chrome://newtab/", "about:newtab"];
|
|
210
220
|
|
|
211
221
|
try {
|
|
212
222
|
const tabInfo = await this.props.context.port.request(
|
|
@@ -214,11 +224,11 @@ class ResourceCreatePage extends React.Component {
|
|
|
214
224
|
this.props.context.openerTabId,
|
|
215
225
|
);
|
|
216
226
|
|
|
217
|
-
if (!
|
|
227
|
+
if (!IGNORE_NAMES.includes(tabInfo["name"])) {
|
|
218
228
|
name = tabInfo["name"].substring(0, 255);
|
|
219
229
|
}
|
|
220
230
|
|
|
221
|
-
if (
|
|
231
|
+
if (tabInfo["uris"].length > 0 && !IGNORE_URIS.includes(tabInfo["uris"][0])) {
|
|
222
232
|
uri = tabInfo["uris"][0];
|
|
223
233
|
}
|
|
224
234
|
|
|
@@ -77,28 +77,52 @@ describe("ResourceCreatePage", () => {
|
|
|
77
77
|
const expectedData = {
|
|
78
78
|
name: "newtab",
|
|
79
79
|
uris: ["chrome://newtab/"],
|
|
80
|
+
secret_clear: "AAAAAAAAAAAAAAAAAA",
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
const props = defaultProps();
|
|
83
84
|
props.context.port.addRequestListener("passbolt.quickaccess.prepare-resource", async () => expectedData);
|
|
84
85
|
const page = new ResourceCreatePagePage(props);
|
|
85
|
-
|
|
86
|
+
// Wait until the username input value is found (This will ensure the state has been updated with the tab info)
|
|
87
|
+
await screen.findByDisplayValue(props.context.userSettings.username);
|
|
86
88
|
|
|
87
89
|
// Assert the form.
|
|
88
90
|
expect(page.name.value).toStrictEqual("");
|
|
89
91
|
expect(page.uri.value).toStrictEqual("");
|
|
90
92
|
});
|
|
91
93
|
|
|
94
|
+
it("should not initialize with edge new tab metadata", async () => {
|
|
95
|
+
expect.assertions(2);
|
|
96
|
+
|
|
97
|
+
const expectedData = {
|
|
98
|
+
name: "New tab",
|
|
99
|
+
uris: ["edge://newtab/"],
|
|
100
|
+
secret_clear: "AAAAAAAAAAAAAAAAAA",
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const props = defaultProps();
|
|
104
|
+
props.context.port.addRequestListener("passbolt.quickaccess.prepare-resource", async () => expectedData);
|
|
105
|
+
const page = new ResourceCreatePagePage(props);
|
|
106
|
+
// Wait until the username input value is found (This will ensure the state has been updated with the tab info)
|
|
107
|
+
await screen.findByDisplayValue(props.context.userSettings.username);
|
|
108
|
+
|
|
109
|
+
// Assert the form.
|
|
110
|
+
expect(page.name.value).toStrictEqual("New tab");
|
|
111
|
+
expect(page.uri.value).toStrictEqual("");
|
|
112
|
+
});
|
|
113
|
+
|
|
92
114
|
it("should not initialize with firefox new tab metadata", async () => {
|
|
93
115
|
const expectedData = {
|
|
94
116
|
name: "",
|
|
95
117
|
uris: ["about:newtab"],
|
|
118
|
+
secret_clear: "AAAAAAAAAAAAAAAAAA",
|
|
96
119
|
};
|
|
97
120
|
|
|
98
121
|
const props = defaultProps();
|
|
99
122
|
props.context.port.addRequestListener("passbolt.quickaccess.prepare-resource", async () => expectedData);
|
|
100
123
|
const page = new ResourceCreatePagePage(props);
|
|
101
|
-
|
|
124
|
+
// Wait until the username input value is found (This will ensure the state has been updated with the tab info)
|
|
125
|
+
await screen.findByDisplayValue(props.context.userSettings.username);
|
|
102
126
|
|
|
103
127
|
// Assert the form.
|
|
104
128
|
expect(page.name.value).toStrictEqual("");
|
|
@@ -55,7 +55,6 @@ export class ExtQuickAccessContextProvider extends React.Component {
|
|
|
55
55
|
*/
|
|
56
56
|
async initialize() {
|
|
57
57
|
try {
|
|
58
|
-
await this.checkPluginIsConfigured();
|
|
59
58
|
await this.props.activeSessionLocalStorageContext.updateLocalStorage();
|
|
60
59
|
await this.getUserSettings();
|
|
61
60
|
await this.getLocale();
|
|
@@ -198,19 +197,6 @@ export class ExtQuickAccessContextProvider extends React.Component {
|
|
|
198
197
|
this.setState({ shouldCloseAtWindowBlur });
|
|
199
198
|
}
|
|
200
199
|
|
|
201
|
-
/**
|
|
202
|
-
* Check if plugin is configured
|
|
203
|
-
* - not configured will redirect to getting started passbolt page and close quickaccess
|
|
204
|
-
* @return {Promise<void>}
|
|
205
|
-
*/
|
|
206
|
-
async checkPluginIsConfigured() {
|
|
207
|
-
const isConfigured = await this.state.port.request("passbolt.addon.is-configured");
|
|
208
|
-
if (!isConfigured) {
|
|
209
|
-
await this.props.state.request("passbolt.tabs.open-website-getting-started-page");
|
|
210
|
-
await this.closeWindow();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
200
|
/**
|
|
215
201
|
* Update search
|
|
216
202
|
* @param search
|