Skip to content

Commit a725e84

Browse files
authored
[Graph] Ensure inclusive language (elastic#71416) (elastic#71688)
1 parent 227902a commit a725e84

File tree

22 files changed

+106
-87
lines changed

22 files changed

+106
-87
lines changed

docs/management/advanced-options.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ retrieved.
249249
`timelion:es.timefield`:: The default field containing a timestamp when using the `.es()` query.
250250
`timelion:graphite.url`:: [experimental] Used with graphite queries, this is the URL of your graphite host
251251
in the form https://www.hostedgraphite.com/UID/ACCESS_KEY/graphite. This URL can be
252-
selected from a whitelist configured in the `kibana.yml` under `timelion.graphiteUrls`.
252+
selected from an allow-list configured in the `kibana.yml` under `timelion.graphiteUrls`.
253253
`timelion:max_buckets`:: The maximum number of buckets a single data source can return.
254254
This value is used for calculating automatic intervals in visualizations.
255255
`timelion:min_interval`:: The smallest interval to calculate when using "auto".

x-pack/plugins/graph/public/angular/graph_client_workspace.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function UnGroupOperation(parent, child) {
107107
// The main constructor for our GraphWorkspace
108108
function GraphWorkspace(options) {
109109
const self = this;
110-
this.blacklistedNodes = [];
110+
this.blocklistedNodes = [];
111111
this.options = options;
112112
this.undoLog = [];
113113
this.redoLog = [];
@@ -379,7 +379,7 @@ function GraphWorkspace(options) {
379379
this.redoLog = [];
380380
this.nodesMap = {};
381381
this.edgesMap = {};
382-
this.blacklistedNodes = [];
382+
this.blocklistedNodes = [];
383383
this.selectedNodes = [];
384384
this.lastResponse = null;
385385
};
@@ -630,11 +630,11 @@ function GraphWorkspace(options) {
630630
self.runLayout();
631631
};
632632

633-
this.unblacklist = function (node) {
634-
self.arrRemove(self.blacklistedNodes, node);
633+
this.unblocklist = function (node) {
634+
self.arrRemove(self.blocklistedNodes, node);
635635
};
636636

637-
this.blacklistSelection = function () {
637+
this.blocklistSelection = function () {
638638
const selection = self.getAllSelectedNodes();
639639
const danglingEdges = [];
640640
self.edges.forEach(function (edge) {
@@ -645,7 +645,7 @@ function GraphWorkspace(options) {
645645
});
646646
selection.forEach((node) => {
647647
delete self.nodesMap[node.id];
648-
self.blacklistedNodes.push(node);
648+
self.blocklistedNodes.push(node);
649649
node.isSelected = false;
650650
});
651651
self.arrRemoveAll(self.nodes, selection);
@@ -671,10 +671,10 @@ function GraphWorkspace(options) {
671671
}
672672
let step = {};
673673

674-
//Add any blacklisted nodes to exclusion list
674+
//Add any blocklisted nodes to exclusion list
675675
const excludeNodesByField = {};
676676
const nots = [];
677-
const avoidNodes = this.blacklistedNodes;
677+
const avoidNodes = this.blocklistedNodes;
678678
for (let i = 0; i < avoidNodes.length; i++) {
679679
const n = avoidNodes[i];
680680
let arr = excludeNodesByField[n.data.field];
@@ -914,8 +914,8 @@ function GraphWorkspace(options) {
914914
const nodesByField = {};
915915
const excludeNodesByField = {};
916916

917-
//Add any blacklisted nodes to exclusion list
918-
const avoidNodes = this.blacklistedNodes;
917+
//Add any blocklisted nodes to exclusion list
918+
const avoidNodes = this.blocklistedNodes;
919919
for (let i = 0; i < avoidNodes.length; i++) {
920920
const n = avoidNodes[i];
921921
let arr = excludeNodesByField[n.data.field];
@@ -1320,12 +1320,12 @@ function GraphWorkspace(options) {
13201320
allExistingNodes.forEach((existingNode) => {
13211321
addTermToFieldList(excludeNodesByField, existingNode.data.field, existingNode.data.term);
13221322
});
1323-
const blacklistedNodes = self.blacklistedNodes;
1324-
blacklistedNodes.forEach((blacklistedNode) => {
1323+
const blocklistedNodes = self.blocklistedNodes;
1324+
blocklistedNodes.forEach((blocklistedNode) => {
13251325
addTermToFieldList(
13261326
excludeNodesByField,
1327-
blacklistedNode.data.field,
1328-
blacklistedNode.data.term
1327+
blocklistedNode.data.field,
1328+
blocklistedNode.data.term
13291329
);
13301330
});
13311331

x-pack/plugins/graph/public/angular/graph_client_workspace.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('graphui-workspace', function () {
8282
expect(workspace.nodes.length).toEqual(2);
8383
expect(workspace.edges.length).toEqual(1);
8484
expect(workspace.selectedNodes.length).toEqual(0);
85-
expect(workspace.blacklistedNodes.length).toEqual(0);
85+
expect(workspace.blocklistedNodes.length).toEqual(0);
8686

8787
const nodeA = workspace.getNode(workspace.makeNodeId('field1', 'a'));
8888
expect(typeof nodeA).toBe('object');
@@ -124,7 +124,7 @@ describe('graphui-workspace', function () {
124124
expect(workspace.nodes.length).toEqual(2);
125125
expect(workspace.edges.length).toEqual(1);
126126
expect(workspace.selectedNodes.length).toEqual(0);
127-
expect(workspace.blacklistedNodes.length).toEqual(0);
127+
expect(workspace.blocklistedNodes.length).toEqual(0);
128128

129129
mockedResult = {
130130
vertices: [

x-pack/plugins/graph/public/angular/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<button class="kuiButton kuiButton--basic kuiButton--small" ng-disabled="workspace === null ||workspace.selectedNodes.length === 0"
125125
tooltip="{{ ::'xpack.graph.sidebar.topMenu.blocklistButtonTooltip' | i18n: { defaultMessage: 'Block selection from appearing in workspace' } }}"
126126
aria-label="{{ ::'xpack.graph.sidebar.topMenu.blocklistButtonTooltip' | i18n: { defaultMessage: 'Block selection from appearing in workspace' } }}"
127-
ng-click="workspace.blacklistSelection();">
127+
ng-click="workspace.blocklistSelection();">
128128
<span class="kuiIcon fa-ban"></span>
129129
</button>
130130

x-pack/plugins/graph/public/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,8 @@ export function initGraphApp(angularModule, deps) {
562562
run: () => {
563563
const settingsObservable = asAngularSyncedObservable(
564564
() => ({
565-
blacklistedNodes: $scope.workspace ? [...$scope.workspace.blacklistedNodes] : undefined,
566-
unblacklistNode: $scope.workspace ? $scope.workspace.unblacklist : undefined,
565+
blocklistedNodes: $scope.workspace ? [...$scope.workspace.blocklistedNodes] : undefined,
566+
unblocklistNode: $scope.workspace ? $scope.workspace.unblocklist : undefined,
567567
canEditDrillDownUrls: canEditDrillDownUrls,
568568
}),
569569
$scope.$digest.bind($scope)

x-pack/plugins/graph/public/components/settings/blacklist_form.tsx renamed to x-pack/plugins/graph/public/components/settings/blocklist_form.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,69 +20,69 @@ import { SettingsProps } from './settings';
2020
import { LegacyIcon } from '../legacy_icon';
2121
import { useListKeys } from './use_list_keys';
2222

23-
export function BlacklistForm({
24-
blacklistedNodes,
25-
unblacklistNode,
26-
}: Pick<SettingsProps, 'blacklistedNodes' | 'unblacklistNode'>) {
27-
const getListKey = useListKeys(blacklistedNodes || []);
23+
export function BlocklistForm({
24+
blocklistedNodes,
25+
unblocklistNode,
26+
}: Pick<SettingsProps, 'blocklistedNodes' | 'unblocklistNode'>) {
27+
const getListKey = useListKeys(blocklistedNodes || []);
2828
return (
2929
<>
30-
{blacklistedNodes && blacklistedNodes.length > 0 ? (
30+
{blocklistedNodes && blocklistedNodes.length > 0 ? (
3131
<EuiText size="s">
32-
{i18n.translate('xpack.graph.settings.blacklist.blacklistHelpText', {
32+
{i18n.translate('xpack.graph.settings.blocklist.blocklistHelpText', {
3333
defaultMessage: 'These terms are not allowed in the graph.',
3434
})}
3535
</EuiText>
3636
) : (
3737
<EuiCallOut
3838
title={
3939
<FormattedMessage
40-
id="xpack.graph.blacklist.noEntriesDescription"
40+
id="xpack.graph.blocklist.noEntriesDescription"
4141
defaultMessage="You don't have any blocked terms. Select vertices and click {stopSign} in the control panel on the right to block them. Documents that match blocked terms are no longer explored and relationships to them are hidden."
4242
values={{ stopSign: <span className="kuiIcon fa-ban" /> }}
4343
/>
4444
}
4545
/>
4646
)}
4747
<EuiSpacer />
48-
{blacklistedNodes && unblacklistNode && blacklistedNodes.length > 0 && (
48+
{blocklistedNodes && unblocklistNode && blocklistedNodes.length > 0 && (
4949
<>
5050
<EuiListGroup bordered maxWidth={false}>
51-
{blacklistedNodes.map((node) => (
51+
{blocklistedNodes.map((node) => (
5252
<EuiListGroupItem
5353
icon={<LegacyIcon icon={node.icon} asListIcon />}
5454
key={getListKey(node)}
5555
label={node.label}
5656
extraAction={{
5757
iconType: 'trash',
58-
'aria-label': i18n.translate('xpack.graph.blacklist.removeButtonAriaLabel', {
58+
'aria-label': i18n.translate('xpack.graph.blocklist.removeButtonAriaLabel', {
5959
defaultMessage: 'Delete',
6060
}),
61-
title: i18n.translate('xpack.graph.blacklist.removeButtonAriaLabel', {
61+
title: i18n.translate('xpack.graph.blocklist.removeButtonAriaLabel', {
6262
defaultMessage: 'Delete',
6363
}),
6464
color: 'danger',
6565
onClick: () => {
66-
unblacklistNode(node);
66+
unblocklistNode(node);
6767
},
6868
}}
6969
/>
7070
))}
7171
</EuiListGroup>
7272
<EuiSpacer />
7373
<EuiButton
74-
data-test-subj="graphUnblacklistAll"
74+
data-test-subj="graphUnblocklistAll"
7575
color="danger"
7676
iconType="trash"
7777
size="s"
7878
fill
7979
onClick={() => {
80-
blacklistedNodes.forEach((node) => {
81-
unblacklistNode(node);
80+
blocklistedNodes.forEach((node) => {
81+
unblocklistNode(node);
8282
});
8383
}}
8484
>
85-
{i18n.translate('xpack.graph.settings.blacklist.clearButtonLabel', {
85+
{i18n.translate('xpack.graph.settings.blocklist.clearButtonLabel', {
8686
defaultMessage: 'Delete all',
8787
})}
8888
</EuiButton>

x-pack/plugins/graph/public/components/settings/settings.test.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('settings', () => {
4646
};
4747

4848
const angularProps: jest.Mocked<AngularProps> = {
49-
blacklistedNodes: [
49+
blocklistedNodes: [
5050
{
5151
x: 0,
5252
y: 0,
@@ -57,7 +57,7 @@ describe('settings', () => {
5757
field: 'A',
5858
term: '1',
5959
},
60-
label: 'blacklisted node 1',
60+
label: 'blocklisted node 1',
6161
icon: {
6262
class: 'test',
6363
code: '1',
@@ -74,15 +74,15 @@ describe('settings', () => {
7474
field: 'A',
7575
term: '1',
7676
},
77-
label: 'blacklisted node 2',
77+
label: 'blocklisted node 2',
7878
icon: {
7979
class: 'test',
8080
code: '1',
8181
label: 'test',
8282
},
8383
},
8484
],
85-
unblacklistNode: jest.fn(),
85+
unblocklistNode: jest.fn(),
8686
canEditDrillDownUrls: true,
8787
};
8888

@@ -201,23 +201,23 @@ describe('settings', () => {
201201
});
202202
});
203203

204-
describe('blacklist', () => {
204+
describe('blocklist', () => {
205205
beforeEach(() => {
206206
toTab('Block list');
207207
});
208208

209-
it('should switch tab to blacklist', () => {
209+
it('should switch tab to blocklist', () => {
210210
expect(instance.find(EuiListGroupItem).map((item) => item.prop('label'))).toEqual([
211-
'blacklisted node 1',
212-
'blacklisted node 2',
211+
'blocklisted node 1',
212+
'blocklisted node 2',
213213
]);
214214
});
215215

216216
it('should update on new data', () => {
217217
act(() => {
218218
subject.next({
219219
...angularProps,
220-
blacklistedNodes: [
220+
blocklistedNodes: [
221221
{
222222
x: 0,
223223
y: 0,
@@ -228,7 +228,7 @@ describe('settings', () => {
228228
field: 'A',
229229
term: '1',
230230
},
231-
label: 'blacklisted node 3',
231+
label: 'blocklisted node 3',
232232
icon: {
233233
class: 'test',
234234
code: '1',
@@ -242,21 +242,21 @@ describe('settings', () => {
242242
instance.update();
243243

244244
expect(instance.find(EuiListGroupItem).map((item) => item.prop('label'))).toEqual([
245-
'blacklisted node 3',
245+
'blocklisted node 3',
246246
]);
247247
});
248248

249249
it('should delete node', () => {
250250
instance.find(EuiListGroupItem).at(0).prop('extraAction')!.onClick!({} as any);
251251

252-
expect(angularProps.unblacklistNode).toHaveBeenCalledWith(angularProps.blacklistedNodes![0]);
252+
expect(angularProps.unblocklistNode).toHaveBeenCalledWith(angularProps.blocklistedNodes![0]);
253253
});
254254

255255
it('should delete all nodes', () => {
256-
instance.find('[data-test-subj="graphUnblacklistAll"]').find(EuiButton).simulate('click');
256+
instance.find('[data-test-subj="graphUnblocklistAll"]').find(EuiButton).simulate('click');
257257

258-
expect(angularProps.unblacklistNode).toHaveBeenCalledWith(angularProps.blacklistedNodes![0]);
259-
expect(angularProps.unblacklistNode).toHaveBeenCalledWith(angularProps.blacklistedNodes![1]);
258+
expect(angularProps.unblocklistNode).toHaveBeenCalledWith(angularProps.blocklistedNodes![0]);
259+
expect(angularProps.unblocklistNode).toHaveBeenCalledWith(angularProps.blocklistedNodes![1]);
260260
});
261261
});
262262

x-pack/plugins/graph/public/components/settings/settings.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as Rx from 'rxjs';
1111
import { connect } from 'react-redux';
1212
import { bindActionCreators } from 'redux';
1313
import { AdvancedSettingsForm } from './advanced_settings_form';
14-
import { BlacklistForm } from './blacklist_form';
14+
import { BlocklistForm } from './blocklist_form';
1515
import { UrlTemplateList } from './url_template_list';
1616
import { WorkspaceNode, AdvancedSettings, UrlTemplate, WorkspaceField } from '../../types';
1717
import {
@@ -33,9 +33,9 @@ const tabs = [
3333
component: AdvancedSettingsForm,
3434
},
3535
{
36-
id: 'blacklist',
37-
title: i18n.translate('xpack.graph.settings.blacklistTitle', { defaultMessage: 'Block list' }),
38-
component: BlacklistForm,
36+
id: 'blocklist',
37+
title: i18n.translate('xpack.graph.settings.blocklistTitle', { defaultMessage: 'Block list' }),
38+
component: BlocklistForm,
3939
},
4040
{
4141
id: 'drillDowns',
@@ -51,8 +51,8 @@ const tabs = [
5151
* to catch update outside updates
5252
*/
5353
export interface AngularProps {
54-
blacklistedNodes: WorkspaceNode[];
55-
unblacklistNode: (node: WorkspaceNode) => void;
54+
blocklistedNodes: WorkspaceNode[];
55+
unblocklistNode: (node: WorkspaceNode) => void;
5656
canEditDrillDownUrls: boolean;
5757
}
5858

x-pack/plugins/graph/public/services/persistence/deserialize.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('deserialize', () => {
2626
{ color: 'black', name: 'field1', selected: true, iconClass: 'a' },
2727
{ color: 'black', name: 'field2', selected: true, iconClass: 'b' },
2828
],
29-
blacklist: [
29+
blocklist: [
3030
{
3131
color: 'black',
3232
label: 'Z',
@@ -192,7 +192,7 @@ describe('deserialize', () => {
192192
it('should deserialize nodes and edges', () => {
193193
callSavedWorkspaceToAppState();
194194

195-
expect(workspace.blacklistedNodes.length).toEqual(1);
195+
expect(workspace.blocklistedNodes.length).toEqual(1);
196196
expect(workspace.nodes.length).toEqual(5);
197197
expect(workspace.edges.length).toEqual(2);
198198

x-pack/plugins/graph/public/services/persistence/deserialize.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ function getFieldsWithWorkspaceSettings(
128128
return allFields;
129129
}
130130

131-
function getBlacklistedNodes(
131+
function getBlocklistedNodes(
132132
serializedWorkspaceState: SerializedWorkspaceState,
133133
allFields: WorkspaceField[]
134134
) {
135-
return serializedWorkspaceState.blacklist.map((serializedNode) => {
135+
return serializedWorkspaceState.blocklist.map((serializedNode) => {
136136
const currentField = allFields.find((field) => field.name === serializedNode.field)!;
137137
return {
138138
x: 0,
@@ -235,9 +235,9 @@ export function savedWorkspaceToAppState(
235235
workspaceInstance.mergeGraph(graph);
236236
resolveGroups(persistedWorkspaceState.vertices, workspaceInstance);
237237

238-
// ================== blacklist =============================
239-
const blacklistedNodes = getBlacklistedNodes(persistedWorkspaceState, allFields);
240-
workspaceInstance.blacklistedNodes.push(...blacklistedNodes);
238+
// ================== blocklist =============================
239+
const blocklistedNodes = getBlocklistedNodes(persistedWorkspaceState, allFields);
240+
workspaceInstance.blocklistedNodes.push(...blocklistedNodes);
241241

242242
return {
243243
urlTemplates,

0 commit comments

Comments
 (0)