Skip to content

Commit

Permalink
feat: work
Browse files Browse the repository at this point in the history
  • Loading branch information
web-mi committed Feb 1, 2024
1 parent 751cae3 commit 4b88d6a
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 79 deletions.
25 changes: 20 additions & 5 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,13 +840,28 @@ module.exports = function (webpackEnv) {
console.log(
`Overwritten ${originalPath} -> ${newPath}${originalExt}`
);
result.request = `${newPath}${originalExt}`;
result.request = result.request.replace(
originalPath,
`${newPath}${originalExt}`
);
result.context = path.dirname(
`${newPath}.${originalExt}`
`${newPath}${originalExt}`
);

//result.createData.resource = `${newPath}${originalExt}`;
//result.createData.context = path.dirname(`${newPath}.${originalExt}`);
if (result.createData.request) {
result.createData.resource =
result.createData.resource.replace(
paths.appSrc,
paths.appExtensions
);
result.createData.request =
result.createData.request.replace(
originalPath,
`${newPath}`
);
result.createData.context = path.dirname(
`${newPath}${originalExt}`
);
}
} else {
console.log(
`No createData ${originalPath} -> ${newPath}${originalExt}`
Expand Down
81 changes: 11 additions & 70 deletions src/components/askerInfo/AskerInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import * as React from 'react';
import { useCallback, useContext, useEffect, useState } from 'react';
import { useContext, useEffect } from 'react';
import { Link, useParams, useHistory } from 'react-router-dom';
import {
SESSION_LIST_TAB,
SESSION_LIST_TYPES
} from '../session/sessionHelpers';
import {
AUTHORITIES,
hasUserAuthority,
SessionTypeContext,
TenantContext,
UserDataContext
} from '../../globalState';
import { SESSION_LIST_TAB } from '../session/sessionHelpers';
import { SessionTypeContext } from '../../globalState';
import { Loading } from '../app/Loading';
import { AskerInfoData } from './AskerInfoData';
import { ReactComponent as BackIcon } from '../../resources/img/icons/arrow-left.svg';
import { ReactComponent as PersonIcon } from '../../resources/img/icons/person.svg';
import { AskerInfoAssign } from './AskerInfoAssign';
import '../profile/profile.styles';
import './askerInfo.styles';
import { ActiveSessionContext } from '../../globalState/provider/ActiveSessionProvider';
Expand All @@ -29,38 +18,29 @@ import {
mobileUserProfileView
} from '../app/navigationHandler';
import { useTranslation } from 'react-i18next';
import { AskerInfoTools } from './AskerInfoTools';
import { Box } from '../box/Box';
import { RocketChatUsersOfRoomProvider } from '../../globalState/provider/RocketChatUsersOfRoomProvider';
import { AskerInfoContent } from './AskerInfoContent';

export const AskerInfo = () => {
const { t: translate } = useTranslation();
const { tenant } = useContext(TenantContext);
const { rcGroupId: groupIdFromParam } = useParams<{ rcGroupId: string }>();
const history = useHistory();

const { userData } = useContext(UserDataContext);
const { type, path: listPath } = useContext(SessionTypeContext);
const { path: listPath } = useContext(SessionTypeContext);

const { session: activeSession, ready } = useSession(groupIdFromParam);
const [isPeerChat, setIsPeerChat] = useState(false);

const sessionListTab = useSearchParam<SESSION_LIST_TAB>('sessionListTab');

useEffect(() => {
if (!ready) {
if (!ready || activeSession) {
return;
}

if (!activeSession) {
history.push(
listPath +
(sessionListTab ? `?sessionListTab=${sessionListTab}` : '')
);
return;
}

setIsPeerChat(activeSession.item.isPeerChat);
history.push(
listPath +
(sessionListTab ? `?sessionListTab=${sessionListTab}` : '')
);
}, [activeSession, history, listPath, ready, sessionListTab]);

const { fromL } = useResponsive();
Expand All @@ -74,31 +54,6 @@ export const AskerInfo = () => {
desktopView();
}, [fromL]);

const isSessionAssignAvailable = useCallback(
() =>
!hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) &&
!activeSession.isLive &&
!activeSession.isGroup &&
((type === SESSION_LIST_TYPES.ENQUIRY &&
hasUserAuthority(
AUTHORITIES.ASSIGN_CONSULTANT_TO_ENQUIRY,
userData
) &&
isPeerChat) ||
(type !== SESSION_LIST_TYPES.ENQUIRY &&
((isPeerChat &&
hasUserAuthority(
AUTHORITIES.ASSIGN_CONSULTANT_TO_PEER_SESSION,
userData
)) ||
(!isPeerChat &&
hasUserAuthority(
AUTHORITIES.ASSIGN_CONSULTANT_TO_SESSION,
userData
))))),
[activeSession, isPeerChat, type, userData]
);

if (!activeSession) {
return <Loading></Loading>;
}
Expand Down Expand Up @@ -150,21 +105,7 @@ export const AskerInfo = () => {
<h2>{activeSession.user.username}</h2>
</div>
<div className="askerInfo__content">
<Box>
<AskerInfoData />
</Box>
{tenant?.settings?.featureToolsEnabled && (
<Box>
<AskerInfoTools />
</Box>
)}
{isSessionAssignAvailable() && (
<Box>
<div className="askerInfo__assign">
<AskerInfoAssign />
</div>
</Box>
)}
<AskerInfoContent />
</div>
</div>
</div>
Expand Down
71 changes: 71 additions & 0 deletions src/components/askerInfo/AskerInfoContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import * as React from 'react';
import { useCallback, useContext } from 'react';
import { SESSION_LIST_TYPES } from '../session/sessionHelpers';
import {
AUTHORITIES,
hasUserAuthority,
SessionTypeContext,
TenantContext,
UserDataContext
} from '../../globalState';
import { AskerInfoData } from './AskerInfoData';
import { AskerInfoAssign } from './AskerInfoAssign';
import '../profile/profile.styles';
import './askerInfo.styles';
import { ActiveSessionContext } from '../../globalState/provider/ActiveSessionProvider';
import { AskerInfoTools } from './AskerInfoTools';
import { Box } from '../box/Box';

export const AskerInfoContent = () => {
const { tenant } = useContext(TenantContext);
const { activeSession } = useContext(ActiveSessionContext);
const { userData } = useContext(UserDataContext);

const { type } = useContext(SessionTypeContext);

const isSessionAssignAvailable = useCallback(() => {
const isPeerChat = activeSession.item.isPeerChat;
return (
!hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) &&
!activeSession.isLive &&
!activeSession.isGroup &&
((type === SESSION_LIST_TYPES.ENQUIRY &&
hasUserAuthority(
AUTHORITIES.ASSIGN_CONSULTANT_TO_ENQUIRY,
userData
) &&
isPeerChat) ||
(type !== SESSION_LIST_TYPES.ENQUIRY &&
((isPeerChat &&
hasUserAuthority(
AUTHORITIES.ASSIGN_CONSULTANT_TO_PEER_SESSION,
userData
)) ||
(!isPeerChat &&
hasUserAuthority(
AUTHORITIES.ASSIGN_CONSULTANT_TO_SESSION,
userData
)))))
);
}, [activeSession, type, userData]);

return (
<>
<Box>
<AskerInfoData />
</Box>
{tenant?.settings?.featureToolsEnabled && (
<Box>
<AskerInfoTools />
</Box>
)}
{isSessionAssignAvailable() && (
<Box>
<div className="askerInfo__assign">
<AskerInfoAssign />
</div>
</Box>
)}
</>
);
};
2 changes: 2 additions & 0 deletions src/components/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface CheckboxItem {
labelId: string;
labelClass?: string;
label: string;
value?: string;
description?: string;
checked: boolean;
}
Expand All @@ -24,6 +25,7 @@ export const Checkbox = (props) => {
className="checkbox__input"
type="checkbox"
name={checkboxItem.name}
value={checkboxItem.value}
defaultChecked={checkboxItem.checked}
/>
{checkboxItem.checked && (
Expand Down
2 changes: 2 additions & 0 deletions src/components/sessionAssign/RequestSessionAssign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ export const RequestSessionAssign = (props: { value?: string }) => {
return (
<div className="assign__wrapper">
<SelectDropdown
menuShouldBlockScroll
menuPosition="fixed"
{...prepareSelectDropdown({
consultantList,
handleDatalistSelect,
Expand Down
51 changes: 48 additions & 3 deletions src/containers/bookings/components/booking.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $headerHeight: 80px;

&__header {
display: flex;
flex: 0;
align-items: center;
justify-content: space-between;
padding: $grid-base-three;
Expand Down Expand Up @@ -116,12 +117,17 @@ $headerHeight: 80px;
}
}

&__wrapper {
display: flex;
flex-direction: column;
}

&__innerWrapper {
display: flex;
flex: 1;
flex-direction: column;
padding: 0 $grid-base-three;
overflow-x: hidden;
height: 100%;

&-event {
display: grid;
Expand Down Expand Up @@ -217,6 +223,7 @@ $headerHeight: 80px;
}

p {
word-break: normal;
margin-left: 0.5rem;
}
}
Expand Down Expand Up @@ -372,10 +379,34 @@ $headerHeight: 80px;

&__video-link-grid {
display: none;
grid-template-columns: 0.465fr 1fr 0.42fr;
grid-template-columns: 0.29fr 1fr 0.42fr;
min-height: 32px;
align-items: flex-end;

@media only screen and (min-width: 950px) {

Check failure on line 386 in src/containers/bookings/components/booking.styles.scss

View workflow job for this annotation

GitHub Actions / stylelint

src/containers/bookings/components/booking.styles.scss#L386

Expected "context" media feature range notation (media-feature-range-notation)
grid-template-columns: 0.33fr 1fr 0.42fr;
}

@media only screen and (min-width: 1010px) {

Check failure on line 390 in src/containers/bookings/components/booking.styles.scss

View workflow job for this annotation

GitHub Actions / stylelint

src/containers/bookings/components/booking.styles.scss#L390

Expected "context" media feature range notation (media-feature-range-notation)
grid-template-columns: 0.35fr 1fr 0.42fr;
}

@media only screen and (min-width: 1050px) {

Check failure on line 394 in src/containers/bookings/components/booking.styles.scss

View workflow job for this annotation

GitHub Actions / stylelint

src/containers/bookings/components/booking.styles.scss#L394

Expected "context" media feature range notation (media-feature-range-notation)
grid-template-columns: 0.37fr 1fr 0.42fr;
}

@media only screen and (min-width: 1075px) {

Check failure on line 398 in src/containers/bookings/components/booking.styles.scss

View workflow job for this annotation

GitHub Actions / stylelint

src/containers/bookings/components/booking.styles.scss#L398

Expected "context" media feature range notation (media-feature-range-notation)
grid-template-columns: 0.43fr 1fr 0.42fr;
}

@media only screen and (min-width: 1095px) {

Check failure on line 402 in src/containers/bookings/components/booking.styles.scss

View workflow job for this annotation

GitHub Actions / stylelint

src/containers/bookings/components/booking.styles.scss#L402

Expected "context" media feature range notation (media-feature-range-notation)
grid-template-columns: 0.44fr 1fr 0.42fr;
}

@media only screen and (min-width: 1200px) {

Check failure on line 406 in src/containers/bookings/components/booking.styles.scss

View workflow job for this annotation

GitHub Actions / stylelint

src/containers/bookings/components/booking.styles.scss#L406

Expected "context" media feature range notation (media-feature-range-notation)
grid-template-columns: 0.465fr 1fr 0.42fr;
}

@include breakpoint($fromXXLarge) {
grid-template-columns: 0.48fr 1fr 0.405fr;
}
Expand All @@ -393,6 +424,13 @@ $headerHeight: 80px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
position: relative;
left: 20px;

@media only screen and (min-width: 1077px) {

Check failure on line 430 in src/containers/bookings/components/booking.styles.scss

View workflow job for this annotation

GitHub Actions / stylelint

src/containers/bookings/components/booking.styles.scss#L430

Expected "context" media feature range notation (media-feature-range-notation)
position: initial;
left: 0;
}
}

@include breakpoint($fromLarge) {
Expand All @@ -401,7 +439,14 @@ $headerHeight: 80px;
align-items: center;

svg {
margin-left: 0.75rem;
position: relative;
right: -50px;

@media only screen and (min-width: 1077px) {

Check failure on line 445 in src/containers/bookings/components/booking.styles.scss

View workflow job for this annotation

GitHub Actions / stylelint

src/containers/bookings/components/booking.styles.scss#L445

Expected "context" media feature range notation (media-feature-range-notation)
position: initial;
right: 0;
margin-left: 0.75rem;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/resources/scripts/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import deAgency from '../i18n/de/agency.json';
import deConsultingTypes from '../i18n/de/consultingTypes.json';
import { AppConfigInterface } from '../../globalState/interfaces/AppConfig/AppConfigInterface';
import { AppConfigInterface } from '../../globalState';
import {
OVERLAY_RELEASE_NOTE,
OVERLAY_TWO_FACTOR_NAG
Expand Down

0 comments on commit 4b88d6a

Please sign in to comment.