Create the popup dialog box based on the configuration #2732171: Popup Dialog box configurations using cookies to store anonymous user information.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

malavya created an issue. See original summary.

imalabya’s picture

Title: Create box popup based on cookie. » Create cookie based fetching of configuration.
Issue summary: View changes
mahaveer003’s picture

Assigned: Unassigned » mahaveer003
mahaveer003’s picture

FileSize
5.46 KB

Patch For Create cookie based fetching of configuration.

mahaveer003’s picture

Status: Active » Needs review
imalabya’s picture

Status: Needs review » Needs work
+++ b/popup_dialog.js
@@ -0,0 +1,34 @@
+    function setCookie(cname, cvalue, exdays) {
+        var d = new Date();
+        d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
+        var expires = "expires=" + d.toUTCString();
+        document.cookie = cname + "=" + cvalue + "; " + expires;
+    }

The JS file is not following the Drupal coding standards.

  1. +++ b/popup_dialog.js
    @@ -0,0 +1,34 @@
    \ No newline at end of file
    

    Missing new line

  2. +++ b/popup_dialog.libraries.yml
    @@ -0,0 +1,9 @@
    \ No newline at end of file
    

    missing new line

  3. +++ b/popup_dialog.module
    @@ -22,3 +24,26 @@ function popup_dialog_help($route_name, RouteMatchInterface $route_match) {
    \ No newline at end of file
    

    missing new line

  4. +++ b/src/Form/PopupSettingsForm.php
    @@ -2,8 +2,10 @@
    +use Drupal\Core\Ajax\AjaxResponse;
    

    Unused use statement

  5. +++ b/src/Form/PopupSettingsForm.php
    @@ -2,8 +2,10 @@
    +use Drupal\sweetalert\Ajax\SweetAlertCommand;
    

    Unused use statement

  6. +++ b/src/Form/PopupSettingsForm.php
    @@ -96,6 +99,16 @@ class PopupSettingsForm extends ConfigFormBase {
     }
    

    Missing line end

mahaveer003’s picture

Status: Needs work » Needs review
FileSize
5.63 KB
2.66 KB

Patch added with the changes mentioned in the comment #6

Please Review.

  • malavya committed c4f1afe on 8.x-1.x authored by mahavir003
    Issue #2733243 by mahavir003, malavya: Create cookie based fetching of...
imalabya’s picture

Status: Needs review » Reviewed & tested by the community
imalabya’s picture

Status: Reviewed & tested by the community » Fixed

Pushed the changes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.