Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
reduce the number of hub-, insights etc in code
  • Loading branch information
himdel committed Jul 5, 2024
1 parent 6360cb6 commit 67d3c51
Show file tree
Hide file tree
Showing 127 changed files with 476 additions and 572 deletions.
4 changes: 2 additions & 2 deletions config/shared.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const webpack = require('webpack');

const isBuild = process.env.NODE_ENV === 'production';

// only run git when HUB_UI_VERSION is NOT provided
// only run git when PULP_UI_VERSION is NOT provided
const gitCommit =
process.env.HUB_UI_VERSION ||
process.env.PULP_UI_VERSION ||
execSync('git rev-parse HEAD', { encoding: 'utf-8' }).trim();

const docsURL = 'https://docs.pulpproject.org/';
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/approval-modal/approval-multiple-repos-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ describe('Approval Dashboard process with multiple repos', () => {

it('should test paging', () => {
openModal();
cy.contains('.modal-body .hub-toolbar', '1 - 10 of 11');
cy.contains('.modal-body .pulp-toolbar', '1 - 10 of 11');
cy.contains('.modal-body', 'repo1');
cy.contains('.modal-body', 'published');
cy.get('.modal-body .hub-toolbar [data-action="next"]').click();
cy.contains('.modal-body .hub-toolbar', '11 - 11 of 11');
cy.get('.modal-body .pulp-toolbar [data-action="next"]').click();
cy.contains('.modal-body .pulp-toolbar', '11 - 11 of 11');
cy.contains('.modal-body', 'repo9');
});

Expand Down Expand Up @@ -117,7 +117,7 @@ describe('Approval Dashboard process with multiple repos', () => {
openModal();

// deselect all
cy.get('.hub-toolbar [aria-label="Select"] svg').click();
cy.get('.pulp-toolbar [aria-label="Select"] svg').click();
cy.contains('a', 'Deselect all (0 items)').click();
reposList.forEach((repo) => {
cy.contains('[aria-label="Label group category"]', repo).should(
Expand All @@ -126,7 +126,7 @@ describe('Approval Dashboard process with multiple repos', () => {
});

// select page
cy.get('.hub-toolbar [aria-label="Select"] svg').click();
cy.get('.pulp-toolbar [aria-label="Select"] svg').click();
cy.contains('a', 'Select page (10 items)').click();
cy.contains('.pf-v5-c-label.pf-m-overflow', 'more').click();

Expand All @@ -145,7 +145,7 @@ describe('Approval Dashboard process with multiple repos', () => {
cy.contains('Clear all filters').click();

// deselect page and repo9 should remain here
cy.get('.hub-toolbar [aria-label="Select"] svg').click();
cy.get('.pulp-toolbar [aria-label="Select"] svg').click();
cy.contains('a', 'Deselect page (10 items)').click();

reposList.forEach((repo) => {
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/approval-modal/approval-multiple-repos.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('Approval Dashboard process with multiple repos', () => {
rejectItem('published');

// 2 items should be left there
cy.contains('.hub-toolbar', '1 - 2 of 2');
cy.contains('.pulp-toolbar', '1 - 2 of 2');
cy.get('[data-cy="ApprovalRow-rejected-namespace-collection1"]');
cy.get('[data-cy="ApprovalRow-repo2-namespace-collection1"]');
cy.get('[data-cy="ApprovalRow-repo1-namespace-collection1"]').should(
Expand All @@ -149,7 +149,7 @@ describe('Approval Dashboard process with multiple repos', () => {

cy.visit(`${uiPrefix}approval-dashboard`);
cy.contains('Clear all filters').click();
cy.contains('.hub-toolbar', '1 - 2 of 2');
cy.contains('.pulp-toolbar', '1 - 2 of 2');
cy.get('[data-cy="ApprovalRow-repo2-namespace-collection1"]');
cy.get('[data-cy="ApprovalRow-repo1-namespace-collection1"]');
cy.get('[data-cy="ApprovalRow-published-namespace-collection1"]').should(
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/approval/approval-dashboard-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ describe('Approval Dashboard list tests for sorting, paging and filtering', () =
'[data-cy="body"] [data-cy="compound_filter"] a',
'Collection name',
).click();
cy.get('[data-cy="body"] .hub-toolbar input').type(
cy.get('[data-cy="body"] .pulp-toolbar input').type(
'approval_dashboard_collection_test0{enter}',
);

cy.get('[data-cy="body"] .hub-toolbar button:first').click();
cy.get('[data-cy="body"] .pulp-toolbar button:first').click();
cy.contains(
'[data-cy="body"] [data-cy="compound_filter"] a',
'Namespace',
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/approval/approval-process.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Approval Dashboard process', () => {
cy.visit(`${uiPrefix}approval-dashboard`);
cy.contains('[data-cy^="ApprovalRow"]', 'Needs review');
cy.contains('[data-cy^="ApprovalRow"] button', 'Sign and approve').click();
cy.contains('.body', 'No results found', { timeout: 8000 });
cy.contains('.pulp-section', 'No results found', { timeout: 8000 });
cy.visit(`${uiPrefix}approval-dashboard`);
cy.contains('button', 'Clear all filters').click();
cy.contains('[data-cy^="ApprovalRow"]', 'Signed and approved');
Expand Down
42 changes: 21 additions & 21 deletions cypress/e2e/collections/collection-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,37 +76,37 @@ describe('Collection detail', () => {
// better synchronization, wait for the rest of the page to load

if (tab.name == 'Documentation') {
cy.contains('.hub-docs-container', 'Documentation');
cy.contains('.pulp-docs-container', 'Documentation');
}

if (tab.name == 'Import log') {
cy.contains('.body', 'Approval status', {
cy.contains('.pulp-section', 'Approval status', {
timeout: 10000,
});
}

if (tab.name == 'Contents') {
cy.contains('.body', 'Description');
cy.contains('.pulp-section', 'Description');
}

if (tab.name == 'Dependencies') {
cy.contains('.body', 'No dependencies');
cy.contains('.pulp-section', 'No dependencies');
}

if (tab.name == 'Install') {
cy.contains('.body', 'License');
cy.contains('.pulp-section', 'License');
}
});
});

it('should have working UI on install tab', () => {
cy.visit(baseURL);
// should have Install, License and Installation strings, and correct docs link
cy.get('.body').contains('Install');
cy.get('.body').contains('License');
cy.get('.body').contains('Installation');
cy.get('.pulp-section').contains('Install');
cy.get('.pulp-section').contains('License');
cy.get('.pulp-section').contains('Installation');

cy.get('.body').contains(
cy.get('.pulp-section').contains(
`a[href="${uiPrefix}repo/published/collection_detail_test_namespace/collection_detail_test_collection/docs/"]`,
'Go to documentation',
);
Expand All @@ -131,37 +131,37 @@ describe('Collection detail', () => {
it('should have working UI on docs tab', () => {
cy.visit(`${baseURL}/docs`);
// should have the search field
cy.get('.body').get('input[aria-label="find-content"');
cy.get('.pulp-section').get('input[aria-label="find-content"');

// should have Readme menu item
cy.get('.hub-docs-sidebar').contains('Readme');
cy.get('.pulp-docs-sidebar').contains('Readme');

// should still show the readme when searching readme
cy.get('input[aria-label="find-content"').type('readme');
cy.get('.hub-docs-sidebar').contains('Readme');
cy.get('.pulp-docs-sidebar').contains('Readme');

// should not display readme if searching for no entry
cy.get('input[aria-label="find-content"').type('no entry');
cy.get('.hub-docs-sidebar').not(':contains("Readme")');
cy.get('.pulp-docs-sidebar').not(':contains("Readme")');
});

it('should have a search field and the table headers on contents tab', () => {
cy.visit(`${baseURL}/content`);
cy.get('.body').get('input[aria-label="find-content"');
cy.get('.body').contains('th', 'Name');
cy.get('.body').contains('th', 'Type');
cy.get('.body').contains('th', 'Description');
cy.get('.pulp-section').get('input[aria-label="find-content"');
cy.get('.pulp-section').contains('th', 'Name');
cy.get('.pulp-section').contains('th', 'Type');
cy.get('.pulp-section').contains('th', 'Description');
});

it('should display import log tab', () => {
cy.visit(`${baseURL}/import-log`);
cy.get('.body').get('.title-bar');
cy.get('.body').get('.message-list');
cy.get('.pulp-section').get('.title-bar');
cy.get('.pulp-section').get('.message-list');
});

it('should display "No Dependencies" when opening the tab', () => {
cy.visit(`${baseURL}/dependencies`);
cy.get('.body').contains('Dependencies');
cy.get('.body').contains('No dependencies');
cy.get('.pulp-section').contains('Dependencies');
cy.get('.pulp-section').contains('No dependencies');
});
});
34 changes: 17 additions & 17 deletions cypress/e2e/collections/collections-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const uiPrefix = Cypress.env('uiPrefix');

describe('Collections list Tests', () => {
function deprecate(list) {
const container = list ? '.hub-list' : '.hub-cards';
const container = list ? '.pulp-list' : '.pulp-cards';

cy.get('[data-cy=hub-list-toolbar]')
cy.get('[data-cy=pulp-list-toolbar]')
.get('[aria-label="keywords"]:first')
.type('my_collection0{enter}');
cy.get(container).contains('my_collection2').should('not.exist');
Expand Down Expand Up @@ -92,31 +92,31 @@ describe('Collections list Tests', () => {
it('paging', () => {
// there should be 11 items in db, 10 per page + 1 view more
cy.get('.collection-container')
.get('.hub-c-card-collection-container')
.get('.pulp-c-card-collection-container')
.should('have.length', 11);

cy.get('.hub-cards').get('[aria-label="Go to next page"]:first').click();
cy.get('.pulp-cards').get('[aria-label="Go to next page"]:first').click();
cy.get('.collection-container')
.get('.hub-c-card-collection-container')
.get('.pulp-c-card-collection-container')
.should('have.length', 1);
});

it('filter', () => {
cy.get('.hub-cards')
cy.get('.pulp-cards')
.get('[aria-label="keywords"]:first')
.type('my_collection0{enter}');
cy.get('.hub-cards').contains('my_collection0');
cy.get('.hub-cards').contains('my_collection1').should('not.exist');
cy.get('.pulp-cards').contains('my_collection0');
cy.get('.pulp-cards').contains('my_collection1').should('not.exist');
});

it('set page size', () => {
cy.get('.hub-cards')
cy.get('.pulp-cards')
.get('[data-ouia-component-type="PF5/Pagination"] button:first')
.click();
cy.get('.hub-cards').get('[data-action="per-page-20"]').click();
cy.get('.pulp-cards').get('[data-action="per-page-20"]').click();

cy.get('.collection-container')
.get('.hub-c-card-collection-container')
.get('.pulp-c-card-collection-container')
.should('have.length', 11);
});

Expand All @@ -128,11 +128,11 @@ describe('Collections list Tests', () => {

it('Can delete collection in collection list', () => {
cy.get('[data-cy="view_type_list"] svg').click();
cy.get('[data-cy=hub-list-toolbar]')
cy.get('[data-cy=pulp-list-toolbar]')
.get('[aria-label="keywords"]:first')
.type('my_collection0{enter}');
cy.get('.hub-list').contains('my_collection2').should('not.exist');
cy.get('.hub-list').contains('my_collection0');
cy.get('.pulp-list').contains('my_collection2').should('not.exist');
cy.get('.pulp-list').contains('my_collection0');

cy.get('.collection-container [aria-label="Actions"]').click();
cy.contains('Delete collection from system').click();
Expand All @@ -146,12 +146,12 @@ describe('Collections list Tests', () => {

it('Can delete collection in namespace collection list', () => {
cy.visit(`${uiPrefix}namespaces/my_namespace`);
cy.get('[data-cy=hub-list-toolbar]')
cy.get('[data-cy=pulp-list-toolbar]')
.get('[aria-label="keywords"]:first')
.type('my_collection1{enter}');

cy.get('.body').contains('my_collection1');
cy.get('.body [aria-label="Actions"]').click();
cy.get('.pulp-section').contains('my_collection1');
cy.get('.pulp-section [aria-label="Actions"]').click();
cy.contains('Delete collection from system').click();
cy.get('[data-cy=modal_checkbox] input').click();
cy.get('[data-cy=delete-button] button').click();
Expand Down
30 changes: 15 additions & 15 deletions cypress/e2e/namespaces/group-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,39 @@ describe('Group list tests for sorting, paging and filtering', () => {
});

it('paging', () => {
cy.get('.body').contains(items[0]);
cy.get('.pulp-section').contains(items[0]);

cy.get('.body').get('[aria-label="Go to next page"]:first').click();
cy.get('.body').contains(items[10]);
cy.get('.pulp-section').get('[aria-label="Go to next page"]:first').click();
cy.get('.pulp-section').contains(items[10]);

cy.get('.body').get('[aria-label="Go to next page"]:first').click();
cy.get('.body').contains(items[20]);
cy.get('.pulp-section').get('[aria-label="Go to next page"]:first').click();
cy.get('.pulp-section').contains(items[20]);
});

it('sorting', () => {
cy.get('.body').get('[data-cy="sort_name"]').click();
cy.get('.body tbody tr:first td:first').contains(items[20]);
cy.get('.body').contains(items[0]).should('not.exist');
cy.get('.pulp-section').get('[data-cy="sort_name"]').click();
cy.get('.pulp-section tbody tr:first td:first').contains(items[20]);
cy.get('.pulp-section').contains(items[0]).should('not.exist');
});

it('filter', () => {
cy.get('.body')
cy.get('.pulp-section')
.get('[placeholder="Filter by group name"]:first')
.type('group_test0{enter}');
cy.get('.body').contains('group_test0');
cy.get('.body').contains('group_test1').should('not.exist');
cy.get('.pulp-section').contains('group_test0');
cy.get('.pulp-section').contains('group_test1').should('not.exist');
});

it('set page size', () => {
cy.get('.body')
cy.get('.pulp-section')
.get('[data-ouia-component-type="PF5/Pagination"] button:first')
.click();
cy.get('.body').contains('20 per page').click();
cy.get('.pulp-section').contains('20 per page').click();

range(20).forEach((i) => {
cy.get('.body').contains(items[i]);
cy.get('.pulp-section').contains(items[i]);
});

cy.get('.body').contains(items[20]).should('not.exist');
cy.get('.pulp-section').contains(items[20]).should('not.exist');
});
});
2 changes: 1 addition & 1 deletion cypress/e2e/namespaces/group-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function removeUserFromGroupManually(groupName, userName) {
cy.contains('[data-cy=main-tabs]', userName).should('not.exist');
}

describe('Hub Group Management Tests', () => {
describe('Pulp Group Management Tests', () => {
before(() => {
cy.deleteTestGroups();
cy.deleteTestGroups();
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/namespaces/group-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Group Roles Tests', () => {
cy.get('[data-cy=add-roles]').click();

cy.get(
'.hub-custom-wizard-layout [data-ouia-component-type="PF5/Pagination"] button:first',
'.pulp-custom-wizard-layout [data-ouia-component-type="PF5/Pagination"] button:first',
).click();
cy.contains('100 per page').click();

Expand Down Expand Up @@ -118,9 +118,9 @@ describe('Group Roles Tests', () => {
cy.get('[data-cy=add-roles]').click();

cy.get(
'.hub-custom-wizard-layout [data-ouia-component-type="PF5/Pagination"] button:first',
'.pulp-custom-wizard-layout [data-ouia-component-type="PF5/Pagination"] button:first',
).click();
cy.get('.hub-custom-wizard-layout').contains('100 per page').click();
cy.get('.pulp-custom-wizard-layout').contains('100 per page').click();

cy.get(
`[data-cy="RoleListTable"] [data-cy="RoleListTable-CheckboxRow-row-${testRole.name}"] [type="checkbox"]`,
Expand All @@ -137,12 +137,12 @@ describe('Group Roles Tests', () => {
.click();

cy.get('.pf-v5-c-wizard').contains('Selected roles');
cy.get(`[data-cy="HubPermission-${testContainerRole.name}"]`);
cy.get(`[data-cy="PulpPermission-${testContainerRole.name}"]`);

cy.contains('Next').click();

cy.get('.hub-custom-wizard-layout').contains(groupName);
cy.get('.hub-custom-wizard-layout').contains(testContainerRole.name);
cy.get('.pulp-custom-wizard-layout').contains(groupName);
cy.get('.pulp-custom-wizard-layout').contains(testContainerRole.name);

cy.get('.pf-v5-c-wizard__footer > button')
.contains('Add')
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/namespaces/menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Hub Menu Tests', () => {
describe('Pulp Menu Tests', () => {
const username = 'nopermission';
const password = 'n0permissi0n';

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/namespaces/namespace-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('Namespace detail screen', () => {
cy.get(
'[data-cy="CollectionListItem"]:first button[aria-label="Actions"]',
).click();
cy.contains('.body ul a', 'Deprecate').click();
cy.contains('.pulp-section ul a', 'Deprecate').click();

// Reload the page
cy.visit(`${uiPrefix}namespaces/namespace_detail_test`);
Expand Down
Loading

0 comments on commit 67d3c51

Please sign in to comment.