Skip to content

Commit

Permalink
remove role galaxy filter
Browse files Browse the repository at this point in the history
  • Loading branch information
himdel committed Jul 5, 2024
1 parent 67d3c51 commit 469dbc3
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 22 deletions.
5 changes: 0 additions & 5 deletions cypress/e2e/namespaces/rbac-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ describe('add and delete roles', () => {
cy.contains('Save').should('be.disabled');

cy.get('#role_name').clear().type('test');
helperText('role_name').should(
'have.text',
`This field must start with 'galaxy.'.`,
);

cy.get('#role_name').clear();
helperText('role_name').should('have.text', 'This field may not be blank.');
cy.contains('Save').should('be.disabled');
Expand Down
5 changes: 0 additions & 5 deletions cypress/e2e/namespaces/rbac-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ describe('RBAC table contains correct headers and filter', () => {
cy.visit(`${uiPrefix}roles`);
cy.contains('Roles');

// ensure role names begin with 'galaxy.'
cy.get('[data-cy="name-field"]').each((name) =>
cy.get(name).contains('galaxy.'),
);

// ensure proper headers
[('Role name', 'Description', 'Created', 'Editable')].forEach((item) => {
cy.get('tr[data-cy="SortTable-headers"] th').contains(item);
Expand Down
5 changes: 1 addition & 4 deletions src/components/select-roles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ export const SelectRoles: FunctionComponent<SelectRolesProps> = ({

const queryRoles = () => {
setLoading(true);
RoleAPI.list(
{ name__startswith: 'galaxy.', ...localParams },
pulpObjectType,
).then(({ data }) => {
RoleAPI.list(localParams, pulpObjectType).then(({ data }) => {
setRoles(data.results);
setRolesItemCount(data.count);
setLoading(false);
Expand Down
6 changes: 0 additions & 6 deletions src/containers/role-management/role-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ export class RoleList extends Component<RouteProps, IState> {
params['sort'] = 'name';
}

if (!params['name__startswith']) {
params['name__startswith'] = 'galaxy.';
}

this.state = {
redirect: null,
roles: [],
Expand Down Expand Up @@ -285,12 +281,10 @@ export class RoleList extends Component<RouteProps, IState> {
ignoredParams={['page_size', 'page', 'sort', 'ordering']}
niceValues={{
locked: { true: t`Built-in`, false: t`Editable` },
name__startswith: { 'galaxy.': t`true` },
}}
niceNames={{
locked: t`Editable`,
name__icontains: t`Role name`,
name__startswith: t`Galaxy only`,
}}
/>
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/utilities/map-role-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export function validateInput(input, field, currentErrors) {
errors[field] = t`This field can only contain letters and numbers`;
} else if (input.length <= 2) {
errors[field] = t`This field must be longer than 2 characters`;
} else if (field === 'name' && !input.startsWith('galaxy.')) {
errors[field] = t`This field must start with 'galaxy.'.`;
} else {
delete errors[field];
}
Expand Down

0 comments on commit 469dbc3

Please sign in to comment.