-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDSS-595 | SDSS-596: Add Newsroom menu (#189)
* SDSS-595 | SDSS-596: Add Newsroom menu.
- Loading branch information
Showing
56 changed files
with
15,191 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
docroot/profiles/sdss/sdss_profile/config/sync/block.block.sdss_subtheme_newsresearch.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ dependencies: | |
config: | ||
- views.view.search | ||
module: | ||
- config_pages | ||
- views | ||
theme: | ||
- sdss_subtheme | ||
|
17 changes: 17 additions & 0 deletions
17
docroot/profiles/sdss/sdss_profile/config/sync/config_pages.type.sdss_site_settings.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '' |
21 changes: 21 additions & 0 deletions
21
..._profile/config/sync/core.entity_form_display.config_pages.sdss_site_settings.default.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
..._profile/config/sync/core.entity_view_display.config_pages.sdss_site_settings.default.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
21 changes: 21 additions & 0 deletions
21
...profile/config/sync/field.field.config_pages.sdss_site_settings.su_sdss_newsroom_menu.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...ofiles/sdss/sdss_profile/config/sync/field.storage.config_pages.su_sdss_newsroom_menu.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
docroot/profiles/sdss/sdss_profile/config/sync/system.menu.newsroom.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
1 change: 1 addition & 0 deletions
1
docroot/profiles/sdss/sdss_profile/themes/sdss_subtheme/decoupled-menu/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.env.local |
1 change: 1 addition & 0 deletions
1
docroot/profiles/sdss/sdss_profile/themes/sdss_subtheme/decoupled-menu/.nvmrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
6 changes: 6 additions & 0 deletions
6
docroot/profiles/sdss/sdss_profile/themes/sdss_subtheme/decoupled-menu/.prettierrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"semi": false, | ||
"endOfLine": "auto" | ||
} |
70 changes: 70 additions & 0 deletions
70
docroot/profiles/sdss/sdss_profile/themes/sdss_subtheme/decoupled-menu/FileSizePlugin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
21 changes: 21 additions & 0 deletions
21
docroot/profiles/sdss/sdss_profile/themes/sdss_subtheme/decoupled-menu/dist/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
224 changes: 224 additions & 0 deletions
224
...dss/sdss_profile/themes/sdss_subtheme/decoupled-menu/dist/islands/main-menu.island.umd.js
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...file/themes/sdss_subtheme/decoupled-menu/dist/islands/main-menu.island.umd.js.LICENSE.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
*/ |
288 changes: 288 additions & 0 deletions
288
...sdss_profile/themes/sdss_subtheme/decoupled-menu/dist/islands/newsroom-menu.island.umd.js
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
.../themes/sdss_subtheme/decoupled-menu/dist/islands/newsroom-menu.island.umd.js.LICENSE.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
*/ |
Oops, something went wrong.