Skip to content

Commit

Permalink
fix: Missing Subscription and Slack in menus
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCizmar committed Dec 10, 2024
1 parent 1a77dbf commit d900bf4
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 36 deletions.
47 changes: 47 additions & 0 deletions e2e/cypress/e2e/organizations/apps/slack.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import {
login,
setBypassSeatCountCheck,
} from '../../../common/apiCalls/common';
import { organizationTestData } from '../../../common/apiCalls/testData/testData';
import { gcy } from '../../../common/shared';
import { HOST } from '../../../common/constants';

describe('Slack', () => {
let organizationData: Record<string, { slug: string }>;

beforeEach(() => {
setBypassSeatCountCheck(true);
login();
organizationTestData.clean();
organizationTestData.generate().then((res) => {
organizationData = res.body as any;
visitProfile('Tolgee');
});
});

afterEach(() => {
setBypassSeatCountCheck(false);
});

it('slack app settings exist', () => {
gcy('organization-side-menu').contains('Apps').click();
cy.contains('Slack').should('be.visible');
});

after(() => {
organizationTestData.clean();
});

const visitProfile = (name: string) => {
visitPath(name, `/profile`);
};

function visitSlug(slug: string, path: string) {
cy.visit(`${HOST}/organizations/${slug}${path}`);
}

const visitPath = (name: string, path: string) => {
const slug = organizationData[name].slug;
visitSlug(slug, path);
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ export const UserPresentAvatarMenu: React.FC = () => {
</MenuItem>
))}

{billingMenuItems}
{billingMenuItems.map((Item, index) => (
<Item key={index} onClose={handleClose} />
))}

<OrganizationSwitch
onSelect={handleSelectOrganization}
Expand Down
34 changes: 0 additions & 34 deletions webapp/src/eeSetup/eeModule.ee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,40 +263,6 @@ export const useAddUserMenuItems = () => {
);
};

export const useAddEeBatchOperations = () => {
const taskCount = useUserTaskCount();
return addUserMenuItems(
[
{
Component: ({ onClose }) => {
const { t } = useTranslate();

return (
<MenuItem
component={Link}
to={LINKS.MY_TASKS.build()}
selected={location.pathname === LINKS.MY_TASKS.build()}
onClick={onClose}
data-cy="user-menu-my-tasks"
sx={{
display: 'flex',
justifyContent: 'space-between',
paddingRight: 3,
}}
>
<Box>{t('user_menu_my_tasks')}</Box>
<Badge badgeContent={taskCount} color="primary" />
</MenuItem>
);
},
enabled: true,
id: 'mu-tasks',
},
],
{ position: 'start' }
);
};

export const useAddProjectMenuItems = () => {
const { t } = useTranslate();

Expand Down
4 changes: 3 additions & 1 deletion webapp/src/views/organizations/apps/OrganizationAppsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const OrganizationAppsView: FunctionComponent = () => {
hideChildrenOnLoading={false}
maxWidth="normal"
>
{apps}
{apps.map((App, index) => (
<App key={index} />
))}
</BaseOrganizationSettingsView>
);
};

0 comments on commit d900bf4

Please sign in to comment.