Jump to content

client navigation not respecting the base_uri for client


Blesta Addons

Recommended Posts

in navigation, when we are playing with client navigation, the hover of link show the client uri exact (client/plugin/xxxxxx/client_main). but when we go to client area, the navigation is rendered without the client_uri, is rendered (plugin/xxxxxx/client_main)  without client leading prefix.

 

 

 

 

Link to comment
Share on other sites

Good catch. Currently the behavior is to link all plugin links through the public_uri instead of the client_uri.  This was to make the URLs a little cleaner.  I believe the hover tooltip should be updated to remove the client/ portion for plugin links

Link to comment
Share on other sites

1 hour ago, Jono said:

Good catch. Currently the behavior is to link all plugin links through the public_uri instead of the client_uri.  This was to make the URLs a little cleaner.  I believe the hover tooltip should be updated to remove the client/ portion for plugin links

but in reality some plugin links need to be inside the client_uri not public_uri .

 

 

 

 

Link to comment
Share on other sites

21 minutes ago, Jono said:

Can you give an example?

not example , a real case :)

we have some plugins that are injecting in client navigation, and we add some widget for them, in the widget the base_uri generate link with client/ prefix and the navigation generate links out them, so here we have a duplicate link for the same location.

when accessing a link without client prefix,the link is listing some rows,  the confirm delete modal not working, we need to go the prefixed link to make it work.

this is sufficient or not?

Link to comment
Share on other sites

On 6/15/2021 at 10:36 AM, Blesta Addons said:

when accessing a link without client prefix,the link is listing some rows,  the confirm delete modal not working, we need to go the prefixed link to make it work.

Have you debugged why this is the case?  The support manager plugins use widgets with ticket lists and a close modal and all works fine with or without the client/ prefix.  

Link to comment
Share on other sites

10 hours ago, Jono said:

Have you debugged why this is the case?  The support manager plugins use widgets with ticket lists and a close modal and all works fine with or without the client/ prefix.  

i will check with my team, the last time i have tested with a custom plugin it was returning error (404) as it fetch the modal from url without client prefix (GET  https://xxxxxxxxxxx/dialog/confirm/?message=Are you sur you want to delete this Playlist?&confirm_url=/plugin/smart_one/client_main/delete/84984/active/&confirm_data= )

Link to comment
Share on other sites

9 hours ago, Blesta Addons said:

i will check with my team, the last time i have tested with a custom plugin it was returning error (404) as it fetch the modal from url without client prefix (GET  https://xxxxxxxxxxx/dialog/confirm/?message=Are you sur you want to delete this Playlist?&confirm_url=/plugin/smart_one/client_main/delete/84984/active/&confirm_data= )

I see now, the client ticket list page does this:


        $('#client_tickets a[rel]').blestaModalConfirm({
            base_url: '<?php echo (isset($this->client_uri) ? $this->Html->safe($this->client_uri) : null);?>',
            submit: true,
            confirm_data: {id: $('input[name=\"id\"]', $(this)).val()}
        });

 

Instead of making you do the same, I will create a task to add a dialog.php controller so the /dialog will be a valid path instead of requiring /client/dialog.  Is this sufficient to resolve the issue?

Link to comment
Share on other sites

 

57 minutes ago, Jono said:

see now, the client ticket list page does this:



        $('#client_tickets a[rel]').blestaModalConfirm({
            base_url: '<?php echo (isset($this->client_uri) ? $this->Html->safe($this->client_uri) : null);?>',
            submit: true,
            confirm_data: {id: $('input[name=\"id\"]', $(this)).val()}
        });

we have the base_uri instead of client_uri, and we have fixed with client_uri.

the issue is not the popup modal, is the client navigation url, some plugin is set for client side and need to be under client prefix, others for public and should be without client prefix , i think this is the issue not the dialog modal.

that was my point of view regarding PUBLIC and CLIENT navigation url, if they are the same why we have public and client?!!

Link to comment
Share on other sites

5 minutes ago, Blesta Addons said:

the issue is not the popup modal, is the client navigation url, some plugin is set for client side and need to be under client prefix, others for public and should be without client prefix , i think this is the issue not the dialog modal.

I'm sorry, I still don't understand why the prefix is necessary.  The client controllers can extend ClientController and have a name like client_main regardless of whether they are accessed with the client prefix.

6 minutes ago, Blesta Addons said:

that was my point of view regarding PUBLIC and CLIENT navigation url, if they are the same why we have public and client?!!

Fair question.  I'm not sure we do need a Public and Client URI, perhaps we should consider removing them.  Obviously we still would keep client vs public navigation though as we wouldn't display the same nav items to each.

Link to comment
Share on other sites

40 minutes ago, Jono said:

Obviously we still would keep client vs public navigation though as we wouldn't display the same nav items to each.

and this is correct, and also it should has different navigation link for clients and public. unless we considerate a client is like a public.

finally, the client prefix exist for something, if not it should be removed.

Link to comment
Share on other sites

38 minutes ago, Blesta Addons said:

finally, the client prefix exist for something, if not it should be removed.

In the core files, the client URI is mapped to client controllers, so for the core it has a purpose.  As far as I can tell, it doesn't have a purpose related to plugins, except a visual cue that lets the user know they are in the client interface.

Link to comment
Share on other sites

2 minutes ago, Blesta Addons said:

it has some effects in inherit classes or methods for Uri with client prefix?

Controllers can inherit the ClientController class regardless of whether they are accessed via the client_uri.  The ->base_uri is modified, but that shouldn't have an affect on the plugin related links.  The only issue would come when a plugin was using ->base_uri to link to a core client controller.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...