passbolt-styleguide 5.14.2 → 5.14.4
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 +6 -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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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/build/js/dist/api-app.js +1 -1
- package/build/locales/cs-CZ/common.json +1 -1
- package/build/locales/de-DE/common.json +1 -1
- package/build/locales/en-UK/common.json +1 -1
- package/build/locales/es-ES/common.json +1 -1
- package/build/locales/fr-FR/common.json +1 -1
- package/build/locales/it-IT/common.json +1 -1
- package/build/locales/ja-JP/common.json +1 -1
- package/build/locales/ko-KR/common.json +1 -1
- package/build/locales/lt-LT/common.json +1 -1
- package/build/locales/nl-NL/common.json +1 -1
- package/build/locales/pl-PL/common.json +1 -1
- package/build/locales/pt-BR/common.json +1 -1
- package/build/locales/ro-RO/common.json +1 -1
- package/build/locales/ru-RU/common.json +1 -1
- package/build/locales/sl-SI/common.json +1 -1
- package/build/locales/sv-SE/common.json +1 -1
- package/build/locales/uk-UA/common.json +1 -1
- package/package.json +1 -1
- package/src/locales/cs-CZ/common.json +1 -1
- package/src/locales/de-DE/common.json +1 -1
- package/src/locales/en-UK/common.json +1 -1
- package/src/locales/es-ES/common.json +1 -1
- package/src/locales/fr-FR/common.json +1 -1
- package/src/locales/it-IT/common.json +1 -1
- package/src/locales/ja-JP/common.json +1 -1
- package/src/locales/ko-KR/common.json +1 -1
- package/src/locales/lt-LT/common.json +1 -1
- package/src/locales/nl-NL/common.json +1 -1
- package/src/locales/pl-PL/common.json +1 -1
- package/src/locales/pt-BR/common.json +1 -1
- package/src/locales/ro-RO/common.json +1 -1
- package/src/locales/ru-RU/common.json +1 -1
- package/src/locales/sl-SI/common.json +1 -1
- package/src/locales/sv-SE/common.json +1 -1
- package/src/locales/uk-UA/common.json +1 -1
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.js +6 -11
- package/src/react-extension/components/Administration/DisplaySubscriptionKey/DisplaySubscriptionKey.test.js +0 -28
- package/src/react-extension/components/Resource/HandlePermissionWorkflow/flows/FolderShareFlow.js +7 -7
- package/src/react-extension/components/Resource/HandlePermissionWorkflow/flows/FolderShareFlow.test.js +2 -2
- package/src/react-extension/components/Resource/HandlePermissionWorkflow/flows/ResourceCreationFlow.js +5 -6
- package/src/react-extension/components/Resource/HandlePermissionWorkflow/flows/ResourceEditFlow.js +13 -3
- package/src/react-extension/components/Resource/HandlePermissionWorkflow/flows/ResourceShareFlow.js +4 -5
- package/src/react-extension/components/Share/GroupPermissionItem.js +12 -19
- package/src/react-extension/components/Share/GroupPermissionItem.test.data.js +0 -1
- package/src/react-extension/components/Share/GroupPermissionItem.test.js +6 -14
- package/src/react-extension/components/Share/GroupPermissionItem.test.stories.js +0 -4
- package/src/react-extension/components/Share/ShareDialog.js +166 -152
- package/src/react-extension/components/Share/ShareDialog.test.data.js +185 -0
- package/src/react-extension/components/Share/ShareDialog.test.js +94 -501
- package/src/react-extension/components/Share/ShareDialog.test.stories.js +0 -3
- package/src/react-extension/contexts/ExtAppContext.js +0 -6
|
@@ -982,3 +982,188 @@ export function addedGroupWithMembersFixture() {
|
|
|
982
982
|
members: [memberUserC, memberUserD],
|
|
983
983
|
};
|
|
984
984
|
}
|
|
985
|
+
|
|
986
|
+
/**
|
|
987
|
+
* Build controlled-mode props sharing the given resources. An owner (Ada) owns every resource and a
|
|
988
|
+
* reader (Betty) has read access to every resource, so the list always keeps at least one owner.
|
|
989
|
+
* The confirmation mode is disabled so the dialog exposes its "Share …" title.
|
|
990
|
+
* @param {Array<string>} names The names of the resources to share
|
|
991
|
+
* @param {object} data Props to override
|
|
992
|
+
* @returns {object}
|
|
993
|
+
*/
|
|
994
|
+
export function resourcesShareProps(names, data = {}) {
|
|
995
|
+
const owner = defaultUserDto({
|
|
996
|
+
username: "ada@passbolt.com",
|
|
997
|
+
profile: defaultProfileDto({ first_name: "Ada", last_name: "Lovelace" }),
|
|
998
|
+
});
|
|
999
|
+
const reader = defaultUserDto({
|
|
1000
|
+
username: "betty@passbolt.com",
|
|
1001
|
+
profile: defaultProfileDto({ first_name: "Betty", last_name: "Holberton" }),
|
|
1002
|
+
});
|
|
1003
|
+
const buildResource = (name) => {
|
|
1004
|
+
const resourceId = uuidv4();
|
|
1005
|
+
return {
|
|
1006
|
+
id: resourceId,
|
|
1007
|
+
metadata: { name },
|
|
1008
|
+
permission: { type: 15 },
|
|
1009
|
+
permissions: new PermissionsCollection(
|
|
1010
|
+
[
|
|
1011
|
+
defaultPermissionDto({
|
|
1012
|
+
aco: "Resource",
|
|
1013
|
+
aco_foreign_key: resourceId,
|
|
1014
|
+
aro: "User",
|
|
1015
|
+
aro_foreign_key: owner.id,
|
|
1016
|
+
type: 15,
|
|
1017
|
+
}),
|
|
1018
|
+
defaultPermissionDto({
|
|
1019
|
+
aco: "Resource",
|
|
1020
|
+
aco_foreign_key: resourceId,
|
|
1021
|
+
aro: "User",
|
|
1022
|
+
aro_foreign_key: reader.id,
|
|
1023
|
+
type: 1,
|
|
1024
|
+
}),
|
|
1025
|
+
],
|
|
1026
|
+
{ assertAtLeastOneOwner: false },
|
|
1027
|
+
),
|
|
1028
|
+
};
|
|
1029
|
+
};
|
|
1030
|
+
return {
|
|
1031
|
+
...defaultProps(),
|
|
1032
|
+
isPermissionConfirmationMode: false,
|
|
1033
|
+
initialResources: names.map(buildResource),
|
|
1034
|
+
initialGroups: new GroupsCollection([]),
|
|
1035
|
+
initialUsers: new UsersCollection([owner, reader]),
|
|
1036
|
+
onConfirm: jest.fn(),
|
|
1037
|
+
...data,
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Build controlled-mode props sharing a single folder owned by an owner (Ada).
|
|
1043
|
+
* The confirmation mode is disabled so the dialog exposes its "Share folder" title.
|
|
1044
|
+
* @param {string} name The folder name
|
|
1045
|
+
* @param {object} data Props to override
|
|
1046
|
+
* @returns {object}
|
|
1047
|
+
*/
|
|
1048
|
+
export function folderShareProps(name, data = {}) {
|
|
1049
|
+
const owner = defaultUserDto({ username: "ada@passbolt.com" });
|
|
1050
|
+
const folderId = uuidv4();
|
|
1051
|
+
return {
|
|
1052
|
+
...defaultProps(),
|
|
1053
|
+
isPermissionConfirmationMode: false,
|
|
1054
|
+
acoType: "Folder",
|
|
1055
|
+
initialFolders: [
|
|
1056
|
+
{
|
|
1057
|
+
id: folderId,
|
|
1058
|
+
metadata: { name },
|
|
1059
|
+
permission: { type: 15 },
|
|
1060
|
+
permissions: new PermissionsCollection(
|
|
1061
|
+
[
|
|
1062
|
+
defaultPermissionDto({
|
|
1063
|
+
aco: "Folder",
|
|
1064
|
+
aco_foreign_key: folderId,
|
|
1065
|
+
aro: "User",
|
|
1066
|
+
aro_foreign_key: owner.id,
|
|
1067
|
+
type: 15,
|
|
1068
|
+
}),
|
|
1069
|
+
],
|
|
1070
|
+
{ assertAtLeastOneOwner: false },
|
|
1071
|
+
),
|
|
1072
|
+
},
|
|
1073
|
+
],
|
|
1074
|
+
initialGroups: new GroupsCollection([]),
|
|
1075
|
+
initialUsers: new UsersCollection([owner]),
|
|
1076
|
+
onConfirm: jest.fn(),
|
|
1077
|
+
...data,
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* Build controlled-mode props simulating a snapshot captured from a shared parent folder: a single
|
|
1083
|
+
* synthetic ACO (not yet created, id null) with an owner and a reader. When `data.acoType` is
|
|
1084
|
+
* "Folder" the ACO is provided via `initialFolders`, otherwise via `initialResources`.
|
|
1085
|
+
* @param {object} data Props to override
|
|
1086
|
+
* @returns {object}
|
|
1087
|
+
*/
|
|
1088
|
+
export function controlledModeProps(data = {}) {
|
|
1089
|
+
const ownerUser = defaultUserDto({ username: "operator@passbolt.com" });
|
|
1090
|
+
const readerUser = defaultUserDto({ username: "reader@passbolt.com" });
|
|
1091
|
+
const acoId = uuidv4();
|
|
1092
|
+
const permissionsDto = [
|
|
1093
|
+
defaultPermissionDto({
|
|
1094
|
+
aco: "Folder",
|
|
1095
|
+
aco_foreign_key: acoId,
|
|
1096
|
+
aro: "User",
|
|
1097
|
+
aro_foreign_key: ownerUser.id,
|
|
1098
|
+
type: 15,
|
|
1099
|
+
}),
|
|
1100
|
+
defaultPermissionDto({
|
|
1101
|
+
aco: "Folder",
|
|
1102
|
+
aco_foreign_key: acoId,
|
|
1103
|
+
aro: "User",
|
|
1104
|
+
aro_foreign_key: readerUser.id,
|
|
1105
|
+
type: 1,
|
|
1106
|
+
}),
|
|
1107
|
+
];
|
|
1108
|
+
const aco = {
|
|
1109
|
+
id: null,
|
|
1110
|
+
metadata: { name: "" },
|
|
1111
|
+
permission: { type: 15 },
|
|
1112
|
+
permissions: new PermissionsCollection(permissionsDto, { assertAtLeastOneOwner: false }),
|
|
1113
|
+
};
|
|
1114
|
+
const acoProps = data.acoType === "Folder" ? { initialFolders: [aco] } : { initialResources: [aco] };
|
|
1115
|
+
return {
|
|
1116
|
+
...defaultProps(),
|
|
1117
|
+
...acoProps,
|
|
1118
|
+
initialGroups: new GroupsCollection([]),
|
|
1119
|
+
initialUsers: new UsersCollection([ownerUser, readerUser]),
|
|
1120
|
+
onConfirm: jest.fn(),
|
|
1121
|
+
...data,
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* Build controlled-mode props seeded with two resources (RA, RB). An owner owns both; a reader has
|
|
1127
|
+
* read access to both. Each resource carries its own single-ACO permission set.
|
|
1128
|
+
* @param {object} data Props to override
|
|
1129
|
+
* @returns {object}
|
|
1130
|
+
*/
|
|
1131
|
+
export function twoResourcesShareProps(data = {}) {
|
|
1132
|
+
const ownerUser = defaultUserDto({ username: "operator@passbolt.com" });
|
|
1133
|
+
const readerUser = defaultUserDto({ username: "reader@passbolt.com" });
|
|
1134
|
+
const buildResource = (name) => {
|
|
1135
|
+
const resourceId = uuidv4();
|
|
1136
|
+
return {
|
|
1137
|
+
id: resourceId,
|
|
1138
|
+
metadata: { name },
|
|
1139
|
+
permission: { type: 15 },
|
|
1140
|
+
permissions: new PermissionsCollection(
|
|
1141
|
+
[
|
|
1142
|
+
defaultPermissionDto({
|
|
1143
|
+
aco: "Resource",
|
|
1144
|
+
aco_foreign_key: resourceId,
|
|
1145
|
+
aro: "User",
|
|
1146
|
+
aro_foreign_key: ownerUser.id,
|
|
1147
|
+
type: 15,
|
|
1148
|
+
}),
|
|
1149
|
+
defaultPermissionDto({
|
|
1150
|
+
aco: "Resource",
|
|
1151
|
+
aco_foreign_key: resourceId,
|
|
1152
|
+
aro: "User",
|
|
1153
|
+
aro_foreign_key: readerUser.id,
|
|
1154
|
+
type: 1,
|
|
1155
|
+
}),
|
|
1156
|
+
],
|
|
1157
|
+
{ assertAtLeastOneOwner: false },
|
|
1158
|
+
),
|
|
1159
|
+
};
|
|
1160
|
+
};
|
|
1161
|
+
return {
|
|
1162
|
+
...defaultProps(),
|
|
1163
|
+
initialResources: [buildResource("RA"), buildResource("RB")],
|
|
1164
|
+
initialGroups: new GroupsCollection([]),
|
|
1165
|
+
initialUsers: new UsersCollection([ownerUser, readerUser]),
|
|
1166
|
+
onConfirm: jest.fn(),
|
|
1167
|
+
...data,
|
|
1168
|
+
};
|
|
1169
|
+
}
|