passbolt-styleguide
Version:
Passbolt styleguide contains common styling assets used by the different sites, plugin, etc.
134 lines (130 loc) โข 4.69 kB
JavaScript
import MockPort from "../../../test/mock/MockPort";
import UserSettings from "../../../../shared/lib/Settings/UserSettings";
import userSettingsFixture from "../../../test/fixture/Settings/userSettings";
import SiteSettings from "../../../../shared/lib/Settings/SiteSettings";
import siteSettingsFixture from "../../../test/fixture/Settings/siteSettings";
import ResourceTypesSettings from "../../../../shared/lib/Settings/ResourceTypesSettings";
import resourceTypesFixture from "../../../test/fixture/ResourceTypes/resourceTypes";
/**
* Default props
* @returns {}
*/
export function defaultProps() {
const port = new MockPort();
port.addRequestListener("passbolt.secret.decrypt", () => "secret-decrypted");
const userSettings = new UserSettings(userSettingsFixture);
const siteSettings = new SiteSettings(siteSettingsFixture);
const resourceTypesSettings = new ResourceTypesSettings(siteSettings, resourceTypesFixture);
const resources = [mockResource];
return {
context: {
userSettings,
siteSettings,
resourceTypesSettings,
port,
setContext: function(newContext) {
// In this scope this reference the object context.
Object.assign(this, newContext);
},
resources,
passwordEditDialogProps: {
id: mockResource.id
}
},
resourcePasswordGeneratorContext: {
settings: {
"default_generator": "passphrase",
"generators": [
{
"name": "Password",
"type": "password",
"default_options": {
"length": 18,
"look_alike": true,
"min_length": 8,
"max_length": 128,
},
"masks": [
{
"name": "upper",
"label": "A-Z",
"characters": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
},
{
"name": "lower",
"label": "a-z",
"characters": "abcdefghijklmnopqrstuvwxyz",
},
{
"name": "digit",
"label": "0-9",
"characters": "0123456789",
"required": true,
},
{
"name": "parenthesis",
"label": "{ [ ( | ) ] ] }",
"characters": "([|])",
},
{
"name": "special_char1",
"label": "# $ % & @ ^ ~",
"characters": "#$%&@^~"
},
{
"name": "special_char2",
"label": ". , : ;",
"characters": ".,:;"
},
{
"name": "special_char5",
"label": "< * + ! ? =",
"characters": "<*+!?="
},
{
"name": "emoji",
"label": "๐",
"characters": "๐๐๐๐๐๐
๐๐คฃ๐ฅฒโบ๏ธ๐๐๐๐๐๐๐๐ฅฐ๐๐๐๐๐๐๐๐๐คช๐คจ๐ง๐ค๐๐ฅธ๐คฉ๐ฅณ๐๐๐๐๐๐๐โน๏ธ๐ฃ๐๐ซ๐ฉ๐ฅบ๐ข๐ญ๐ค๐ ๐ก๐คฌ๐คฏ๐ณ๐ฅต๐ฅถ๐ฑ๐จ๐ฐ๐ฅ๐๐ค๐ค๐คญ๐คซ๐คฅ๐ถ๐๐๐ฌ๐๐ฏ๐ฆ๐ง๐ฎ๐ฒ๐ฅฑ๐ด๐คค๐ช๐ต๐ค๐ฅด๐คข๐คฎ๐คง๐ท๐ค๐ค๐ค๐ค ๐๐ฟ๐น๐บ๐คก๐ฉ๐ป๐โ ๏ธ๐ฝ๐พ๐ค๐๐บ๐ธ๐น๐ป๐ผ๐ฝ๐๐ฟ๐พ"
},
{
"name": "ascii",
"label": "ascii",
"characters": "%&ยกยขยฃยคยฅยฆยงยจยฉยชยซยฌยฎยฏยฐยฑยฒยณยตยถยทยธยนยบยปยผยฝยพยฟรร รรร
รรรรรรรรรรรรรรรรรรรรรรรรรรร รกรขรฃรครฅรฆรงรจรฉรชรซรฌรญรฎรฏรฐรฑรฒรณรดรตรถรทรธรนรบรปรผรฝรพรฟลลล ลกลธฦโโโ โกโขโฆโฐโฌโข"
}
],
},
{
"name": "Passphrase",
"type": "passphrase",
"default_options": {
"word_count": 8,
"word_case": "lowercase",
"min_word": 4,
"max_word": 40,
"separator": " "
},
}
]
}
},
onClose: () => {},
dialogContext: {
open: () => {}
}
};
}
/**
* Mocked a resource
*/
export const mockResource = {
"id": "8e3874ae-4b40-590b-968a-418f704b9d9a",
"name": "apache",
"username": "www-data",
"uri": "http://www.apache.org/",
"description": "Apache is the world's most used web server software.",
"deleted": false,
"created": "2019-12-05T13:38:43+00:00",
"modified": "2019-12-06T13:38:43+00:00",
"created_by": "f848277c-5398-58f8-a82a-72397af2d450",
"modified_by": "f848277c-5398-58f8-a82a-72397af2d450"
};