Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impersonate interfere with a nova-filepond package #106

Open
hassan-knopsmedia opened this issue Apr 21, 2022 · 4 comments
Open

Impersonate interfere with a nova-filepond package #106

hassan-knopsmedia opened this issue Apr 21, 2022 · 4 comments

Comments

@hassan-knopsmedia
Copy link

hassan-knopsmedia commented Apr 21, 2022

Hi, I can't upload files to a resource because this package interferes with uploading files with the nova-file pond package

Error on network console

company: 186791
company_trashed: false
attachments: eyJpdiI6ImpRR3hUWEVNdUN5cmlpSk9TeS9Gdnc9PSIsInZhbHVlIjoicU4vVUdaOENZNXplYlZkdlM5NC9OUTZOS21MSW53dmRMdDQzSjc5ODFxNjUvZDBBeUdmRlR1U2xRMVRRMkNjMiIsIm1hYyI6IjRmOTA4YzgyM2RhM2NjZmZmNWU4OWMyYzQ3MGVhMzY5MDFhMTFkNmI1NDQ1ZWFhMGUyZmI2ZmU3ZmNiNGNjMjEiLCJ0YWciOiIifQ==<style>
@media print{
.noprint{
display:none;
}
}
</style>

Zich voordoen als Sales

<a href="http://www.localhost:8000/nova-impersonate/leave" style="text-decoration:underline;color: black;font-weight: bold">
    Omgekeerd imiteren!
</a>
<script> document.addEventListener('DOMContentLoaded', function () { function reverseImpersonateContainerOnDblclick(event) { var attribute = 'data-position', position = !parseInt(event.target.getAttribute(attribute));
        event.target.setAttribute(attribute, +position);
        event.target.style.top = position
            ? '75%'
            : '25%';
    }

    var shields = document.getElementsByClassName('reverse-impersonate-container');

    for (var i = 0; i < shields.length; i++) {
        shields[i].addEventListener('dblclick', reverseImpersonateContainerOnDblclick)
    }
});
</script>

viaResource: companies

viaResourceId: 186791

viaRelationship: attachments

@KABBOUCHI
Copy link
Owner

disable the middleware in the config file https://github.com/KABBOUCHI/nova-impersonate/blob/master/config/nova-impersonate.php#L20

inject this view manually in your app layout file https://github.com/KABBOUCHI/nova-impersonate/blob/master/resources/views/reverse.blade.php

probably it's returning JSON response as HTML, I'll try to find a quick solution.

@hassan-knopsmedia
Copy link
Author

By injecting this into the nova layout it shows reverse link by default

@KABBOUCHI
Copy link
Owner

KABBOUCHI commented Apr 22, 2022

plz can u apply this condition?

https://github.com/KABBOUCHI/nova-impersonate/blob/master/src/Http/Middleware/Impersonate.php#L25-L30

app('impersonate')->isImpersonating() && auth(app('impersonate')->getImpersonatorGuardUsingName())->check()

@hassan-knopsmedia
Copy link
Author

It worked thanks. I can upload files while impersonating. Would there be a pull request for this or are you going to implement a better solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants