Giter VIP home page Giter VIP logo

progress's People

Contributors

claudiodekker avatar inertiajs-publisher avatar innocenzi avatar irakan avatar reinink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

progress's Issues

Progress bar doesn't run as expected

Hi @reinink, I use inertia/progress in my Laravel Inertia Svelte Demo. But, when I move from first menu to another menu (Home, About, Contact) using mouse click I expect that progress indicator run but it doesn't.

I already setup the inertia progress based on inertiajs documentation.

  1. Install npm install @inertiajs/progress
  2. Initialize inertia progress in app.js. Here's the code.
import { App } from '@inertiajs/inertia-svelte';
import { InertiaProgress } from '@inertiajs/progress';

InertiaProgress.init();

const el = document.getElementById('app');

new App({
    target: el,
    props: {
        initialPage: JSON.parse(el.dataset.page),
        resolveComponent: name => import(`./Pages/${name}.svelte`)
    }
});

I'm using:

  • @inertiajs/inertia: ^0.7.0
  • @inertia/inertia-svelte: ^0.5.2
  • @inertia/progress: ^0.2.3

Screen record attach below.

Screen.Recording.2020-12-20.at.06.50.51.mov

Is there any step that I'm missing?

Thanks.

Progress Indicator not showing on $inertia.reload()

Versions:

  • @inertiajs/inertia version:0.9.4
  • @inertiajs/inertia-vue3 version: 0.4.7

Describe the problem:

I'm using $inertia.reload() in my mounted hook to fetch data that takes a bit longer to retrieve (3rd party API). However, doing this no longer shows the progress indicators, via InertiaProgress.

Steps to reproduce:

  1. Navigate to a page, with standard injected props.
  2. In your components mounted() lifecycle hook, make another request using the only option.
this.$inertia.reload({
      only: ['someApiData', 'someMoreApiData',],
})

Adjusing bar line width

Is there a simple way to adjust the lineWidth of the bar? Im trying to make it thicker.

InertiaProgress.init({
  delay: 0,
  color: '#6875F5',
  includeCSS: true,
  showSpinner: false,
})

the docs didnt mentioned about the width;

CSP Nonce Support

Getting the error:
vendor.js:653 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' https://fonts.googleapis.com 'nonce-gNubTa9xLIALXt6z6cKEdnsNwMUGMx6d'". Either the 'unsafe-inline' keyword, a hash ('sha256-UTjtaAWWTyzFjRKbltk24jHijlTbP20C1GUYaWPqg7E='), or a nonce ('nonce-...') is required to enable inline execution.

This is caused by the inline styles injected from this plugin.

Can support for a nonce be added? unsafe-inline is not allowed in my application.

Progress Bar Problem With Laravel Jetstream Inertia stack

When I am adding NPprogress to Laravel Jetstream inertia stack. the following problem occurs:

image

App.js Code:

`require('./bootstrap');

import Vue from 'vue';

import { InertiaApp } from '@inertiajs/inertia-vue';
import { InertiaProgress } from '@inertiajs/progress';
import { InertiaForm } from 'laravel-jetstream';
import PortalVue from 'portal-vue';

Vue.mixin({ methods: { route } });
Vue.use(InertiaApp);
Vue.use(InertiaForm);
Vue.use(PortalVue);

InertiaProgress.init();

const app = document.getElementById('app');

new Vue({
render: (h) =>
h(InertiaApp, {
props: {
initialPage: JSON.parse(app.dataset.page),
resolveComponent: (name) => require(./Pages/${name}).default,
},
}),
}).$mount(app);`

Can I please get some help here.

"Uncaught TypeError: n.detail is null" when clicking link

Hello,

I added this to my Laravel Jetstream Inertia project:

// Loading indicator
import { InertiaProgress } from '@inertiajs/progress'
InertiaProgress.init()

The issue

Every time I click an inertia link i get this error:

Screenshot_117

Expected behavior

The bar starts loading when clicking a link and finish once the page is loaded.

Actual behavior

Throws an error and the progress bar just continues to load until about 98% while the page has already been loaded.

event not getting to start method

I am using current versions of Laravel & Inertia.js. I am also using IntertiaProgress 01.2 and looking to use it during a file upload with axios

The files all upload OK but the console shows:

app.js:33316 Uncaught (in promise) TypeError: Cannot read property 'defaultPrevented' of undefined

Tracing this back it points to here in the source of InertiaProgress:

start(event) {
   Promise.resolve().then(() => {
     if (event.defaultPrevented) {
       return
     }

     this.inProgress++
     clearTimeout(this.timeout)
     this.timeout = setTimeout(() => {
       Nprogress.set(0)
       Nprogress.start()
     }, this.delay)
   })
 },

If I console.log(event) I get undefined.

My upload() method:

upload(files) {
    let url = this.$route('library.upload');
    this.$root.showLoading = true;

    const uploadConfig = {
        timeout: 10000,
        onUploadProgress: function(progressEvent) {
            let percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
            InertiaProgress.progress(percentCompleted)
        }
    }

    InertiaProgress.start()

    axios.post(url, {
        files,
    },
        uploadConfig
    ).then(res => {
        let files = res.data.files
        if (files.length) {
            this.filesList = cloneDeep(files)
        }

        this.newFiles = []

        InertiaProgress.finish()
        this.$root.showLoading = false
    }).catch(err => {
        console.log(err)

        InertiaProgress.finish()
        this.$root.showLoading = false
    })

Did I miss something or is this an issue with the current version? Thanks.

PS: great work with Inertia.Js!

Allow configuration of parent container

The nprogress library allows you to configure a parent container like so:

NProgress.configure({ parent: '#container' });

Is it possible to add this configuration option?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.