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 all 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
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
@@ -0,0 +1,43 @@
uuid: f201744b-060d-4755-8e64-87457fbfe0a0
langcode: en
status: true
dependencies:
config:
- system.menu.newsroom
module:
- config_pages
- menu_block
- system
theme:
- sdss_subtheme
id: sdss_subtheme_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: false
follow_parent: child
label_link: false
label_type: menu
level: 1
depth: 0
expand_all_items: false
parent: 'newsroom:'
suggestion: newsroom
visibility:
request_path:
id: request_path
negate: false
pages: '/news*'
config_pages_values_access:
id: config_pages_values_access
negate: false
config_page_field: sdss_site_settings|su_sdss_newsroom_menu|boolean
operator: '=='
condition_value: '1'
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
@@ -0,0 +1,17 @@
uuid: e0b45054-d297-43b9-8312-67e2004e620f
langcode: en
status: true
dependencies: { }
id: sdss_site_settings
label: 'SDSS Site Settings'
token: false
context:
show_warning: true
group:
language: false
fallback:
language: ''
menu:
path: /admin/config/system/sdss-site-settings
weight: 0
description: ''
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: d1a391ed-c0a2-427b-8a86-20d718f89d1e
langcode: en
status: true
dependencies:
config:
- config_pages.type.sdss_site_settings
- field.field.config_pages.sdss_site_settings.su_sdss_newsroom_menu
id: config_pages.sdss_site_settings.default
targetEntityType: config_pages
bundle: sdss_site_settings
mode: default
content:
su_sdss_newsroom_menu:
type: boolean_checkbox
weight: 22
region: content
settings:
display_label: true
third_party_settings: { }
hidden:
label: true
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ third_party_settings:
children:
- group_site_details
- group_contact_details
- group_sdss_settings
label: Tabs
region: content
parent_name: ''
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
uuid: cc470cf0-4163-4268-843b-9377d7d986a1
langcode: en
status: true
dependencies:
config:
- config_pages.type.sdss_site_settings
- field.field.config_pages.sdss_site_settings.su_sdss_newsroom_menu
id: config_pages.sdss_site_settings.default
targetEntityType: config_pages
bundle: sdss_site_settings
mode: default
content:
su_sdss_newsroom_menu:
type: boolean
label: above
settings:
format: default
format_custom_false: ''
format_custom_true: ''
third_party_settings: { }
weight: 19
region: content
hidden:
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: 2bc11c45-ddac-4ba3-b701-748c8f33deb6
langcode: en
status: true
dependencies:
config:
- config_pages.type.sdss_site_settings
- field.storage.config_pages.su_sdss_newsroom_menu
id: config_pages.sdss_site_settings.su_sdss_newsroom_menu
field_name: su_sdss_newsroom_menu
entity_type: config_pages
bundle: sdss_site_settings
label: 'Show Newsroom Menu'
description: 'Enable the Newsroom menu on /news paths.'
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
on_label: Enable
off_label: Disable
field_type: boolean
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Accessibility Contact Email'
description: '<p>Please enter the email for the person(s) who are responsible for site content. (This may be the same as the Primary Site Manager in many cases.)</p>'
required: true
required: false
translatable: false
default_value: { }
default_value_callback: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ entity_type: config_pages
bundle: stanford_basic_site_settings
label: Organization
description: ''
required: true
required: false
translatable: false
default_value: { }
default_value_callback: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Site Owner Contact Email'
description: '<p>Please enter the email for the business owner(s) for this site. This might be the director, chair, program owner, lab PI, etc.</p>'
required: true
required: false
translatable: false
default_value: { }
default_value_callback: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Primary Site Manager Email'
description: '<p>Please enter the email for the person(s) who leads the site building and editing efforts for this site.</p>'
required: true
required: false
translatable: false
default_value: { }
default_value_callback: ''
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
uuid: f6a3e4e7-8ba3-48c8-8bfe-9820fc3dd892
langcode: en
status: true
dependencies:
module:
- config_pages
id: config_pages.su_sdss_newsroom_menu
field_name: su_sdss_newsroom_menu
entity_type: config_pages
type: boolean
settings: { }
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
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