use inclusive language (#71607)

This commit is contained in:
Pierre Gayvallet 2020-07-14 14:18:29 +02:00 committed by GitHub
parent 97afee5b06
commit 5353db5ca6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View file

@ -29,8 +29,8 @@ export type StringOptions = TypeOptions<string> & {
export class StringType extends Type<string> {
constructor(options: StringOptions = {}) {
// We want to allow empty strings, however calling `allow('')` casues
// Joi to whitelist the value and skip any additional validation.
// We want to allow empty strings, however calling `allow('')` causes
// Joi to allow the value and skip any additional validation.
// Instead, we reimplement the string validator manually except in the
// hostname case where empty strings aren't allowed anyways.
let schema =

View file

@ -1309,7 +1309,7 @@ This table shows where these uiExports have moved to in the New Platform. In mos
| `hacks` | n/a | Just run the code in your plugin's `start` method. |
| `home` | [`plugins.home.featureCatalogue.register`](./src/plugins/home/public/feature_catalogue) | Must add `home` as a dependency in your kibana.json. |
| `indexManagement` | | Should be an API on the indexManagement plugin. |
| `injectDefaultVars` | n/a | Plugins will only be able to "whitelist" config values for the frontend. See [#41990](https://github.com/elastic/kibana/issues/41990) |
| `injectDefaultVars` | n/a | Plugins will only be able to allow config values for the frontend. See [#41990](https://github.com/elastic/kibana/issues/41990) |
| `inspectorViews` | | Should be an API on the data (?) plugin. |
| `interpreter` | | Should be an API on the interpreter plugin. |
| `links` | n/a | Not necessary, just register your app via `core.application.register` |
@ -1389,7 +1389,7 @@ class MyPlugin {
}
```
If your plugin also have a client-side part, you can also expose configuration properties to it using a whitelisting mechanism with the configuration `exposeToBrowser` property.
If your plugin also have a client-side part, you can also expose configuration properties to it using the configuration `exposeToBrowser` allow-list property.
```typescript
// my_plugin/server/index.ts

View file

@ -28,7 +28,7 @@ const createInternalClientMock = (): DeeplyMockedKeys<Client> => {
node: 'http://localhost',
}) as any;
const blackListedProps = [
const omittedProps = [
'_events',
'_eventsCount',
'_maxListeners',
@ -39,9 +39,9 @@ const createInternalClientMock = (): DeeplyMockedKeys<Client> => {
'helpers',
];
const mockify = (obj: Record<string, any>, blacklist: string[] = []) => {
const mockify = (obj: Record<string, any>, omitted: string[] = []) => {
Object.keys(obj)
.filter((key) => !blacklist.includes(key))
.filter((key) => !omitted.includes(key))
.forEach((key) => {
const propType = typeof obj[key];
if (propType === 'function') {
@ -52,7 +52,7 @@ const createInternalClientMock = (): DeeplyMockedKeys<Client> => {
});
};
mockify(client, blackListedProps);
mockify(client, omittedProps);
client.transport = {
request: jest.fn(),

View file

@ -39,14 +39,14 @@ import { getRootProperties } from './get_root_properties';
* @return {EsPropertyMappings}
*/
const blacklist = ['migrationVersion', 'references'];
const omittedRootProps = ['migrationVersion', 'references'];
export function getRootPropertiesObjects(mappings: IndexMapping) {
const rootProperties = getRootProperties(mappings);
return Object.entries(rootProperties).reduce((acc, [key, value]) => {
// we consider the existence of the properties or type of object to designate that this is an object datatype
if (
!blacklist.includes(key) &&
!omittedRootProps.includes(key) &&
((value as SavedObjectsComplexFieldMapping).properties || value.type === 'object')
) {
acc[key] = value;