Skip to content

Commit 5e1cb6e

Browse files
committed
fix: replace all form with paragon component
1 parent 5b3e9a1 commit 5e1cb6e

File tree

4 files changed

+22
-28
lines changed

4 files changed

+22
-28
lines changed

src/FeatureBasedEnrollments/FeatureBasedEnrollmentIndexPage.jsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import React, {
77
useLayoutEffect,
88
} from 'react';
99
import { useLocation, useNavigate } from 'react-router-dom';
10-
import { Form, Button } from '@openedx/paragon';
10+
import { Form, Button, Row } from '@openedx/paragon';
1111

1212
import UserMessagesContext from '../userMessages/UserMessagesContext';
1313
import AlertList from '../userMessages/AlertList';
@@ -94,14 +94,14 @@ export default function FeatureBasedEnrollmentIndexPage() {
9494

9595
<AlertList topic="featureBasedEnrollmentGeneral" className="mb-3" />
9696

97-
<section className="mb-3">
98-
<form className="form-inline">
99-
<Form.Group>
100-
<Form.Label htmlFor="courseId">Course ID</Form.Label>
101-
<Form.Control ref={searchRef} className="mr-1 ml-1 col-sm-4" name="courseId" defaultValue={searchValue} />
102-
</Form.Group>
103-
<Button type="submit" onClick={submit} className="ml-1 col-sm-1" variant="primary">Search</Button>
104-
</form>
97+
<section className="mb-3 px-2">
98+
<Form>
99+
<Form.Row>
100+
<Form.Label htmlFor="courseId" className="my-auto">Course ID</Form.Label>
101+
<Form.Control ref={searchRef} name="courseId" className="mr-1 ml-1 col-sm-4" defaultValue={searchValue} />
102+
<Button type="submit" onClick={submit} className="ml-1 col-sm-1" variant="primary">Search</Button>
103+
</Form.Row>
104+
</Form>
105105
</section>
106106

107107
{searchValue && <FeatureBasedEnrollment courseId={searchValue} apiFetchSignal={apiFetchSignal} />}

src/ProgramEnrollments/LinkProgramEnrollments.jsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,43 +45,38 @@ export default function LinkProgramEnrollments() {
4545
<>
4646
<h3>Link Program Enrollments</h3>
4747
<section className="my-3">
48-
<form>
49-
<div className="my-2">
50-
<Form.Group>
48+
<Form>
49+
<Form.Group className="my-2">
5150
<Form.Label htmlFor="programUUID">Program UUID</Form.Label>
5251
<Form.Control
53-
className="mr-1 col-sm-12"
5452
name="programUUID"
5553
defaultValue={programID}
5654
onChange={onProgramChange}
5755
/>
5856
</Form.Group>
59-
</div>
60-
<div className="my-4">
61-
<label
62-
className="d-flex align-items-start"
57+
<Form.Group className="my-4">
58+
<Form.Label
6359
htmlFor="usernamePairText"
6460
>
6561
List of External key and username pairings (one per line)
66-
</label>
62+
</Form.Label>
6763
<Form.Control
68-
className="mr-1 col-sm-12"
6964
name="usernamePairText"
7065
as="textarea"
7166
rows="10"
7267
onChange={onUserTextChange}
7368
defaultValue={usernamePairText}
7469
placeholder="external_user_key,lms_username"
7570
/>
76-
</div>
71+
</Form.Group>
7772
<Button
7873
type="submit"
7974
onClick={submit}
8075
disabled={isFetchingData}
8176
>
8277
Submit
8378
</Button>
84-
</form>
79+
</Form>
8580
</section>
8681
{((errorMessage && errorMessage.length > 0)
8782
|| (successMessage && successMessage.length > 0)) && (

src/ProgramEnrollments/ProgramInspector/ProgramInspector.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ export default function ProgramInspector() {
120120
<Form.Group>
121121
<Form.Label htmlFor="username">edX username or email</Form.Label>
122122
<Form.Control
123-
className="col-sm-12"
124123
name="username"
125124
defaultValue={username}
126125
onChange={(e) => (e.target.value
@@ -134,7 +133,6 @@ export default function ProgramInspector() {
134133
<Form.Group>
135134
<Form.Label htmlFor="orgKey">Identity-providing institution</Form.Label>
136135
<Form.Control
137-
className="col-sm-12"
138136
name="orgKey"
139137
as="select"
140138
defaultValue={activeOrgKey}
@@ -152,7 +150,6 @@ export default function ProgramInspector() {
152150
<Form.Group>
153151
<Form.Label htmlFor="externalKey">Institution user key</Form.Label>
154152
<Form.Control
155-
className="col-sm-12"
156153
name="externalKey"
157154
defaultValue={externalUserKey}
158155
onChange={(e) => (e.target.value

src/users/UserSearch.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ export default function UserSearch({ userIdentifier, searchHandler }) {
1515
});
1616

1717
return (
18-
<section className="mb-3">
19-
<form className="form-inline">
20-
<label htmlFor="userIdentifier">Username, Email or LMS User ID</label>
18+
<section className="mb-3 px-2">
19+
<Form>
20+
<Form.Row>
21+
<Form.Label htmlFor="userIdentifier" className="my-auto">Username, Email or LMS User ID</Form.Label>
2122
<Form.Control ref={searchRef} className="flex-grow-1 ml-1 mr-1" name="userIdentifier" defaultValue={userIdentifier} />
2223
<Button type="submit" onClick={submit} variant="primary">Search</Button>
23-
</form>
24+
</Form.Row>
25+
</Form>
2426
</section>
2527
);
2628
}

0 commit comments

Comments
 (0)