This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { selectors } from "../fixtures/selectors"; | |
import { PATHS, LITERALS } from "../fixtures/constants"; | |
const screenshotOptions = { | |
overwrite: true | |
}; | |
describe("My ToDo App", () => { | |
beforeEach(() => { | |
cy.visit("/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<header> | |
<img | |
alt="Vue logo" | |
class="logo" | |
src="@/assets/logo.svg" | |
width="125" | |
height="125" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
//imports | |
import { ref, onMounted, computed } from "vue"; | |
import BlogList from "src/components/ListBlog.vue"; | |
import MainContainer from "src/components/MainContainer.vue"; | |
import { useQuasar } from "quasar"; | |
import { createSubscription } from "../services/ApiService"; | |
import qs from "qs"; | |
//variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
events - push | |
*/ | |
self.addEventListener("push", (event) => { | |
if (event.data) { | |
let data = JSON.parse(event.data.text()); | |
event.waitUntil( | |
self.registration.showNotification(data.title, { | |
body: data.body, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<MainContainer> | |
<transition | |
appear | |
enter-active-class="animated fadeIn" | |
leave-active-class="animated fadeOut" | |
> | |
<div | |
v-if="showNotificationsBanner && pushNotificationsSupported" | |
class="banner-container bg-primary" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let webpush = require("web-push"); | |
const publicKey = | |
"Your-public-key"; | |
const privateKey = "Your-private-key"; | |
/* | |
config - webpush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup> | |
//imports | |
import { useRouter } from "vue-router"; | |
import { onMounted, ref } from "vue"; | |
import { useQuasar } from "quasar"; | |
//variables | |
const router = useRouter(); | |
const showInsatllbanner = ref(false); | |
const leftDrawerOpen = ref(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
//rest of the code | |
<q-card | |
class="my-card q-ma-lg" | |
:class="{ 'bg-red-1': blog.offline }" | |
flat | |
bordered | |
v-for="blog in blogList" | |
:key="blog.key" | |
@click="redirectToBlog(blog.id)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!navigator.onLine && isBackgroundSyncSupported.value) { | |
// Notify user about successful blog creation | |
$q.notify({ | |
message: "Offline Blog Created Successfully!", | |
type: "positive", | |
timeout: 2000, | |
}); | |
// Redirect to the home page | |
router.push("/"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Queue } from "workbox-background-sync"; | |
let backgroundSync = "sync" in self.registration ? true : false; | |
/* | |
queue- create post | |
*/ | |
let createBlogQueue = null; | |
if (backgroundSync) { | |
createBlogQueue = new Queue("createBlogQueue", { |
NewerOlder