Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 7dac2b8

Browse files
author
sanju singh
committed
Merge branch 'develop' into issue-45-fix
2 parents 8efad3b + c41c92f commit 7dac2b8

File tree

14 files changed

+87
-30
lines changed

14 files changed

+87
-30
lines changed

client/src/components/AddToGroupModal/Group/style.module.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
height: 45px;
1111
padding: 0 30px;
1212
position: relative;
13+
justify-content: space-between;
1314

1415
&:last-child {
1516
border-bottom: 1px solid $lightGray2;
@@ -22,8 +23,3 @@
2223
max-width: 400px;
2324
white-space: nowrap;
2425
}
25-
26-
.switch {
27-
position: absolute;
28-
right: 30px;
29-
}

client/src/components/AddToGroupModal/index.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
111111

112112
const newGroup = await groupLib.createGroup(apiClient, groupName);
113113

114-
if (newGroup.id) {
114+
if (newGroup && newGroup.id) {
115115
const newOtherGroups = JSON.parse(JSON.stringify(otherGroups));
116116

117117
newOtherGroups.push(newGroup);
@@ -121,6 +121,8 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
121121
alert(`Group with name ${groupName} created successfully`);
122122

123123
setFilter("");
124+
} else if (newGroup.message) {
125+
alert(newGroup.message);
124126
} else {
125127
alert("Group creation failed");
126128
}
@@ -129,7 +131,11 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
129131
};
130132

131133
return (
132-
<Modal onCancel={onCancel}>
134+
<Modal
135+
onCancel={onCancel}
136+
className={style.container}
137+
overlayClassName={style.overlay}
138+
>
133139
<h1 className={style.title}>Add to Group</h1>
134140
<div className={style.searchRow}>
135141
<ZoomIcon className={style.zoomIcon} />

client/src/components/AddToGroupModal/style.module.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
@import "../../styles/mixins";
22

3+
.container {
4+
z-index: 1100;
5+
}
6+
7+
.overlay {
8+
z-index: 1010;
9+
}
10+
311
.buttons {
412
display: flex;
513
justify-content: flex-end;

client/src/components/GroupsSideMenu/filters.module.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
.groupTabFiltersContentSearchCreate {
5353
align-self: flex-end;
54-
margin-left: auto;
54+
margin-left: 15px;
5555
}
5656

5757
.groupTabGroupsContainer {
@@ -83,13 +83,13 @@
8383

8484
.sectionItem {
8585
cursor: pointer;
86-
height: 24px;
8786
width: 322px;
8887
border-radius: 10px;
8988
border: 1px solid gray1_025;
9089

9190
display: flex;
9291
flex-direction: row;
92+
align-items: center;
9393
padding-left: 17px;
9494
padding-top: 13px;
9595
padding-bottom: 13px;
@@ -101,12 +101,13 @@
101101
}
102102

103103
.sectionItemTitle {
104-
align-self: flex-start;
105104
color: gray2;
105+
word-break: break-word;
106+
padding-right: 12px;
106107
}
107108

108109
.sectionItemBadge {
109-
align-self: flex-start;
110+
align-self: center;
110111
margin-left: auto;
111112
color: gray1;
112113

client/src/components/Header/index.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
22
import PT from "prop-types";
33

4-
import { ReactComponent as DownArrow } from "../../assets/images/down-arrow.svg";
54
import { ReactComponent as SearchTabIcon } from "../../assets/images/search-tab-icon.svg";
65
import { ReactComponent as GroupsTabIcon } from "../../assets/images/groups-tab-icon.svg";
76
import { ReactComponent as UploadsTabIcon } from "../../assets/images/uploads-tab-icon.svg";

client/src/components/Header/style.module.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676

7777
.downArrow {
7878
margin-left: 15px;
79+
overflow: hidden;
7980
}
8081

8182
.menu {
@@ -124,6 +125,12 @@
124125
&::placeholder {
125126
opacity: 0.5;
126127
}
128+
129+
&::-ms-clear {
130+
display: none;
131+
height: 0;
132+
width: 0;
133+
}
127134
}
128135

129136
.title {

client/src/components/Modal/index.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PT from "prop-types";
44

55
import style from "./style.module.scss";
66

7-
export default function Modal({ children, className }) {
7+
export default function Modal({ children, className, overlayClassName = "" }) {
88
const [portal, setPortal] = React.useState();
99

1010
React.useEffect(() => {
@@ -21,6 +21,9 @@ export default function Modal({ children, className }) {
2121
let containerStyle = style.container;
2222
if (className) containerStyle += ` ${className}`;
2323

24+
let overlayStyle = style.overlay;
25+
if (overlayClassName) overlayStyle += ` ${overlayClassName}`;
26+
2427
return portal
2528
? ReactDom.createPortal(
2629
<>
@@ -32,7 +35,7 @@ export default function Modal({ children, className }) {
3235
</div>
3336
<button
3437
aria-label="Cancel"
35-
className={style.overlay}
38+
className={overlayStyle}
3639
ref={(node) => {
3740
if (node) {
3841
node.focus();

client/src/components/ProfileCard/profileCard.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
}
7575

7676
.profileCardMainContainer {
77-
height: 100px;
7877
width: 100%;
7978
margin-bottom: 44px;
8079
}
@@ -95,6 +94,8 @@
9594
font-family: Helvetica;
9695
font-size: 20px;
9796
color: gray2;
97+
word-break: break-all;
98+
padding-bottom: 10px;
9899
}
99100

100101
.mainNameBagde {

client/src/components/SuggestionBox/index.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import config from "../../config";
44
import api from "../../services/api";
55
import style from "./style.module.scss";
66

7+
const NO_RESULTS_FOUND = "no results found";
8+
79
/**
810
* Decides what is displayed after the user selects a suggestion
911
* @param {Object} suggestion The selected suggestion
@@ -88,7 +90,8 @@ export default function SuggestionBox({
8890

8991
const onSuggestionsFetchRequested = async ({ value }) => {
9092
if (purpose === "skills") {
91-
const data = await getSkillsSuggestions(apiClient, value);
93+
let data = await getSkillsSuggestions(apiClient, value);
94+
if (data.length < 1) data = [{ name: NO_RESULTS_FOUND }];
9295
setSuggestions(data);
9396
} else {
9497
const data = await getCompanyAttributesSuggestions(
@@ -104,7 +107,7 @@ export default function SuggestionBox({
104107

105108
const onSuggestionSelected = (event, { suggestion }) => {
106109
if (purpose === "skills") {
107-
onSelect(suggestion);
110+
if (suggestion.name !== NO_RESULTS_FOUND) onSelect(suggestion);
108111
} else {
109112
onSelect(companyAttrId, suggestion);
110113
}

client/src/components/collapsible/index.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@ export default function Collapsible({ title, children, collapsed = false }) {
2020
<div className={mainStyle}>
2121
<div className={styles.collapsibleHeader}>
2222
<div className={styles.collapsibleTitle}>{title}</div>
23-
<div className={styles.collapsibleChevronContainer}>
23+
<div
24+
className={styles.collapsibleChevronContainer}
25+
onClick={() => setIsCollapsed(!isCollapsed)}
26+
>
2427
{isCollapsed ? (
25-
<div
26-
className={iconStyles.chevronDownG}
27-
onClick={() => setIsCollapsed(!isCollapsed)}
28-
></div>
28+
<div className={iconStyles.chevronDownG}></div>
2929
) : (
30-
<div
31-
className={iconStyles.chevronUpG}
32-
onClick={() => setIsCollapsed(!isCollapsed)}
33-
></div>
30+
<div className={iconStyles.chevronUpG}></div>
3431
)}
3532
</div>
3633
</div>

client/src/components/tag/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ export default function Tag({
6464
}, [text, selected]);
6565

6666
return (
67-
<button className={mainStyle} onClick={onClickAction}>
67+
<button className={mainStyle} title={text} onClick={onClickAction}>
6868
{text ? (
6969
<div className={styles.tagContent}>
70-
{text && <span title={text}>{text}</span>}
70+
{text && <span>{text}</span>}
7171
{icon && <TagButton icon={icon} />}
7272
</div>
7373
) : (

client/src/pages/Search/Global.jsx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ function getOrderByText(orderBy) {
3636
}
3737
}
3838

39+
function usePrevious(value) {
40+
const ref = React.useRef();
41+
React.useEffect(() => {
42+
ref.current = value;
43+
});
44+
return ref.current;
45+
}
46+
3947
export default function SearchGlobal({ keyword }) {
4048
const { isLoading, isAuthenticated, user: auth0User } = useAuth0();
4149
const apiClient = api();
@@ -50,13 +58,18 @@ export default function SearchGlobal({ keyword }) {
5058
const [windowWidth, setWindowWidth] = React.useState(window.innerWidth);
5159
const [orderBy, setOrderBy] = React.useState(config.DEFAULT_SORT_ORDER);
5260
const [totalPages, setTotalPages] = React.useState(0);
61+
const dropdownRef = React.useRef(null);
62+
63+
const prevOrderBy = usePrevious(orderBy);
5364

5465
const usersPerPage = config.ITEMS_PER_PAGE;
5566

5667
React.useEffect(() => {
5768
window.addEventListener("resize", updateWindowDimensions);
69+
window.addEventListener("click", onWholeContentClick);
5870
return () => {
5971
window.removeEventListener("resize", updateWindowDimensions);
72+
window.removeEventListener("click", onWholeContentClick);
6073
};
6174
});
6275

@@ -181,6 +194,11 @@ export default function SearchGlobal({ keyword }) {
181194
}
182195
});
183196

197+
// reset first page when change orderBy
198+
if (prevOrderBy !== "undefined" && prevOrderBy !== orderBy) {
199+
searchContext.pagination.page = 1;
200+
}
201+
184202
if (searchContext.pagination.page !== page) {
185203
setPage(searchContext.pagination.page);
186204
}
@@ -222,6 +240,7 @@ export default function SearchGlobal({ keyword }) {
222240
});
223241

224242
setUsers(data);
243+
setSortByDropdownShown(false);
225244
setTotalResults(Number(headers["x-total"]));
226245
setTotalPages(Number(headers["x-total-pages"]));
227246
}
@@ -241,6 +260,12 @@ export default function SearchGlobal({ keyword }) {
241260
setWindowWidth(window.innerWidth);
242261
};
243262

263+
const onWholeContentClick = (evt) => {
264+
if (dropdownRef.current && !dropdownRef.current.contains(evt.target)) {
265+
setSortByDropdownShown(false);
266+
}
267+
};
268+
244269
return (
245270
<>
246271
<div className={style.sideMenu}>
@@ -258,6 +283,7 @@ export default function SearchGlobal({ keyword }) {
258283
</div>
259284
<div
260285
className={style.sort}
286+
ref={dropdownRef}
261287
onClick={() => setSortByDropdownShown(!sortByDropdownShown)}
262288
style={{
263289
marginRight:
@@ -274,7 +300,7 @@ export default function SearchGlobal({ keyword }) {
274300
{getOrderByText(orderBy)}
275301
</span>
276302
)}
277-
<DownArrowIcon />
303+
<DownArrowIcon className={style.downArrow} />
278304
{sortByDropdownShown && (
279305
<ul className={style.dropdown}>
280306
<li

client/src/pages/Search/style.module.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
margin-bottom: 100px;
5757
}
5858

59+
.downArrow {
60+
overflow: hidden;
61+
}
62+
5963
.pills {
6064
margin: 15px -5px 0;
6165
}
@@ -108,6 +112,7 @@
108112

109113
&:hover {
110114
background-color: $blue;
115+
color: $white;
111116
}
112117
}
113118

package-lock.json

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)