Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDSS-595 | SDSS-596: Add Newsroom menu #189

Merged
merged 59 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6b7cbf8
Initial commit.
joegl Jun 21, 2023
5dca5e0
Updates.
joegl Jun 21, 2023
a13889d
sdss-565: config fix
jenbreese Jul 5, 2023
85b75db
fixup
jenbreese Jul 14, 2023
2d7e0c0
fixup for mobile
jenbreese Jul 18, 2023
0aaf05a
SDSS-595 SDSS-596: using decoupled menu to get the newsroom menu working
jenbreese Jul 19, 2023
eb25910
fixup
jenbreese Jul 19, 2023
432b61c
fixup
jenbreese Jul 20, 2023
45d7186
fixup
jenbreese Jul 26, 2023
e992c41
add css back
joegl Jul 27, 2023
a576808
Merge branch 'feature/newsroom-layout-paragraphs' into SDSS-595-596--…
joegl Jul 27, 2023
7d3d567
fixup!
joegl Jul 27, 2023
001bf65
removing the testing colors
jenbreese Jul 27, 2023
7f3d1a9
adding in changes to have the menus work correctly. Added the new all…
jenbreese Jul 31, 2023
9676f0c
Adding in the package update to decanter 6.2.17
jenbreese Jul 31, 2023
1dadc23
SDSS-595: fixing the mobile display for the menus. adding in what was…
jenbreese Aug 1, 2023
4beacb9
SDSS-596: lots of mobile menu fixups
jenbreese Aug 2, 2023
04328fd
SDSS-596: fixup
jenbreese Aug 2, 2023
3412b95
eod checkin
jenbreese Aug 4, 2023
7d0fd8e
merging in 2.x
jenbreese Aug 10, 2023
4953222
fixup
jenbreese Aug 11, 2023
566a1fc
fixup;
jenbreese Aug 14, 2023
50914ab
Changing newroom menu logo to a div
jenbreese Aug 15, 2023
72436d4
SDSS-596: mobile setup
jenbreese Aug 17, 2023
c59f51a
fixup for the all topics kind of buttons
jenbreese Aug 22, 2023
9ca67e0
fixup
jenbreese Aug 22, 2023
ae1dfeb
fixup
jenbreese Aug 22, 2023
93d4430
merging
jenbreese Aug 22, 2023
b81b4e7
Adding a focus to the mobile menu
jenbreese Aug 23, 2023
ea9ee8b
fixup
jenbreese Aug 23, 2023
d739a82
fixup for search
jenbreese Aug 23, 2023
6fd57ad
fixup
jenbreese Aug 25, 2023
16eff96
Merge branch '2.x' into SDSS-595-596--GITFIX
Sep 7, 2023
dc7fed0
merge
jenbreese Sep 11, 2023
f4a45c9
fixing the newsroom tab
jenbreese Sep 11, 2023
02fad4b
fixup to the search button
jenbreese Sep 12, 2023
bb22776
fixup
jenbreese Sep 12, 2023
34d73c7
merge
jenbreese Oct 30, 2023
6a17e3d
SDSS-595: adding in the blocks to create the newsroom menu
jenbreese Oct 31, 2023
63497ab
merge
jenbreese Nov 28, 2023
bf240e3
fixup
jenbreese Nov 29, 2023
268d3d8
fixup
jenbreese Nov 29, 2023
62ca1a7
cleanup
jenbreese Nov 29, 2023
35b7f5c
fixup
jenbreese Nov 29, 2023
13892c0
mergin
jenbreese Dec 1, 2023
93cfd66
first round of fixups
jenbreese Dec 1, 2023
f1d094f
fixups for pr
jenbreese Dec 2, 2023
683ed4d
fixup for tab focus
jenbreese Dec 4, 2023
d130d8f
fixup
jenbreese Dec 4, 2023
c832092
fixup
jenbreese Dec 4, 2023
1e45e01
fixup to search icon on mobile
jenbreese Dec 5, 2023
f3e7212
fixup
jenbreese Dec 5, 2023
0a11508
fixup to the tab focus
jenbreese Dec 5, 2023
114f4fd
moving html around
jenbreese Dec 6, 2023
d82ca58
fixup
jenbreese Dec 6, 2023
4fcaef3
SDSS-1126: Added SDSS Site Settings config page with Newsroom menu to…
joegl Dec 6, 2023
475e626
Removed redundant block config.
Dec 7, 2023
9a5e864
Remove deprecated package-lock.
Dec 7, 2023
24a1dd3
Formatting.
Dec 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
uuid: 665d82ec-2af7-4f41-b566-ed89e6e26968
langcode: en
status: true
dependencies:
config:
- system.menu.newsroom
module:
- menu_block
- node
- system
theme:
- sdss_subtheme
id: newsresearch
theme: sdss_subtheme
region: newsroom
weight: 0
provider: null
plugin: 'menu_block:newsroom'
settings:
id: 'menu_block:newsroom'
label: 'News & Research'
label_display: visible
provider: menu_block
follow: true
follow_parent: child
label_link: false
label_type: block
level: 1
depth: 0
expand_all_items: true
parent: 'newsroom:'
suggestion: newsroom
visibility:
request_path:
id: request_path
negate: false
pages: "/news/*\r\n"
'entity_bundle:node':
id: 'entity_bundle:node'
negate: false
context_mapping:
node: '@node.node_route_context:node'
bundles:
stanford_news: stanford_news
stanford_page: stanford_page
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
id: sdss_subtheme_main_navigation
theme: sdss_subtheme
region: menu
weight: 0
weight: -7
provider: null
plugin: 'system_menu_block:main'
settings:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ dependencies:
config:
- views.view.search
module:
- config_pages
- views
theme:
- sdss_subtheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ dependencies:
- scheduler
third_party_settings:
menu_ui:
available_menus: { }
parent: ''
available_menus:
- newsroom
parent: 'newsroom:'
node_revision_delete:
minimum_revisions_to_keep: 5
minimum_age_to_delete: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
uuid: 19d118e4-99e6-4f8c-ba61-f3cdc83e0105
langcode: en
status: true
dependencies: { }
id: newsroom
label: 'News & Research'
description: 'Newsroom menu'
locked: false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": false,
"endOfLine": "auto"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* Gets size stats for built islands.
*/
const { basename, join } = require('path')
const { green, red, yellow, white } = require('kleur')
const gzipSize = require('gzip-size')
const brotliSize = require('brotli-size')
const prettyBytes = require('pretty-bytes')
const fs = require('fs/promises')

/**
*
* Sauce pulled from here:
* https://github.com/developit/microbundle/blob/ecb0b022912397bcf98550c1a783e9e0534f33e5/src/lib/compressed-size.js
*/
function getPadLeft(str, width, char = ' ') {
return char.repeat(width - str.length)
}

function formatSize(size, filename, suffix, raw) {
const pretty = raw ? `${size} B` : prettyBytes(size)
const color = size < 5000 ? green : size > 40000 ? red : yellow
const indent = getPadLeft(pretty, 13)
return `${indent}${color(pretty)}: ${white(basename(filename))}${suffix}`
}

async function getSizeInfo(path, filename) {
const code = await fs.readFile(path)

const [original, gzip, brotli] = await Promise.all([
fs.stat(path).then((x) => x.size),
gzipSize(code).catch(() => null),
brotliSize.sync(code),
])

const raw = original < 5000

let out = formatSize(original, filename, '', raw)

out += '\n' + formatSize(gzip, filename, '.gz', raw)

if (brotli) {
out += '\n' + formatSize(brotli, filename, '.br', raw)
}

return out
}

class FileSizePlugin {
apply(compiler) {
compiler.hooks.done.tap(
'File Size Plugin',
async (
stats /* stats is passed as an argument when done hook is tapped. */,
) => {
const promises = []
stats.compilation.assetsInfo.forEach((value, key) => {
const filePath = join(stats.compilation.outputOptions.path, key)
promises.push(getSizeInfo(filePath, key))
})

const resolve = await Promise.all(promises)

resolve.map((log) => console.log(log))
},
)
}
}

module.exports = FileSizePlugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<html><head><meta charset="utf-8"/><title>Islands</title><meta name="viewport" content="width=device-width,initial-scale=1"/><style>body {
font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI',
Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.preview {
width: 100%;
max-width: 1500px;
margin: 80px auto;
border: 1px dashed rgba(0, 0, 0, 0.2);
position: relative;
}

.preview::before {
content: 'Island';
position: absolute;
display: block;
top: -18px;
font-size: 11px;
color: rgba(0, 0, 0, 0.5);
}</style><script defer="defer" src="/islands/newsroom-menu.island.umd.js"></script></head><body><div class="preview"><div data-island="newsroom-menu-island"></div></div></body></html>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Loading
Loading