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

HPC-9557: Fix issues with disaggregation modals #1000

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions html/modules/custom/ghi_blocks/js/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
// Attach behaviors.
Drupal.behaviors.hpc_ghi_modal = {
attach: function(context, settings) {
once('ghi-modal-title', 'body').forEach(() => {
document.addEventListener('dialog:aftercreate', e => {
$('.ui-dialog.ghi-modal-dialog .ui-dialog-title').html(settings.ghi_modal_title);
});
if (typeof settings.ghi_modal_title == 'undefined') {
return;
}
$(window).on('dialog:aftercreate', (e, dialog, $element) => {
$('.ui-dialog.ghi-modal-dialog .ui-dialog-title').html(settings.ghi_modal_title);
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getType() {
/**
* Get the source entity.
*
* @return \Drupal\ghi_plans\ApiObjects\Entities\EntityObjectInterface|null
* @return \Drupal\ghi_plans\ApiObjects\PlanEntityInterface|null
* The entity object.
*/
public function getSourceEntity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private function modalTitle(DataAttachment $attachment, $metric, $reporting_peri
if ($icon && $icon_embed = $this->iconQuery->getIconEmbedCode($icon)) {
$title = $icon_embed;
}
$title .= $entity->getEntityName() . ' | ' . $metrics[$metric];
$title .= $entity->getName() . ' | ' . $metrics[$metric];

if ($attachment->isMeasurementField($metrics[$metric])) {
$title .= ThemeHelper::render([
Expand All @@ -59,7 +59,6 @@ private function modalTitle(DataAttachment $attachment, $metric, $reporting_peri
'#format_string' => '<span class="title-additional-info">Monitoring period @period_number: @date_range</span>',
], FALSE);
}

return Markup::create($title);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class EntityQuery extends EndpointQueryBase implements ContainerFactoryPluginInt
* @param int $entity_id
* The entity id to query.
*
* @return \Drupal\ghi_base_objects\ApiObjects\BaseObjectInterface
* @return \Drupal\ghi_plans\ApiObjects\PlanEntityInterface
* The entity object.
*/
public function getEntity($entity_type, $entity_id) {
Expand Down
2 changes: 1 addition & 1 deletion html/themes/custom/common_design_subtheme/css/styles.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
}

.ui-dialog-title {
display: flex;
align-items: self-start;
color: var(--ghi-default-text-color) !important;

.cluster-icon {
Expand Down
Loading