From a1f1fe84f033f34d367bf01bd7ebc2fd4ec201a1 Mon Sep 17 00:00:00 2001 From: rajpatil6939 Date: Thu, 10 Feb 2022 11:27:49 +0530 Subject: [PATCH 1/2] push notification component added at participant --- src/components/participant/Action.vue | 4 +- .../ActionInputs/PushNotification.vue | 111 ++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 src/components/participant/ActionInputs/PushNotification.vue diff --git a/src/components/participant/Action.vue b/src/components/participant/Action.vue index 0e38288d..e9793609 100644 --- a/src/components/participant/Action.vue +++ b/src/components/participant/Action.vue @@ -7,6 +7,7 @@ > + @@ -40,7 +41,7 @@ import ReefErc20 from "./ActionInputs/ReefErc20.vue"; import InputDate from "./ActionInputs/InputDate.vue"; import InputNumber from "./ActionInputs/InputNumber.vue"; import InputHyperlink from "./ActionInputs/InputHyperlink.vue"; - +import PushNotification from "./ActionInputs/PushNotification.vue" import PrizeCard from "./ActionInputs/PrizeCard.vue"; import eventBus from "../../eventBus.js" @@ -92,6 +93,7 @@ export default { MoonErc20, MoonbeamErc20, MoonriverErc20, + PushNotification, RecaptchaToken: "" }, mounted(){ diff --git a/src/components/participant/ActionInputs/PushNotification.vue b/src/components/participant/ActionInputs/PushNotification.vue new file mode 100644 index 00000000..37a07b06 --- /dev/null +++ b/src/components/participant/ActionInputs/PushNotification.vue @@ -0,0 +1,111 @@ + + + + From 92652035c8380e1fb1006de2673027d18784b18e Mon Sep 17 00:00:00 2001 From: Pratap Mridha Date: Fri, 11 Feb 2022 20:55:17 +0530 Subject: [PATCH 2/2] first commit serviceworker --- package.json | 23 +++- public/service-worker.js | 46 +++++++ .../CreateProjectSlide.vue | 1 + src/components/participant/Action.vue | 4 +- .../ActionInputs/PushNotification.vue | 128 ++++++++++++++++-- src/config.js | 1 + src/main.js | 2 + src/serviceWorker.js | 53 ++++++++ src/views/admin/Events.vue | 2 +- 9 files changed, 245 insertions(+), 15 deletions(-) create mode 100644 public/service-worker.js create mode 100644 src/serviceWorker.js diff --git a/package.json b/package.json index 21264d08..f54b867e 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,12 @@ "private": true, "scripts": { "serve": "vue-cli-service serve --mode production", - "dev": "vue-cli-service serve --mode staging", + "watch":"watchify src/serviceWorker.js -o public/service-worker.js -v [ babelify --presets [es2015] ]", + "start:dev": " vue-cli-service serve --mode staging ", + "dev":"npm run watch & npm run start:dev", "setEnv": "cp env.staging .env", - "build": "vue-cli-service build", + "serviceworker":"browserify src/serviceWorker.js -o public/service-worker.js -v [ babelify --presets [es2015] ]", + "build": " npm run serviceworker & vue-cli-service build ", "build-stage": "vue-cli-service build --mode staging", "lint": "vue-cli-service lint", "test:unit": "vue-cli-service test:unit", @@ -18,7 +21,9 @@ "auth0-js": "^9.16.2", "axios": "^0.21.1", "bootstrap-vue": "^2.0.0-rc.11", + "browserify": "^17.0.0", "dayjs": "^1.10.6", + "dotenv": "^16.0.0", "js-file-download": "^0.4.12", "marked": "^3.0.8", "node-fetch": "^2.6.0", @@ -40,20 +45,34 @@ "vuejs-datepicker": "^1.6.2", "vuejs-datetimepicker": "^1.1.13", "vuejs-paginate": "^2.1.0", + "watchify": "^4.0.0", "web3": "^1.6.0" }, "devDependencies": { + "babelify": "^7.2.0", "@vue/cli-plugin-babel": "^3.0.0-rc.10", "@vue/cli-plugin-eslint": "^3.0.0-rc.10", "@vue/cli-plugin-unit-mocha": "^3.0.0-rc.10", "@vue/cli-service": "^3.0.0-rc.10", "@vue/test-utils": "^1.0.0-beta.20", + "babel-preset-es2015": "^6.24.1", "chai": "^4.1.2", "eslint": "^5.16.0", "eslint-loader": "^3.0.2", "eslint-plugin-vue": "^5.2.3", "prettier": "^2.4.1", "vue-template-compiler": "^2.5.16" + }, "browserify": { + "transform": [ + [ + "babelify", + { + "presets": [ + "es2015" + ] + } + ] + ] }, "eslintConfig": { "root": true, diff --git a/public/service-worker.js b/public/service-worker.js new file mode 100644 index 00000000..effa4030 --- /dev/null +++ b/public/service-worker.js @@ -0,0 +1,46 @@ +(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i - + +