diff --git a/cypress/e2e/organizations/overview.cy.ts b/cypress/e2e/organizations/overview.cy.ts index a02daa23..18debc2e 100644 --- a/cypress/e2e/organizations/overview.cy.ts +++ b/cypress/e2e/organizations/overview.cy.ts @@ -23,7 +23,7 @@ describe('Organization overview page', () => { overview.doQuotaFieldCheck(); }); - it.only('Changes org friendly name/description', () => { + it('Changes org friendly name/description', () => { registerIdleHandler('idle'); overview.changeOrgFriendlyname(testData.organizations.overview.friendlyName); diff --git a/cypress/e2e/rbac/developer.cy.ts b/cypress/e2e/rbac/developer.cy.ts index da29806a..a12fc488 100644 --- a/cypress/e2e/rbac/developer.cy.ts +++ b/cypress/e2e/rbac/developer.cy.ts @@ -114,7 +114,7 @@ describe('DEVELOPER permission test suites', () => { environmentOverview.doDeleteEnvironmentError('main'); }); - it('Deletes stating environment', () => { + it('Deletes staging environment', () => { cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-staging`); cy.intercept('POST', Cypress.env('api'), req => { @@ -147,7 +147,7 @@ describe('DEVELOPER permission test suites', () => { }); it('Fails to cancel any deployment - no permission to CANCEL for DEVELOPER', () => { - cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-staging/deployments`); + cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); registerIdleHandler('idle'); diff --git a/cypress/e2e/rbac/guest.cy.ts b/cypress/e2e/rbac/guest.cy.ts index 6a5679f6..0bed5fe7 100644 --- a/cypress/e2e/rbac/guest.cy.ts +++ b/cypress/e2e/rbac/guest.cy.ts @@ -146,7 +146,7 @@ describe('GUEST permission test suites', () => { }); it('Fails to do cancel a deployment - no permission for GUEST', () => { - cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-staging/deployments`); + cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); registerIdleHandler('idle'); cy.intercept('POST', Cypress.env('api'), req => { diff --git a/cypress/e2e/rbac/maintainer.cy.ts b/cypress/e2e/rbac/maintainer.cy.ts index 9809a2b2..e7492e52 100644 --- a/cypress/e2e/rbac/maintainer.cy.ts +++ b/cypress/e2e/rbac/maintainer.cy.ts @@ -136,7 +136,7 @@ describe('MAINTAINER permission test suites', () => { environmentOverview.doDeleteEnvironmentError('main'); }); - it('Deletes stating environment', () => { + it('Deletes staging environment', () => { cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-staging`); cy.intercept('POST', Cypress.env('api'), req => { @@ -169,7 +169,7 @@ describe('MAINTAINER permission test suites', () => { }); it('Cancels a staging deployment', () => { - cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-staging/deployments`); + cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); registerIdleHandler('idle'); diff --git a/cypress/e2e/rbac/reporter.cy.ts b/cypress/e2e/rbac/reporter.cy.ts index 48c90573..4f916a7b 100644 --- a/cypress/e2e/rbac/reporter.cy.ts +++ b/cypress/e2e/rbac/reporter.cy.ts @@ -143,7 +143,7 @@ describe('REPORTER permission test suites', () => { }); it('Fails to do cancel a deployment - no permission for REPORTER', () => { - cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-staging/deployments`); + cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); registerIdleHandler('idle'); @@ -168,6 +168,8 @@ describe('REPORTER permission test suites', () => { cy.waitForNetworkIdle('@idle', 500); deployment.navigateToRunningDeployment(); + + cy.waitForNetworkIdle('@idle', 500); deployment.doFailedCancelDeployment(); }); }); diff --git a/cypress/support/actions/organizations/OverviewAction.ts b/cypress/support/actions/organizations/OverviewAction.ts index d087f5b0..0742173c 100644 --- a/cypress/support/actions/organizations/OverviewAction.ts +++ b/cypress/support/actions/organizations/OverviewAction.ts @@ -34,7 +34,8 @@ export default class OverviewAction { changeOrgFriendlyname(friendlyName: string) { overviewRepo.getNameEditButton('edit-name').click(); - overviewRepo.getEditField().type(friendlyName); + + overviewRepo.getEditField().clear().type(friendlyName); overviewRepo.getSubmitButton().click(); cy.wait('@gqlupdateOrganizationFriendlyNameMutation'); @@ -53,7 +54,7 @@ export default class OverviewAction { } doFailedChangeOrgFriendlyname(friendlyName: string) { overviewRepo.getNameEditButton('edit-name').click(); - overviewRepo.getEditField().type(friendlyName); + overviewRepo.getEditField().clear().type(friendlyName); overviewRepo.getSubmitButton().click(); cy.wait('@gqlupdateOrganizationFriendlyNameMutation').then(interception => { @@ -68,7 +69,7 @@ export default class OverviewAction { changeOrgDescription(description: string) { overviewRepo.getDescEditButton('edit-description').click(); - overviewRepo.getEditField().type(description); + overviewRepo.getEditField().clear().type(description); overviewRepo.getSubmitButton().click(); cy.wait('@gqlupdateOrganizationFriendlyNameMutation'); @@ -85,7 +86,7 @@ export default class OverviewAction { } doFailedChangeOrgDescription(description: string) { overviewRepo.getDescEditButton('edit-description').click(); - overviewRepo.getEditField().type(description); + overviewRepo.getEditField().clear().type(description); overviewRepo.getSubmitButton().click(); cy.wait('@gqlupdateOrganizationFriendlyNameMutation').then(interception => { diff --git a/cypress/support/actions/organizations/ProjectsActions.ts b/cypress/support/actions/organizations/ProjectsActions.ts index 98bbc50b..18547b44 100644 --- a/cypress/support/actions/organizations/ProjectsActions.ts +++ b/cypress/support/actions/organizations/ProjectsActions.ts @@ -17,7 +17,7 @@ export default class ProjectsActions { projects.selectTarget(); - projects.getAddConfirm().click(); + projects.getAddConfirm().click({ force: true }); cy.wait('@gqladdProjectToOrganizationMutation'); @@ -32,7 +32,7 @@ export default class ProjectsActions { projects.selectTarget(); - projects.getAddConfirm().click(); + projects.getAddConfirm().click({ force: true }); cy.wait('@gqladdProjectToOrganizationMutation').then(interception => { expect(interception.response?.statusCode).to.eq(200); diff --git a/src/components/Organizations/NewProject/StyledNewProject.tsx b/src/components/Organizations/NewProject/StyledNewProject.tsx index ace03180..a5148fd5 100644 --- a/src/components/Organizations/NewProject/StyledNewProject.tsx +++ b/src/components/Organizations/NewProject/StyledNewProject.tsx @@ -20,6 +20,9 @@ export const StyledNewProject = styled.div` .form-box { margin-bottom: 1rem; + &.spacetop { + margin-top: 1rem; + } } .docs-link { diff --git a/src/components/Organizations/NewProject/index.js b/src/components/Organizations/NewProject/index.js index fd38b7ee..36c2ce42 100644 --- a/src/components/Organizations/NewProject/index.js +++ b/src/components/Organizations/NewProject/index.js @@ -72,6 +72,9 @@ const OrgNewProject = ({ refresh, }) => { const [addUserToProject, setAddUserToProject] = React.useState(true); + const [pullRequests, setPullRequests] = React.useState(''); + const [branches, setBranches] = React.useState(''); + return (
@@ -95,6 +98,8 @@ const OrgNewProject = ({ setProjectName({ target: { value: '' } }); setGitURL({ target: { value: '' } }); setProdEnv({ target: { value: '' } }); + setPullRequests(''); + setBranches(''); setSelectedDeployTarget({ target: { value: '' } }); closeModal(); }); @@ -174,6 +179,74 @@ const OrgNewProject = ({ /> + +
+ +
+ +
+ +
+ Add my user to this project +
@@ -219,7 +293,7 @@ const OrgNewProject = ({ inputGitURL.indexOf(' ') > 0 || inputProdEnv === '' || inputProdEnv.indexOf(' ') > 0 || - selectedDeployTarget === undefined + selectedDeployTarget == undefined } action={() => { addGroupProject({ @@ -230,6 +304,8 @@ const OrgNewProject = ({ productionEnvironment: inputProdEnv, organization: parseInt(organizationId, 10), addOrgOwner: addUserToProject, + ...(pullRequests ? { pullRequests } : {}), + ...(branches ? { branches } : {}), }, }); }} diff --git a/src/components/Organizations/Organization/index.js b/src/components/Organizations/Organization/index.js index ddc226e6..6c413d08 100644 --- a/src/components/Organizations/Organization/index.js +++ b/src/components/Organizations/Organization/index.js @@ -48,10 +48,10 @@ const Organization = ({ organization, refetch }) => { } const [nameModalOpen, setNameModalOpen] = useState(false); - const [friendlyName, setFriendlyName] = useState(''); + const [friendlyName, setFriendlyName] = useState(organization.friendlyName); const [descModalOpen, setDescModalOpen] = useState(false); - const [description, setDescription] = useState(''); + const [description, setDescription] = useState(organization.description); const quotaDisplay = (quota, quotaNumber, quotaLimit, showLink = true) => { const pluralName = quota + 's'; @@ -93,9 +93,29 @@ const Organization = ({ organization, refetch }) => { }; const renderEditBtn = type => ( - + { + if (type === 'name') { + setFriendlyName(organization.friendlyName); + } + if (type === 'description') { + setDescription(organization.description); + } + + modalAction('open', type)(); + }} + /> ); + const handleFriendlyNameChange = e => { + setFriendlyName(e.target.value); + }; + + const handleDescriptionChange = e => { + setDescription(e.target.value); + }; return ( @@ -117,12 +137,12 @@ const Organization = ({ organization, refetch }) => {
@@ -188,12 +208,12 @@ const Organization = ({ organization, refetch }) => {
diff --git a/src/layouts/GlobalStyles/index.tsx b/src/layouts/GlobalStyles/index.tsx index 815bc326..401b7a36 100644 --- a/src/layouts/GlobalStyles/index.tsx +++ b/src/layouts/GlobalStyles/index.tsx @@ -41,6 +41,21 @@ body { .ant-tooltip-content .ant-tooltip-inner{ color: ${props => (props.theme.colorScheme === 'dark' ? '#000' : '#fff')}; background: ${props => (props.theme.colorScheme === 'dark' ? '#fff' : '#000')}; + + .tooltiplist{ + margin-left: 0.812rem; + li{ + margin-bottom: initial; + padding-left: 0; + list-style: disc; + } + } + } + &.lg{ + .ant-tooltip-content{ + width:max-content; + } + } } .componentTooltip {