Skip to content

Commit 8c293f6

Browse files
fitzageguacbotbgdeutschdavidejonesnsollecito
authored
Bootstrap 5 Upgrade (#16114)
* bump bootstrap version number * fixed initial build issues with bootstrap five * Basic bootstrap 5 build with proper imports * Updated cards in sdk-languages to use cols instead of deprecated card-deck styling * Restore position: relative for columns * Updated to remove obsolete card-deck, standardize some of the card-deck partials more * Replaced obsolete font-weight-* classes with fw-* * cleaned up whats-next/nextlink list code * changed ml/mr/pl/pr classes to ms/me/ps/pe * changed data attributes to bootstrap namespaced versions, changed sr-only to visually-hidden * updated bs5 gutter to match bs4 * updated text-right/left styles with text-start/end * converted mr-* classes to me-* * converted ml-* classes to ms-* * converted pl-* classes to ps-* * Generated by websites-modules Signed-off-by: guacbot <[email protected]> * Generated by websites-modules Signed-off-by: guacbot <[email protected]> * Generated by websites-modules Signed-off-by: guacbot <[email protected]> * Generated by websites-modules Signed-off-by: guacbot <[email protected]> * bootstrap tweaks after merging latest content * removing local websites-modules reference * fixed signup modal triggers * removed border from tags in whats next section * fixed hover effects on list blocks (whats-next, nextlink) * fixed height of integration search bar * Generated by websites-modules Signed-off-by: guacbot <[email protected]> * Remove indentation from html partial that is called in shortcode * update img partial * Generated by websites-modules Signed-off-by: guacbot <[email protected]> * Generated by websites-modules Signed-off-by: guacbot <[email protected]> * Generated by websites-modules Signed-off-by: guacbot <[email protected]> * fixed nextlink tag spacing and styling in some instances * made disable_lazy actually work in img partial. Again. * fixed image modals * fixed activation scripts for signupModal, incremented bootstrap to 5.2.3G * fixed double activation of free trial button in footer * Update yarn.lock * upgraded popper, fixed dropdowns * fixed additional image tile partials * fixed weird tabbed content issues related to nested img partial * fixed tabs on api docs * fixed positioning of expand all buttons * Update linting.yml * update reference expand/collapse and side nav h5 heading colors * include bootstrap collapse in main-dd-js file * updated to websites-modules 2.0.0 * bump mod version, update from master * Merge color vars maps * Add import for color var map Signed-off-by: guacbot <[email protected]> Co-authored-by: guacbot <[email protected]> Co-authored-by: Brian Deutsch <[email protected]> Co-authored-by: david.jones <[email protected]> Co-authored-by: Nick Sollecito <[email protected]> Co-authored-by: Brooklyne <[email protected]> Co-authored-by: Carlos Santos <[email protected]>
1 parent 11507b4 commit 8c293f6

File tree

99 files changed

+2649
-2341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+2649
-2341
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ charset = utf-8
88
indent_style = space
99
indent_size = 2
1010

11+
[layouts/partials/img.html]
12+
insert_final_newline = false
13+
1114
[Makefile]
1215
indent_style = tab
1316
indent_size = 2

.github/workflows/linting.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on: [pull_request]
44
jobs:
55
prose:
66
runs-on: ubuntu-latest
7+
timeout-minutes: 5
78
steps:
89
- name: Checkout
910
uses: actions/checkout@master

assets/scripts/components/algolia.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const appendHomeLinkToAutocompleteWidget = () => {
5353
const autocompleteHeaderElement = headers[0];
5454
const searchPageLink = document.createElement('a');
5555

56-
searchPageLink.className = "font-regular text-underline pl-2 js-api-search";
56+
searchPageLink.className = "font-regular text-underline ps-2 js-api-search";
5757
searchPageLink.innerText = 'Click here to search the full docs';
5858
searchPageLink.href = `${baseUrl}/search/`;
5959

assets/scripts/components/global-modals.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
$(document).ready(function () {
22

3-
$('#signupModal').on('show.bs.modal', function (e) {
3+
const signupModal = document.getElementById('signupModal')
4+
signupModal.addEventListener('show.bs.modal', function(e) {
45
//$('body').css('overflow', 'hidden');
56
//$('.modal').css('overflow', 'scroll');
67
var regURL = 'https://app.datadoghq.com/signup_corp';
@@ -48,22 +49,27 @@ $(document).ready(function () {
4849
} else {
4950
$('#signUpIframe').attr('src', regURL+lang_param);
5051
}
51-
}).on('hide.bs.modal', function(e) {
52+
})
53+
54+
signupModal.addEventListener('hide.bs.modal', function(e) {
5255
$('#signUpIframe').attr('src', '');
5356
//$('body').css('overflow', '');
5457
//$('.modal').css('overflow', '');
5558
});
5659

5760

58-
61+
const imageModal = document.getElementById('popupImageModal')
5962
var naturalWidth = 0;
6063
var naturalHeight = 0;
6164
var isShowing = false;
62-
$('#popupImageModal').on('show.bs.modal', function (e) {
65+
imageModal.addEventListener('show.bs.modal', function(e) {
66+
$('#popupImageModal').on('show.bs.modal', function (e) {
6367
$('#popupImageModal .modal-content').css({'background': 'transparent', 'border': 'none'});
64-
$('#popupImageModal .modal-body, #popupImageModal .modal-dialog, #popupImageModal .modal-content').css('height','100%');
68+
$('#popupImageModal .modal-body, #popupImageModal .modal-dialog, #popupImageModal .modal-content').css('height', '100%');
6569
$('#popupImageModal .modal-body').html('<div class="loader" style="position:absolute;top:50%;margin:-50px 0 0 -50px;height:100px;width:100px;"></div>');
66-
}).on('shown.bs.modal', function (e) {
70+
})
71+
});
72+
imageModal.addEventListener('shown.bs.modal', function(e) {
6773
$('body').removeClass('modal-open');
6874
var modal = $(this);
6975
//modal.hide();
@@ -85,7 +91,8 @@ $(document).ready(function () {
8591
}
8692
};
8793
img.src = url;
88-
}).on('hide.bs.modal', function(e) {
94+
});
95+
imageModal.addEventListener('hide.bs.modal', function(e) {
8996
$('#popupImageModal .modal-body').empty();
9097
});
9198

assets/scripts/components/search.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,24 +274,24 @@ const renderResults = (query, hits) => {
274274
let cls = '';
275275
cleanHandlers();
276276
html +=
277-
'<a class="mr-1 btn btn-sm-tag btn-outline-secondary" href="#" id="btn_prev">Prev</a>';
277+
'<a class="me-1 btn btn-sm-tag btn-outline-secondary" href="#" id="btn_prev">Prev</a>';
278278
if (page_nums[0] > 1) {
279279
html +=
280-
'<a class="mr-1 btn btn-sm-tag btn-outline-secondary less" href="#">...</a>';
280+
'<a class="me-1 btn btn-sm-tag btn-outline-secondary less" href="#">...</a>';
281281
}
282282
for (let i = 0; i < page_nums.length; i++) {
283283
cls =
284284
current_page === page_nums[i]
285285
? 'active'
286286
: '';
287-
html += `<a class="mr-1 page-num btn btn-sm-tag btn-outline-secondary ${cls}" href="#" data-pagenum="${page_nums[i]}">${page_nums[i]}</a>`;
287+
html += `<a class="me-1 page-num btn btn-sm-tag btn-outline-secondary ${cls}" href="#" data-pagenum="${page_nums[i]}">${page_nums[i]}</a>`;
288288
}
289289
if (page_nums[page_nums.length - 1] < numPages()) {
290290
html +=
291-
'<a class="mr-1 btn btn-sm-tag btn-outline-secondary more" href="#">...</a>';
291+
'<a class="me-1 btn btn-sm-tag btn-outline-secondary more" href="#">...</a>';
292292
}
293293
html +=
294-
'<a class="mr-1 btn btn-sm-tag btn-outline-secondary" href="#" id="btn_next">Next</a>';
294+
'<a class="me-1 btn btn-sm-tag btn-outline-secondary" href="#" id="btn_next">Next</a>';
295295
if (page_navigation) {
296296
page_navigation.innerHTML = html;
297297
}
@@ -423,4 +423,4 @@ const handleSearch = () => {
423423
}
424424
}
425425

426-
window.addEventListener('DOMContentLoaded', handleSearch)
426+
window.addEventListener('DOMContentLoaded', handleSearch)

assets/scripts/main-dd-js.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import 'jquery';
2-
import 'bootstrap';
1+
import Modal from 'bootstrap/js/dist/modal';
2+
import 'bootstrap/js/dist/dropdown';
3+
import 'bootstrap/js/dist/tab';
4+
import 'bootstrap/js/dist/collapse';
35

46
import './datadog-docs';
57
import './utms';
@@ -16,12 +18,14 @@ import './components/bootstrap-dropdown-custom';
1618
import './components/navbar'; // should move this to websites-modules
1719
import './components/mobile-nav'; // should move this to websites-modules
1820

19-
/* temporary - just for header get started */
2021
// Event handlers
21-
$('.main-nav .sign-up-trigger').on('click', function (event) {
22-
event.preventDefault();
23-
$('#signupModal').modal('show');
24-
});
22+
document.querySelectorAll('.sign-up-trigger').forEach(item => {
23+
item.addEventListener('click', (event) => {
24+
event.preventDefault();
25+
const signupModal = new Modal(document.getElementById('signupModal'))
26+
signupModal.show(item)
27+
})
28+
})
2529

2630
// TODO: split up code from datadog-docs.js into modules after webpack migration
2731
// import './components/sidenav';

assets/scripts/tests/build-api-pages.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,7 +2353,7 @@ describe(`schemaTable`, () => {
23532353
const actual = bp.schemaTable({});
23542354
const expected = `
23552355
<div class=" schema-table row">
2356-
<p class="expand-all js-expand-all text-primary">Expand All</p>
2356+
<p class="expand-all js-expand-all text-primary text-end">Expand All</p>
23572357
<div class="col-12">
23582358
<div class="row table-header">
23592359
<div class="col-4 column">
@@ -2416,7 +2416,7 @@ describe(`schemaTable`, () => {
24162416

24172417
const actual = bp.schemaTable("request", mockData.schema);
24182418
const expected = `<div class="table-request schema-table row">
2419-
<p class="expand-all js-expand-all text-primary">Expand All</p>
2419+
<p class="expand-all js-expand-all text-primary text-end">Expand All</p>
24202420
<div class="col-12">
24212421
<div class="row table-header">
24222422
<div class="col-4 column">

0 commit comments

Comments
 (0)