Skip to content

Commit 93c05d5

Browse files
Make "Enter" buttons shorter using default styles (#84)
1 parent 8609da8 commit 93c05d5

File tree

7 files changed

+64
-31
lines changed

7 files changed

+64
-31
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Change history for ui-requests-mediated
22

33
## 2.1.0 (IN PROGRESS)
4-
4+
* Make "Enter" buttons shorter using default styles. Refs UIREQMED-71.
55

66
## [2.0.1] (https://github.com/folio-org/ui-requests-mediated/tree/v2.0.1) (2024-12-06)
77
[Full Changelog](https://github.com/folio-org/ui-requests-mediated/compare/v2.0.0...v2.0.1)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.fieldWrapper {
2+
display: flex;
3+
align-items: start;
4+
}
5+
6+
.instanceHridField {
7+
margin-right: 20px;
8+
}

src/components/MediatedRequestsActivities/components/InstanceInformation/InstanceInformation.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import {
2525
import TitleInformation from '../TitleInformation';
2626
import { memoizeValidation } from '../../../../utils';
2727

28+
import css from './InstanceInformation.css';
29+
2830
export const INSTANCE_SEGMENT_FOR_PLUGIN = 'instances';
2931

3032
class InstanceInformation extends Component {
@@ -210,7 +212,10 @@ class InstanceInformation extends Component {
210212
<Row>
211213
<Col xs={12}>
212214
<Row>
213-
<Col xs={9}>
215+
<Col
216+
xs={12}
217+
className={css.fieldWrapper}
218+
>
214219
<FormattedMessage id="ui-requests-mediated.form.instance.inputPlaceholder">
215220
{placeholder => {
216221
const key = values.keyOfInstanceIdField ?? 0;
@@ -239,20 +244,18 @@ class InstanceInformation extends Component {
239244
onBlur={this.handleBlur(input)}
240245
onKeyDown={this.onKeyDown}
241246
disabled={!isEditPermission}
247+
className={css.instanceHridField}
242248
/>
243249
);
244250
}}
245251
</Field>
246252
);
247253
}}
248254
</FormattedMessage>
249-
</Col>
250-
<Col xs={3}>
251255
<Button
252256
id="selectInstanceButton"
253-
buttonStyle="primary noRadius"
257+
buttonStyle="default"
254258
buttonClass={enterButtonClass}
255-
fullWidth
256259
onClick={this.handleClick}
257260
disabled={isEnterButtonDisabled}
258261
>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.fieldWrapper {
2+
display: flex;
3+
align-items: start;
4+
}
5+
6+
.itemBarcodeField {
7+
margin-right: 20px;
8+
}

src/components/MediatedRequestsActivities/components/ItemInformation/ItemInformation.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import {
2323
import ItemDetail from '../ItemDetail';
2424
import { memoizeValidation } from '../../../../utils';
2525

26+
import css from './ItemInformation.css';
27+
2628
class ItemInformation extends Component {
2729
static propTypes = {
2830
triggerValidation: PropTypes.func.isRequired,
@@ -211,7 +213,10 @@ class ItemInformation extends Component {
211213
<Row>
212214
<Col xs={12}>
213215
<Row>
214-
<Col xs={9}>
216+
<Col
217+
xs={12}
218+
className={css.fieldWrapper}
219+
>
215220
<FormattedMessage id="ui-requests-mediated.form.item.inputPlaceholder">
216221
{placeholder => {
217222
const key = values.keyOfItemBarcodeField ?? 0;
@@ -240,20 +245,18 @@ class ItemInformation extends Component {
240245
onBlur={this.handleBlur(input)}
241246
onKeyDown={this.onKeyDown}
242247
disabled={!isEditPermission}
248+
className={css.itemBarcodeField}
243249
/>
244250
);
245251
}}
246252
</Field>
247253
);
248254
}}
249255
</FormattedMessage>
250-
</Col>
251-
<Col xs={3}>
252256
<Button
253257
id="selectItemButton"
254-
buttonStyle="primary noRadius"
258+
buttonStyle="default"
255259
buttonClass={enterButtonClass}
256-
fullWidth
257260
onClick={this.handleClick}
258261
disabled={isEnterButtonDisabled}
259262
>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.fieldWrapper {
2+
display: flex;
3+
align-items: start;
4+
}
5+
6+
.requesterBarcodeField {
7+
margin-right: 20px;
8+
}

src/components/MediatedRequestsActivities/components/RequesterInformation/RequesterInformation.js

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import {
2929
DEFAULT_REQUEST_TYPE_VALUE,
3030
} from '../../../../constants';
3131

32+
import css from './RequesterInformation.css';
33+
3234
export const VISIBLE_COLUMNS = ['active', 'name', 'patronGroup', 'username', 'barcode'];
3335
export const COLUMN_MAPPING = {
3436
name: <FormattedMessage id="ui-requests-mediated.form.requesterLookup.name" />,
@@ -248,7 +250,10 @@ class RequesterInformation extends Component {
248250
<Row>
249251
<Col xs={12}>
250252
<Row>
251-
<Col xs={9}>
253+
<Col
254+
xs={12}
255+
className={css.fieldWrapper}
256+
>
252257
<FormattedMessage id="ui-requests-mediated.form.requester.inputPlaceholder">
253258
{placeholder => {
254259
const key = values.keyOfUserBarcodeField ?? 0;
@@ -277,41 +282,39 @@ class RequesterInformation extends Component {
277282
onBlur={this.handleBlur(input)}
278283
onKeyDown={this.onKeyDown}
279284
disabled={!isEditPermission}
285+
className={css.requesterBarcodeField}
280286
/>
281287
);
282288
}}
283289
</Field>
284290
);
285291
}}
286292
</FormattedMessage>
287-
{
288-
isEditPermission &&
289-
<Pluggable
290-
aria-haspopup="true"
291-
type="find-user"
292-
searchLabel={<FormattedMessage id="ui-requests-mediated.form.requester.lookupLabel" />}
293-
searchButtonStyle="link"
294-
dataKey="users"
295-
selectUser={this.onSelectUser}
296-
visibleColumns={VISIBLE_COLUMNS}
297-
columnMapping={COLUMN_MAPPING}
298-
disableRecordCreation
299-
marginTop0
300-
/>
301-
}
302-
</Col>
303-
<Col xs={3}>
304293
<Button
305-
buttonStyle="primary noRadius"
294+
buttonStyle="default"
306295
buttonClass={enterButtonClass}
307-
fullWidth
308296
onClick={this.handleClick}
309297
disabled={isEnterButtonDisabled}
310298
>
311299
<FormattedMessage id="ui-requests-mediated.form.enterButton" />
312300
</Button>
313301
</Col>
314302
</Row>
303+
{
304+
isEditPermission &&
305+
<Pluggable
306+
aria-haspopup="true"
307+
type="find-user"
308+
searchLabel={<FormattedMessage id="ui-requests-mediated.form.requester.lookupLabel" />}
309+
searchButtonStyle="link"
310+
dataKey="users"
311+
selectUser={this.onSelectUser}
312+
visibleColumns={VISIBLE_COLUMNS}
313+
columnMapping={COLUMN_MAPPING}
314+
disableRecordCreation
315+
marginTop0
316+
/>
317+
}
315318
{
316319
isLoading && <Icon {...BASE_SPINNER_PROPS} />
317320
}

0 commit comments

Comments
 (0)