From 0696335ff61d717b53513fd65861fbe2f00fdb34 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Tue, 27 May 2025 16:54:25 -0500 Subject: [PATCH] fix(js): Apply fixes suggested by CoPilot. - Fix inverted logic from previous commit in feature-callouts.js - Pass to other functions in flux-group-keys.js --- assets/js/feature-callouts.js | 13 ++----------- assets/js/flux-group-keys.js | 4 ++-- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/assets/js/feature-callouts.js b/assets/js/feature-callouts.js index a77015e6e..28cf585bb 100644 --- a/assets/js/feature-callouts.js +++ b/assets/js/feature-callouts.js @@ -2,8 +2,7 @@ This feature is designed to callout new features added to the documentation CSS is required for the callout bubble to determine look and position, but the element must have the `callout` class and a unique id. - Callouts are treated as notifications and use the notification cookie API in - assets/js/cookies.js. + Callouts are treated as notifications and use the LocalStorage notification API. */ import $ from 'jquery'; @@ -14,19 +13,11 @@ function getCalloutID(el) { return $(el).attr('id'); } -// Hide a callout and update the cookie with the viewed callout -function hideCallout(calloutID) { - if (!LocalStorageAPI.notificationIsRead(calloutID)) { - LocalStorageAPI.setNotificationAsRead(calloutID, 'callout'); - $(`#${calloutID}`).fadeOut(200); - } -} - // Show the url feature callouts on page load export default function FeatureCallout({ component }) { const calloutID = getCalloutID($(component)); - if (LocalStorageAPI.notificationIsRead(calloutID, 'callout')) { + if (!LocalStorageAPI.notificationIsRead(calloutID, 'callout')) { $(`#${calloutID}.feature-callout`) .fadeIn(300) .removeClass('start-position'); diff --git a/assets/js/flux-group-keys.js b/assets/js/flux-group-keys.js index 18432cca1..9842bdb6f 100644 --- a/assets/js/flux-group-keys.js +++ b/assets/js/flux-group-keys.js @@ -240,8 +240,8 @@ function toggleCheckbox(element) { } // Build example group function -function buildGroupExample() { - var columnCollection = getChecked() +function buildGroupExample($component) { + var columnCollection = getChecked($component) .map((i) => '"' + i + '"') .join(', '); $('pre#group-by-example')[0].innerHTML =