Skip to content

Commit 4d4a779

Browse files
Merge pull request #3274 from OneCommunityGlobal/Ziddi-asterisk-addition-to-forms
Ziddi - Added asterisk for the users to identify them as mandatory fields. Added warning messages to fill the mandatory inputs where ever required.
2 parents fa85689 + cab99c6 commit 4d4a779

22 files changed

Lines changed: 180 additions & 134 deletions

File tree

src/actions/__tests__/weeklySummariesAction.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import axios from 'axios';
22
import * as actions from '../../constants/weeklySummaries';
33
import { ENDPOINTS } from '../../utils/URL';
44
import { fetchWeeklySummariesBegin, fetchWeeklySummariesSuccess, fetchWeeklySummariesError, getWeeklySummaries, updateWeeklySummaries } from '../weeklySummaries'
5-
import { getUserProfileActionCreator } from '../../actions/userProfile';
5+
import { getUserProfileActionCreator } from "../userProfile";
66

77

88
jest.mock('axios');

src/actions/__tests__/weeklySummariesReportActions.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('Weekly Summary Report', () => {
9898

9999
describe('Update One Summary Report', () => {
100100

101-
let mockUserProfile, updatedField;
101+
let mockUserProfile; let updatedField;
102102

103103
beforeEach(() => {
104104

src/components/Announcements/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function Announcements({ title, email }) {
209209
<p>Email</p>
210210
) : (
211211
<label htmlFor="email-list-input" className={darkMode ? 'text-light' : 'text-dark'}>
212-
Email List (comma-separated):
212+
Email List (comma-separated)<span className="red-asterisk">* </span>:
213213
</label>
214214
)}
215215
<input

src/components/BMDashboard/Lesson/LessonForm.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ function LessonForm() {
259259
<div className="WriteLessonAndTagDiv">
260260
<Form.Group className="LessonFrom" controlId="exampleForm.ControlTextarea1">
261261
<Form.Label className="LessonLabel">Lesson Title</Form.Label>
262+
<span className="red-asterisk">* </span>
262263
<Form.Control
263264
required
264265
className="LessonTitle"
@@ -270,6 +271,7 @@ function LessonForm() {
270271
</Form.Group>
271272
<Form.Group className="LessonForm" controlId="exampleForm.ControlTextarea1">
272273
<Form.Label className="LessonLabel">Write a Lesson</Form.Label>
274+
<span className="red-asterisk">* </span>
273275
<Form.Control
274276
required
275277
className="LessonPlaceholderText"

src/components/Badge/AssignBadge.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,14 @@ function AssignBadge(props) {
122122
style={{ fontWeight: 'bold', marginBottom: 10 }}
123123
>
124124
Search by Full Name
125+
<span className="red-asterisk">* </span>
125126
<i
126127
className="fa fa-info-circle ml-2"
127128
id="NameInfo"
128129
data-testid="NameInfo"
129130
style={{ cursor: 'pointer' }}
130131
/>
132+
131133
<UncontrolledTooltip
132134
placement="right"
133135
target="NameInfo"

src/components/Badge/CreateNewBadgePopup.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ function CreateNewBadgePopup(props) {
170170
<Label for="badgeName" className={fontColor}>
171171
Name
172172
</Label>
173+
<span className="red-asterisk">* </span>
173174
<Input
174175
type="name"
175176
name="name"
@@ -186,6 +187,7 @@ function CreateNewBadgePopup(props) {
186187
<Label for="imageUrl" className={fontColor}>
187188
Image URL
188189
</Label>
190+
<span className="red-asterisk">* </span>
189191
<Input
190192
type="url"
191193
name="url"
@@ -204,6 +206,7 @@ function CreateNewBadgePopup(props) {
204206
<Label for="badgeDescription" className={fontColor}>
205207
Description
206208
</Label>
209+
<span className="red-asterisk">* </span>
207210
<Input
208211
type="textarea"
209212
name="text"

src/components/Dashboard/Dashboard.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ export function Dashboard(props) {
2222
const [popup, setPopup] = useState(false);
2323
const [filteredUserTeamIds, setFilteredUserTeamIds] = useState([]);
2424
const [summaryBarData, setSummaryBarData] = useState(null);
25-
const {match, authUser} = props;
25+
const { match, authUser } = props;
2626
const checkSessionStorage = () => JSON.parse(sessionStorage.getItem('viewingUser')) ?? false;
2727
const [viewingUser, setViewingUser] = useState(checkSessionStorage);
28-
const [displayUserId, setDisplayUserId] = useState(match.params.userId || viewingUser?.userId || authUser.userid);
28+
const [displayUserId, setDisplayUserId] = useState(
29+
match.params.userId || viewingUser?.userId || authUser.userid,
30+
);
2931
const isNotAllowedToEdit = cantUpdateDevAdminDetails(viewingUser?.email, authUser.email);
3032
const darkMode = useSelector(state => state.theme.darkMode);
3133

@@ -51,7 +53,6 @@ export function Dashboard(props) {
5153
}, 150);
5254
};
5355

54-
5556
const handleStorageEvent = () => {
5657
const sessionStorageData = checkSessionStorage();
5758
setViewingUser(sessionStorageData || false);
@@ -65,10 +66,10 @@ export function Dashboard(props) {
6566
};
6667
}, []);
6768

68-
useEffect(()=>{
69-
console.log(summaryBarData)
70-
dispatch(updateSummaryBarData({summaryBarData}));
71-
},[summaryBarData])
69+
useEffect(() => {
70+
console.log(summaryBarData);
71+
dispatch(updateSummaryBarData({ summaryBarData }));
72+
}, [summaryBarData]);
7273

7374
return (
7475
<Container fluid className={darkMode ? 'bg-oxford-blue' : ''}>

src/components/Header/DarkMode.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
padding: 0;
55
}
66

7+
.red-asterisk {
8+
color: #e00000;
9+
font-weight: bold;
10+
}
11+
712
.dark-mode .close {
813
color: white;
914
opacity: 1;

src/components/PermissionsManagement/NewRolePopUp.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ function CreateNewRolePopup({ toggle, roleNames, darkMode, addRole }) {
8383
return (
8484
<Form id="createRole" onSubmit={handleSubmit}>
8585
<FormGroup>
86-
<Label className={darkMode ? 'text-light' : ''}>Role Name:</Label>
86+
<Label className={darkMode ? 'text-light' : ''}>
87+
Role Name<span className="red-asterisk">* </span>:
88+
</Label>
8789
<Input
8890
placeholder="Please enter a new role name"
8991
value={newRoleName}
@@ -98,7 +100,9 @@ function CreateNewRolePopup({ toggle, roleNames, darkMode, addRole }) {
98100
</FormGroup>
99101

100102
<FormGroup>
101-
<Label className={darkMode ? 'text-light' : ''}>Permissions:</Label>
103+
<Label className={darkMode ? 'text-light' : ''}>
104+
Permissions<span className="red-asterisk">* </span>:
105+
</Label>
102106
<PermissionList
103107
rolePermissions={permissionsChecked}
104108
editable

src/components/PermissionsManagement/UserPermissionsPopUp.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ function UserPermissionsPopUp({
139139
className={darkMode ? 'text-space-cadet' : ''}
140140
style={{ display: 'flex', justifyContent: 'space-between', paddingBottom: '5px' }}
141141
>
142-
<h4 className="user-permissions-pop-up__title">User name:</h4>
142+
<h4 className="user-permissions-pop-up__title">
143+
User name<span className="red-asterisk">* </span>:
144+
</h4>
143145
<Button
144146
type="button"
145147
color="success"

0 commit comments

Comments
 (0)