Skip to content

Commit

Permalink
DEP Upgrade bootstrap and reactstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jan 16, 2025
1 parent 5af6c1e commit d84704d
Show file tree
Hide file tree
Showing 19 changed files with 495 additions and 439 deletions.
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
module.exports = require('@silverstripe/eslint-config/.eslintrc');
module.exports = {
extends: '@silverstripe/eslint-config',
settings: {
react: {
version: '18'
}
}
};
2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-file.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_ssmedia.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/styles/bundle.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/src/components/GalleryItem/GalleryItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ class GalleryItem extends Component {
};
const inputLabelClasses = [
'gallery-item__checkbox-label',
'form-label',
actionIcon,
];
if (!this.canBatchSelect()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const PresetButton = ({ onSelect, currentWidth, originalWidth, width, text }) =>
onClick={() => onSelect(width || originalWidth)}
disabled={(originalWidth < width) || currentWidth === (width || originalWidth)}
>
<span className="sr-only">{srText(text)}</span>
<span className="visually-hidden">{srText(text)}</span>
<span aria-hidden="true">{text}</span>
</Button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ test('ImageSizePresetList render() presets are displayed', () => {
<ImageSizePresetList {...makeProps()}/>
);
const buttons = container.querySelectorAll('button');
expect(buttons[0].querySelector('span.sr-only').textContent).toBe('Set image size to "default"');
expect(buttons[0].querySelector('span.visually-hidden').textContent).toBe('Set image size to "default"');
expect(buttons[0].querySelector('span[aria-hidden="true"]').textContent).toBe('default');
expect(buttons[1].querySelector('span.sr-only').textContent).toBe('Set image size to "super large"');
expect(buttons[1].querySelector('span.visually-hidden').textContent).toBe('Set image size to "super large"');
expect(buttons[1].querySelector('span[aria-hidden="true"]').textContent).toBe('super large');
expect(buttons[2].querySelector('span.sr-only').textContent).toBe('Set image size to "super small"');
expect(buttons[2].querySelector('span.visually-hidden').textContent).toBe('Set image size to "super small"');
expect(buttons[2].querySelector('span[aria-hidden="true"]').textContent).toBe('super small');
});

Expand Down
2 changes: 1 addition & 1 deletion client/src/containers/Editor/Editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
text-align: center;
}

@include media-breakpoint-down(md) {
@include media-breakpoint-down(lg) {
.editor__heading,
.editor__specs {
text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion client/src/containers/Editor/EditorHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
&--md-below {
display: none;

@include media-breakpoint-down(md) {
@include media-breakpoint-down(lg) {
display: block;
margin-left: 0;
}
Expand Down
10 changes: 5 additions & 5 deletions client/src/containers/Gallery/Gallery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
position: relative; //testing

&.gallery__main--has-opened-item {
@include media-breakpoint-down(md) {
@include media-breakpoint-down(lg) {
display: none;
}
}
Expand Down Expand Up @@ -87,7 +87,7 @@


// leave space at bottom for bulk-actions on smaller screens
@include media-breakpoint-down(md) {
@include media-breakpoint-down(lg) {
.gallery__files {
margin-bottom: $toolbar-total-height;
}
Expand Down Expand Up @@ -120,7 +120,7 @@

// Override chosen inline width to fit to icon
.chosen-container {
@include media-breakpoint-down(sm) {
@include media-breakpoint-down(md) {
width: auto !important;
}
}
Expand All @@ -138,7 +138,7 @@
text-align: right;
color: inherit;

@include media-breakpoint-down(sm) {
@include media-breakpoint-down(md) {
font-size: 0;
}
}
Expand All @@ -152,7 +152,7 @@
top: 1px;
font-size: $font-size-sm;

@include media-breakpoint-down(sm) {
@include media-breakpoint-down(md) {
font-size: $font-size-lg;
}
}
Expand Down
6 changes: 2 additions & 4 deletions client/src/containers/InsertMediaModal/InsertMediaModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,10 @@ class InsertMediaModal extends Component {
return (
<button
type="button"
className="close modal__close-button insert-media-modal__close-button"
className="close btn-close modal__close-button insert-media-modal__close-button"
onClick={this.props.onClosed}
aria-label={i18n._t('FormBuilderModal.CLOSE', 'Close')}
>
<span aria-hidden="true">×</span>
</button>
/>
);
}

Expand Down
7 changes: 5 additions & 2 deletions client/src/containers/InsertMediaModal/InsertMediaModal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

// If the editor is in the dialog
.editor__details {
@include media-breakpoint-down(md) {
@include media-breakpoint-down(xl) {
height: 100%;
}
}
Expand Down Expand Up @@ -60,7 +60,7 @@
}
}

@include media-breakpoint-down(md) {
@include media-breakpoint-down(lg) {
.asset-admin--multi-select [name="action_insert"] {
display: block;
}
Expand All @@ -76,6 +76,9 @@
float: right;
height: 32px;
margin: 10px -10px 10px 0;
// Replace .btn-close background, which renders the wrong
// button icon since it's not in .modal-header
--bs-btn-close-bg: none;

&:before {
top: 0;
Expand Down
4 changes: 2 additions & 2 deletions client/src/containers/TableView/TableView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ th.sort--disabled>span:after {
padding-bottom: $table-cell-padding-lg;

// hide details for smaller screens
@include media-breakpoint-down(sm) {
@include media-breakpoint-down(md) {
&:nth-child(n+4) {
display: none;
}
Expand All @@ -61,7 +61,7 @@ th.sort--disabled>span:after {
}

// hide details for smaller screens
@include media-breakpoint-down(sm) {
@include media-breakpoint-down(md) {
&:nth-child(n+4) {
display: none;
}
Expand Down
11 changes: 4 additions & 7 deletions code/Forms/AssetFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,14 @@ public function getRequiredContext()
*/
protected function buildFileStatusIcon(string $title, string $fontClass): string
{
// https://getbootstrap.com/docs/4.4/components/tooltips/
// Specifying data-delay as an html attribute means that show and hide must be the same value unfortunately
// Cannot data-delay="{show: 300, hide: 0}" as it will be interpreted as a string, not (number|object)
return <<<EOT
<div class="file-status-icon">
<span title="$title"
class="icon file-status-icon__icon $fontClass"
data-toggle="tooltip"
data-placement="top"
data-delay="150"
data-animation="false">
data-bs-toggle="tooltip"
data-bs-placement="top"
data-bs-delay="150"
data-bs-animation="false">
</span>
</div>
EOT;
Expand Down
2 changes: 1 addition & 1 deletion code/Forms/FileHistoryFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ protected function getSpecsMarkup($record)
}

$versionTag = sprintf(
'<span class="badge badge-info">v.%s</span>',
'<span class="badge badge-info bg-info">v.%s</span>',
$record->Version
);
$agoTag = sprintf(
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@dnd-kit/modifiers": "^9.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@popperjs/core": "^2.11.6",
"bootstrap": "^4.6.2",
"bootstrap": "^5.2.0",
"classnames": "^2.3.2",
"core-js": "^3.26.0",
"create-react-class": "^15.7.0",
Expand All @@ -79,12 +79,11 @@
"modernizr": "^3.12.0",
"prop-types": "^15.8.1",
"qs": "^6.11.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^9.2.0",
"react-router-dom": "^6.4.3",
"react-selectable": "^2.1.1",
"reactstrap": "^8.9.0",
"reactstrap": "^9.2.0",
"redux": "^5.0.1",
"redux-form": "^8.3.10",
"redux-logger": "^3.0.6",
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/manage-files.feature
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Feature: Manage files
When I press the "Other actions" button
And I press the "Delete" button
Then I should see a modal titled "Confirm deletion"
And I click on the ".modal-header .close" element
And I click on the ".modal-header .btn-close" element
And I wait for 1 second
Then I should not see a modal titled "Confirm deletion"
And I should see the file named "file1" in the gallery
Expand Down
Loading

0 comments on commit d84704d

Please sign in to comment.