Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed image url concatenations to use createUrlPath helper #2166

Merged
merged 43 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
63a98b1
change from "None" to "No category"
BohdanMylyi Jul 23, 2024
1e47e67
implement disabled state for none checked categories
BohdanMylyi Jul 24, 2024
8135c28
remove unnessesary code
BohdanMylyi Jul 24, 2024
d890191
rewrite LoginForm.jsx to tsx
BohdanMylyi Jul 28, 2024
423d653
replace UseSelector by UseAppSelector
BohdanMylyi Jul 28, 2024
d36821d
rewrite GoogleLogin to tsx format
BohdanMylyi Jul 29, 2024
f199784
rewrite OfferDetails to tsx format
BohdanMylyi Jul 29, 2024
7a5958e
rewrite LoginForm.jsx to tsx
BohdanMylyi Jul 28, 2024
f9a78a8
replace UseSelector by UseAppSelector
BohdanMylyi Jul 28, 2024
0400bb3
remove unnessesary handleCheckboxChange function
BohdanMylyi Jul 29, 2024
dc7e5af
remove unnessesary space
BohdanMylyi Jul 29, 2024
f0ee041
resolve merge conflict
BohdanMylyi Jul 29, 2024
4b09c96
Changed image url concatenations to use createUrlPath helper
ipasic-softserve Jul 25, 2024
a49075b
Update AccountIcon.tsx
ipasic-softserve Jul 25, 2024
c28b02a
Update createUrlPath in helper-functions.tsx
ipasic-softserve Jul 25, 2024
bd49284
code fix
BohdanMylyi Jul 29, 2024
809286e
remove unnessesary space
BohdanMylyi Jul 29, 2024
757a5aa
Fix sonar: refactor to use an optional chain expression
ipasic-softserve Jul 29, 2024
abcc8a1
Rewrote ProfileItem to tsx format (#2226)
PavloDolia Aug 1, 2024
de8efa5
Created tests for count-active-filters.tsx (#2191)
PavloDolia Aug 2, 2024
90688db
Rewrote DateFilter to tsx format and fixed sonar issues (#2240)
docia Aug 2, 2024
321a065
Rewrote SubjectsStep to tsx format (#2233)
PavloDolia Aug 2, 2024
80e18da
Rewrote FindBlock to tsx format (#2234)
PavloDolia Aug 2, 2024
0f90c1c
Rewrote ProfileDoneItemsList to tsx format (#2235)
PavloDolia Aug 2, 2024
1428ac8
Fixed privacy policy translation (#2153)
ipasic-softserve Aug 2, 2024
702daaa
Add an error tooltip for User Profile (#2164)
ipasic-softserve Aug 2, 2024
42c26ce
Fix error caused when category is cleared (#2205)
ipasic-softserve Aug 2, 2024
ba86982
Rewrote ProfileContainerMobile to tsx (#2220)
ipasic-softserve Aug 2, 2024
c7c80a8
Rewrote ProfileContainerDesktop to tsx (#2223)
ipasic-softserve Aug 2, 2024
8d6b06c
Merge pull request #2158 from ita-social-projects/bugfix/2113/change-…
BohdanMylyi Aug 2, 2024
671388e
Merge pull request #2236 from ita-social-projects/feature/2184/rewrit…
BohdanMylyi Aug 2, 2024
7dcfe1f
Merge pull request #2243 from ita-social-projects/feature/2183/rewrit…
BohdanMylyi Aug 2, 2024
49a43f8
Merge pull request #2245 from ita-social-projects/feature/2175/rewrit…
BohdanMylyi Aug 2, 2024
56919a2
Rewrote SearchInput to tsx (#2210)
ipasic-softserve Aug 2, 2024
c30c918
Rewrote VideoPresentation to tsx (#2212)
ipasic-softserve Aug 2, 2024
8abc624
Rewrote EmailConfirmModal to tsx (#2244)
ipasic-softserve Aug 2, 2024
c6cd921
Rewrote AdminNavBarItem to tsx (#2237)
ipasic-softserve Aug 2, 2024
8ad6d72
Rewrote SignupForm to tsx (#2238)
ipasic-softserve Aug 2, 2024
6d92eb6
Rebase develop into feature/1944/change-image-url-concatenation
ipasic-softserve Jul 25, 2024
7443e4b
Update AccountIcon.tsx
ipasic-softserve Jul 25, 2024
0c650a3
Update createUrlPath in helper-functions.tsx
ipasic-softserve Jul 25, 2024
05aed79
Fix sonar: refactor to use an optional chain expression
ipasic-softserve Jul 29, 2024
d6e48f2
Resolve conflicts
ipasic-softserve Aug 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/message/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ const Message: FC<MessageProps> = ({
const avatar = !isMyMessage && isAvatarVisible && (
<Link onClick={handleLinkClick} to={pathToProfile}>
<Avatar
src={photo && `${import.meta.env.VITE_APP_IMG_USER_URL}${photo}`}
src={
photo && createUrlPath(import.meta.env.VITE_APP_IMG_USER_URL, photo)
}
sx={spliceSx(styles.avatar, sx.avatar)}
/>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion src/components/user-profile-info/UserProfileInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const UserProfileInfo: FC<UserProfileInfoProps> = ({

const avatar = (
<Avatar
src={photo && `${import.meta.env.VITE_APP_IMG_USER_URL}${photo}`}
src={photo && createUrlPath(import.meta.env.VITE_APP_IMG_USER_URL, photo)}
sx={spliceSx(styles.avatar, sx.avatar)}
/>
)
Expand Down
3 changes: 2 additions & 1 deletion src/containers/about-chat-sidebar/AboutChatSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ const AboutChatSidebar: FC<AboutChatSidebarProps> = ({
<Box sx={styles.chatInfo}>
<Avatar
src={
photo && `${import.meta.env.VITE_APP_IMG_USER_URL}${photo}`
photo &&
createUrlPath(import.meta.env.VITE_APP_IMG_USER_URL, photo)
}
sx={styles.userAvatar}
/>
Expand Down
7 changes: 5 additions & 2 deletions src/containers/chat/chat-item/ChatItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
OverlapEnum,
PositionEnum
} from '~/types'
import { getFormattedDate } from '~/utils/helper-functions'
import { createUrlPath, getFormattedDate } from '~/utils/helper-functions'

interface ItemOfChatProps {
isActiveChat: boolean
Expand Down Expand Up @@ -84,7 +84,10 @@ const ChatItem: FC<ItemOfChatProps> = ({
overlap={OverlapEnum.Circular}
>
<Avatar
src={photo && `${import.meta.env.VITE_APP_IMG_USER_URL}${photo}`}
src={
photo &&
createUrlPath(import.meta.env.VITE_APP_IMG_USER_URL, photo)
}
sx={styles.img}
/>
</Badge>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { snackbarVariants } from '~/constants'
import { imageResize } from '~/utils/image-resize'
import { styles } from '~/containers/edit-profile/profile-tab/profile-tab-form/ProfileTabForm.styles'
import { openAlert } from '~/redux/features/snackbarSlice'
import { createUrlPath } from '~/utils/helper-functions'

export interface ProfileTabFormProps {
data: EditProfileForm
Expand Down Expand Up @@ -106,7 +107,7 @@ const ProfileTabForm: FC<ProfileTabFormProps> = ({
const { photo } = data
const photoToDisplay =
typeof photo === 'string'
? photo && `${import.meta.env.VITE_APP_IMG_USER_URL}${photo}`
? photo && createUrlPath(import.meta.env.VITE_APP_IMG_USER_URL, photo)
: photo?.src

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ const MyCooperationsDetails = () => {
<Avatar
src={
offer.author.photo &&
`${import.meta.env.VITE_APP_IMG_USER_URL}${offer.author.photo}`
createUrlPath(
import.meta.env.VITE_APP_IMG_USER_URL,
offer.author.photo
)
}
/>
<Typography sx={style.profileName}>
Expand Down
6 changes: 5 additions & 1 deletion src/containers/navigation-icons/AccountIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { defaultResponses } from '~/constants'
import { styles } from '~/containers/navigation-icons/NavigationIcons.styles'

import { UserResponse, UserRole } from '~/types'
import { createUrlPath } from '~/utils/helper-functions'

interface AccountIconProps {
openMenu: (event: MouseEvent) => void
Expand Down Expand Up @@ -45,7 +46,10 @@ const AccountIcon: FC<AccountIconProps> = ({ openMenu }) => {
<Avatar
alt='User Avatar'
onClick={openMenu}
src={`${import.meta.env.VITE_APP_IMG_USER_URL}${photo}`}
src={
photo &&
createUrlPath(import.meta.env.VITE_APP_IMG_USER_URL || '', photo)
}
sx={styles.accountIcon}
>
{!loading && firstName && lastName && `${firstName[0]}${lastName[0]}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import AppChipList from '~/components/app-chips-list/AppChipList'
import ProfileDoneItemsList from '~/components/icon-with-text-list/ProfileDoneItemsList'

import { styles } from '~/containers/user-profile/profile-info/ProfileInfo.styles'
import { createUrlPath } from '~/utils/helper-functions'

const ProfileContainerDesktop = ({
userData,
Expand All @@ -24,7 +25,7 @@ const ProfileContainerDesktop = ({
<Avatar
src={
userData.photo &&
`${import.meta.env.VITE_APP_IMG_USER_URL}${userData.photo}`
createUrlPath(import.meta.env.VITE_APP_IMG_USER_URL, userData.photo)
}
sx={styles.img}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import AppChipList from '~/components/app-chips-list/AppChipList'
import ProfileDoneItemsList from '~/components/icon-with-text-list/ProfileDoneItemsList'

import { styles } from '~/containers/user-profile/profile-info/ProfileInfo.styles'
import { createUrlPath } from '~/utils/helper-functions'

const ProfileContainerMobile = ({
actionIcon,
Expand All @@ -25,7 +26,10 @@ const ProfileContainerMobile = ({
<Avatar
src={
userData.photo &&
`${import.meta.env.VITE_APP_IMG_USER_URL}${userData.photo}`
createUrlPath(
import.meta.env.VITE_APP_IMG_USER_URL,
userData.photo
)
}
sx={styles.img}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/helper-functions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const createUrlPath = (
query = {}
) => {
let trimmedUrl = URL
while (trimmedUrl.endsWith('/')) {
while (trimmedUrl && trimmedUrl.endsWith('/')) {
trimmedUrl = trimmedUrl.slice(0, -1)
}

Expand Down
Loading