Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Workplace Search] Role Mappings to Kibana #93123

Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
da54c6f
Add routes for role mapings
scottybollinger Feb 22, 2021
08d2ce6
Initial copy/paste
scottybollinger Feb 18, 2021
45e1e21
Update RoleMappingsRouter
scottybollinger Feb 18, 2021
102e471
Update RoleMappings
scottybollinger Feb 18, 2021
ca191b1
Update RoleMapping
scottybollinger Feb 18, 2021
7ddaceb
Fix path in index and add route helper
scottybollinger Feb 22, 2021
85678e1
Update paths in RoleMappingsLogic
scottybollinger Feb 18, 2021
969ec35
Remove history in favor of KibanaLogic.navigateToUrl
scottybollinger Feb 22, 2021
b07a2e0
Add Role type
scottybollinger Feb 22, 2021
b9450ec
Remove ID prop
scottybollinger Feb 22, 2021
d88a1db
Replace contextual flash messages with global
scottybollinger Feb 22, 2021
ac949ed
Replace Rails http with kibana http
scottybollinger Feb 22, 2021
c617848
Fix route path
scottybollinger Feb 22, 2021
154cf03
Add route and update global navigation
scottybollinger Feb 22, 2021
708b8e8
Add breadcrumb/page title
scottybollinger Feb 22, 2021
ebed050
Update flash messages in RoleMapping
scottybollinger Feb 24, 2021
30dfcb7
Use explicit AttributeName type instead of string
scottybollinger Feb 24, 2021
710ea6b
Add i18n
scottybollinger Feb 24, 2021
d1b2051
Fix type issue
scottybollinger Feb 25, 2021
d6aa01f
Add tests for components and router
scottybollinger Feb 25, 2021
fabacae
Add optional to interface
scottybollinger Mar 1, 2021
65bc917
Add tests for RoleMappingsLogic
scottybollinger Mar 1, 2021
9210060
Merge branch 'master' into scottybollinger/ws-role-mapping
kibanamachine Mar 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use explicit AttributeName type instead of string
  • Loading branch information
scottybollinger committed Feb 24, 2021
commit 30dfcb7b878cc1f85ab115c90ba7cfafe8e32022
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ import { kea, MakeLogicType } from 'kea';
import { clearFlashMessages, flashAPIErrors } from '../../../shared/flash_messages';
import { HttpLogic } from '../../../shared/http';
import { KibanaLogic } from '../../../shared/kibana';
import { AttributeName } from '../../../shared/role_mapping/attribute_selector';
import { ANY_AUTH_PROVIDER } from '../../../shared/role_mapping/constants';
import { ROLE_MAPPINGS_PATH } from '../../routes';
import { RoleGroup, WSRoleMapping, Role } from '../../types';
@@ -38,9 +39,9 @@ interface RoleMappingsActions {
handleRoleChange(roleType: Role): { roleType: Role };
handleAllGroupsSelectionChange(selected: boolean): { selected: boolean };
handleAttributeSelectorChange(
value: string,
value: AttributeName,
firstElasticsearchRole: string
): { value: string; firstElasticsearchRole: string };
): { value: AttributeName; firstElasticsearchRole: string };
handleAttributeValueChange(value: string): { value: string };
handleGroupSelectionChange(
groupId: string,
@@ -62,7 +63,7 @@ interface RoleMappingsValues {
roleMappings: WSRoleMapping[];
roleType: Role;
attributeValue: string;
attributeName: string;
attributeName: AttributeName;
dataLoading: boolean;
multipleAuthProvidersConfig: boolean;
availableGroups: RoleGroup[];
@@ -71,8 +72,8 @@ interface RoleMappingsValues {
selectedAuthProviders: string[];
}

const getFirstAttributeName = (roleMapping: WSRoleMapping): string =>
Object.entries(roleMapping.rules)[0][0] as string;
const getFirstAttributeName = (roleMapping: WSRoleMapping): AttributeName =>
Object.entries(roleMapping.rules)[0][0] as AttributeName;
const getFirstAttributeValue = (roleMapping: WSRoleMapping): string =>
Object.entries(roleMapping.rules)[0][1] as string;