npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

freeman.gdpr.informationconsentplugin

v1.0.1

Published

This is a jquery plugin to display user initiated plugin

Downloads

1

Readme

Introduction

Freeman.GDPR.InformationConsent is a lightweight jQuery plugin, to display a simple checkbox which is use to get user consent from an appication, several condition is applied which you can see below on # Implementation Conditions area.

Getting Started

1.Installation process
    NPM:
        npm install freeman.gdpr.InformationConsent --save-dev
2.Software dependencies
    jQuery 3.x:
        Via NPM:   npm install jQuery@latest --save-dev

                    OR

        Via CDN -  Uncompressed: <script
                        src="https://code.jquery.com/jquery-3.3.1.js"
                        integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
                        crossorigin="anonymous"></script>
                    OR

        Via CDN -  Minified: <script
                    src="https://code.jquery.com/jquery-3.3.1.min.js"
                    integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
                    crossorigin="anonymous"></script>

3.Latest releases
    Current Release: 1.0.0

How to use this plugin:

Step 1: Go to https://freemanco.visualstudio.com/Freeman/_packaging?feed=Freeman.GDPR.Packages&_a=feed
Step 2: Click on Connect to feed. A pop-up is displayed.
Step 3: Choose npm from the list (on the left). Scroll down and click on Generate npm credentials.
Step 4: Copy and paste the token in .npmrc (Windows - C://Users//<username>) on your local machine. Generate 1 token per team
Step 5: Install the plugin and the necessary software dependencies in your application
Step 6: In the entry component,
    import '~/node_modules/freeman.gdpr.InformationConsent/js/jquery.InformationConsent.js';
    declare let $: any;  //If using TypeScript; else use 'var' instead of 'let'

    // To display the plugin in the modal.
    var aa = $( "selectorName" ).displayUserInitiatedPiiElement("elementId", "appName"); //Pass elementID (to which the plugin should be appended to) and appname 
    
    // Check if the checkbox is checked. If true then enable submit button; else disable submit button
    document.getElementById("gdpr-termsCheckboxId<elementId>").addEventListener("click", function () {
        if(aa.isChecked() == true) {
        $('<your button id>').removeClass("disabled").attr("rel", null);
        $('<your button id>').addClass("btn-primary").attr("rel", null);
        }
        if(aa.isChecked() == false) {
        $('<your button id>').removeClass("btn-primary").attr("rel", null);
        $('<your button id>').addClass("disabled").attr("rel", null);
        }
    });

    // To append the description
    aa.setDataInfo("This is the description given by Plantour");

Helper Methods

    a) isChecked() : you can directly get current value of checkbox with the help of this method.
    b) setDataInfo(<Information/Description>) : You can directly set Freeman Store Data Information in String with the help of this method.

Implementation Conditions:

1) Submit button should disabled if user initiat checkbox is "unchecked".
    a) You can directly get checkbox value via "isChecked()" method.
2) On Click Submit you must send an extra request call to GDPR server to save consent information in GDPR Database.
    Below is the api description that needs to send on click submit from application.

    Request Method: POST.
    Request URL:
            case 'dev':
                privacyAppEnv = 'https://privacyapi-dev.freeman.com/api/audit/adduserinfo';
                break;
            case 'test':
                privacyAppEnv = 'https://privacyapi-test.freeman.com/api/audit/adduserinfo';
                break;
            case 'uat':
                privacyAppEnv = 'https://privacyapi-uat.freeman.com/api/audit/adduserinfo';
                break;
            case 'prod':
                privacyAppEnv = 'https://privacyapi.freeman.com/api/audit/adduserinfo';
                break;

    Request Payload: 
        {
            "Message": "test", // you can mention form name or modal name with some description
            "Application":"ShowPlans",
            "Email":"[email protected]",
            "FirstName": "Bobby",
            "LastName": "Johnson”
        }

Purpose of InformationConsent Plugin:

As a user, If I want to go to an application's website, voluntarily put in my personal info in order to get a demo, additional information about software, and see a notification and requirement to consent before selecting 'submit'.