Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
1. Update label options
2. hide severity field
3. set severity to medium
4. css update
5. twig update
6. install the site alert block
  • Loading branch information
vincent-gao committed Jan 19, 2023
1 parent 4b5b746 commit dda4d45
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
langcode: en
status: true
dependencies:
module:
- tide_site_alert
theme:
- seven
id: tide_site_alert_header
theme: seven
region: header
weight: -100
provider: null
plugin: tide_site_alert_block
settings:
id: tide_site_alert_block
label: 'Tide Site Alert'
label_display: '0'
provider: tide_site_alert
timeout: '300'
visibility: { }
16 changes: 11 additions & 5 deletions modules/tide_site_alert/css/site_alert.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
.site-alert {
font-weight: normal !important;
}

.site-alert .text {
padding: 10px 10px !important;
font-size: 1rem !important;
font-size: 100% !important;
font-weight: normal !important;
}

.message {
Expand All @@ -27,3 +24,12 @@
width: 1rem;
height: 1rem;
}

.site-alert .site-alert__dismiss {
top: 20% !important;
}

.site-alert .site-alert__dismiss-icon {
font-size: 100% !important;
font-weight: normal !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div{{ attributes.setAttribute('data-site-alert-id', alert.id).addClass(site_alert_classes) }}>
<div class="text">
<div class="first-line">
{{ alert.label }} from {{ alert.start }} till {{ alert.end }}
{{ alert.label }}
</div>
<div class="message">
{{ alert.message }}
Expand Down
19 changes: 14 additions & 5 deletions modules/tide_site_alert/tide_site_alert.module
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,18 @@ function tide_site_alert_theme() {
function tide_site_alert_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if ($form_id === 'site_alert_add_form' || $form_id === 'site_alert_edit_form') {
$options = [
'Hotfix, site maintenance or outage' => 'Hotfix, site maintenance or outage',
'Content freeze in progress' => 'Content freeze in progress',
'upcoming release notice' => 'upcoming release notice',
'post release notice' => 'post release notice',
'Other' => 'Other',
'Upcoming release notice:' => 'Upcoming release notice:',
'Upcoming hotfix notice:'=>'Upcoming hotfix notice:',
'Upcoming site maintenance notice:'=>'Upcoming site maintenance notice:',
'Upcoming planned outage notice:'=> 'Upcoming planned outage notice:',
'Hotfix in progress:'=> 'Hotfix in progress:',
'Site maintenance in progress:'=> 'Site maintenance in progress:',
'Outage in progress:'=> 'Outage in progress:',
'Content freeze in progress:'=> 'Content freeze in progress:',
'Successful post-release notice:'=> 'Successful post-release notice:',
'Unsuccessful post-release notice:'=> 'Unsuccessful post-release notice:',
'Post-outage notice:'=> 'Post-outage notice:',
'Custom notice:'=> 'Custom notice:'
];
$form['suggested_labels'] = [
'#type' => 'select',
Expand All @@ -41,6 +48,8 @@ function tide_site_alert_form_alter(&$form, FormStateInterface $form_state, $for
'effect' => 'fade',
],
];
$form['severity']['#access'] = FALSE;
$form['severity']['widget']['#default_value'] = 'medium';
$form['label']['widget'][0]['value']['#prefix'] = '<div id="suggested-labels">';
$form['label']['widget'][0]['value']['#suffix'] = '</div>';
}
Expand Down

0 comments on commit dda4d45

Please sign in to comment.