Skip to content

Commit

Permalink
feat(additionalEnquiry): wip, new profile routes
Browse files Browse the repository at this point in the history
  • Loading branch information
koepferd committed Nov 13, 2024
1 parent f595f61 commit 0442eb8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/profile/profile.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
import { EmailNotification } from './EmailNotifications';
import { BrowserNotification } from './BrowserNotifications';
import { browserNotificationsSettings } from '../../utils/notificationHelpers';
import { AdditionalEnquiry } from './AdditionalEnquiry/AdditionalEnquiry';
import { consultingTypeSelectOptionsSet } from './profileHelpers';

const shouldShowOverview = (useOverviewPage: boolean, userData) =>
useOverviewPage &&
Expand Down Expand Up @@ -114,6 +116,21 @@ const profileRoutes = (
boxed: false,
order: 2,
column: COLUMN_RIGHT
},
{
condition: (userData, consultingTypes) =>
!hasUserAuthority(
AUTHORITIES.CONSULTANT_DEFAULT,
userData
) &&
consultingTypeSelectOptionsSet(
userData,
consultingTypes
).length >
0 /* TODO check condition inside component */,
component: AdditionalEnquiry,
order: 3,
column: COLUMN_RIGHT
}
]
},
Expand Down
25 changes: 25 additions & 0 deletions src/components/profile/profileHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { apiGetTenantAgenciesTopics } from '../../api/apiGetTenantAgenciesTopics';

Check warning on line 1 in src/components/profile/profileHelpers.ts

View workflow job for this annotation

GitHub Actions / ESLint

src/components/profile/profileHelpers.ts#L1

'apiGetTenantAgenciesTopics' is defined but never used (@typescript-eslint/no-unused-vars)
import { getConsultingType } from '../../globalState';
import {
UserDataInterface,
Expand Down Expand Up @@ -49,10 +50,34 @@ export const getConsultingTypesForRegistrationStatus = (
});
};

//TODO can be removed or move again here?
export const consultingTypeSelectOptionsSet = (
userData: UserDataInterface,
consultingTypes: Array<ConsultingTypeBasicInterface>
) => {
// let topics;
// apiGetTenantAgenciesTopics()
// .then((response) => {
// // const consultants = prepareConsultantDataForSelect(response);
// topics = response;
// console.log('response', response);
// })
// .catch((error) => {
// console.log(error);
// });

// let topics;
// apiGeTenantAgenciesTopics()
// .then((response) => {
// // const consultants = prepareConsultantDataForSelect(response);
// topics = response;
// })
// .catch((error) => {
// console.log(error);
// });

// // const topics = apiGeTenantAgenciesTopics().then((resp: any) => resp);
// console.log('HEY topics: ', topics);
const unregisteredConsultingTypesData =
getConsultingTypesForRegistrationStatus(
userData,
Expand Down

0 comments on commit 0442eb8

Please sign in to comment.