Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 20d5975

Browse files
committed
Dashboard: reflect tab selection in URL
1 parent 1d7e9ef commit 20d5975

File tree

8 files changed

+42
-8
lines changed

8 files changed

+42
-8
lines changed

core/src/plugins/access.ajxp_user/manifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@
102102
<a id="dash_back_workspace" onclick="ajaxplorer.triggerRepositoryChange('ajxp_home'); return false;"><span class="icon-chevron-left"></span> AJXP_MESSAGE[user_dash.53]</a>
103103
<span id="dash_title">AJXP_MESSAGE[user_dash.title]</span>
104104
</div>
105-
<div id="userdashboard_main_tab" ajxpClass="AjxpTabulator" class="dashboard_main_pane horizontal_tabulator left_tabulator" ajxpOptions='{"fit":"height", "fitMarginBottom":0, "fitParent":"orbit_content", "registerAsEditorOpener":false, "saveState":false,"events":{}, "tabsTips":"middle right", "defaultTabId": "parameters","tabInfos" : [{"id":"parameters","label":"user_dash.43", "title":"user_dash.43t","iconClass":"icon-cog", "element":"account_pane"}]}'>
105+
<div id="userdashboard_main_tab" ajxpClass="AjxpTabulator" class="dashboard_main_pane horizontal_tabulator left_tabulator" ajxpOptions='{"fit":"height", "fitMarginBottom":0, "fitParent":"orbit_content", "registerAsEditorOpener":false, "saveState":false, "route":{"base":"/dashboard"}, "events":{}, "tabsTips":"middle right", "defaultTabId": "profile","tabInfos" : [{"id":"profile","label":"user_dash.43", "title":"user_dash.43t","iconClass":"icon-cog", "element":"account_pane"}]}'>
106106
<div id="account_pane" ajxpClass="AjxpReactComponent" class="tabbed_editor" ajxpOptions='{"componentNamespace":"UserAccount","componentName":"ProfilePane"}'></div>
107107
</div>
108108
]]></template_part>
109109
<component_config className="AjxpTabulator::userdashboard_main_tab">
110110
<additional_tab id="my-users-pane"
111-
tabInfo='{"id":"info","label":"user_dash.46", "title":"user_dash.47","iconClass":"icon-book", "element":"my-users-pane", "position":2,"dontFocus":true}'
111+
tabInfo='{"id":"contacts","label":"user_dash.46", "title":"user_dash.47","iconClass":"icon-book", "element":"my-users-pane", "position":2,"dontFocus":true}'
112112
paneInfo='{"type":"widget"}'><![CDATA[
113113
<div id="my-users-pane" ajxpClass="AjxpPane" class="tabbed_editor">
114114
<div class="title-flex">

core/src/plugins/action.share/manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
</component_config>
428428
<component_config className="AjxpTabulator::userdashboard_main_tab">
429429
<additional_tab id="shared_pane2"
430-
tabInfo='{"id":"my-shared2","iconClass":"mdi mdi-share-variant","element":"shared_pane2","closeable":false,"label":"share_center.98","title":"share_center.99","dontFocus":true,"position":4}'
430+
tabInfo='{"id":"shares","iconClass":"mdi mdi-share-variant","element":"shared_pane2","closeable":false,"label":"share_center.98","title":"share_center.99","dontFocus":true,"position":4}'
431431
paneInfo='{"type":"widget"}'><![CDATA[
432432
<div id="shared_pane2" ajxpClass="AjxpPane" class="tabbed_editor">
433433
<div class="title-flex">

core/src/plugins/authfront.keystore/manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<client_configs>
2525
<component_config className="AjxpTabulator::userdashboard_main_tab">
2626
<additional_tab id="apikeys_pane"
27-
tabInfo='{"id":"my-api-data","iconClass":"icon-key","element":"apikeys_pane","closeable":false,"label":"keystore.1","title":"keystore.2","dontFocus":true,"position":6}'
27+
tabInfo='{"id":"apikeys","iconClass":"icon-key","element":"apikeys_pane","closeable":false,"label":"keystore.1","title":"keystore.2","dontFocus":true,"position":6}'
2828
paneInfo='{"type":"widget"}'><![CDATA[
2929
<div id="apikeys_pane" ajxpClass="ApikeysPane" ajxpOptions='{}' class="tabbed_editor" style="position:relative;">
3030
<div class="title-flex">

core/src/plugins/conf.sql/manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
<client_configs>
121121
<component_config className="AjxpTabulator::userdashboard_main_tab">
122122
<additional_tab id="team_pane"
123-
tabInfo='{"id":"team_pane","position":2,"iconClass":"icon-group","element":"team_pane","closeable":false,"label":"user_dash.50","title":"user_dash.51","dontFocus":true}'
123+
tabInfo='{"id":"teams","position":2,"iconClass":"icon-group","element":"team_pane","closeable":false,"label":"user_dash.50","title":"user_dash.51","dontFocus":true}'
124124
paneInfo='{"type":"widget"}'><![CDATA[
125125
<div id="team_pane" ajxpClass="AjxpPane" ajxpOptions='{"fit":"height"}'>
126126
<div class="title-flex">

core/src/plugins/core.conf/AbstractConfDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI
913913
} else {
914914
$baseURL = ApplicationState::detectServerURL(true);
915915
}
916-
$webdavBaseUrl = $baseURL.ConfService::getGlobalConf("WEBDAV_BASEURI")."/";
916+
$webdavBaseUrl = rtrim($baseURL,"/")."/".trim(ConfService::getGlobalConf("WEBDAV_BASEURI"), "/")."/";
917917
$davData = $loggedUser->getPref("AJXP_WEBDAV_DATA");
918918
$digestSet = isSet($davData["HA1"]);
919919
if (isSet($httpVars["activate"]) || isSet($httpVars["webdav_pass"])) {

core/src/plugins/core.conf/standard_conf_actions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@
631631
<client_configs>
632632
<component_config className="AjxpTabulator::userdashboard_main_tab">
633633
<additional_tab id="webdav_pane"
634-
tabInfo='{"id":"my-webdav-data","iconClass":"icon-cog","element":"webdav_pane","closeable":false,"label":"403","title":"403","dontFocus":true,"position":3}'
634+
tabInfo='{"id":"webdav","iconClass":"icon-cog","element":"webdav_pane","closeable":false,"label":"403","title":"403","dontFocus":true,"position":3}'
635635
paneInfo='{"type":"widget"}'><![CDATA[
636636
<div id="webdav_pane" ajxpClass="AjxpReactComponent" class="tabbed_editor" ajxpOptions='{"componentNamespace":"UserAccount","componentName":"WebDAVPane"}'></div>
637637
]]></additional_tab>

core/src/plugins/gui.ajax/res/js/es6/model/Router.es6

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class Router{
3535
pydioObject.goTo(path);
3636
}, 100);
3737
}
38+
pydio.notify("routechange", {workspace:workspace,path:path});
3839
}
3940

4041
});

core/src/plugins/gui.ajax/res/js/ui/prototype/class.AjxpTabulator.js

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ Class.create("AjxpTabulator", AjxpPane, {
102102
document.observe("ajaxplorer:user_logged", this.loadState.bind(this));
103103
this.loadState();
104104
}
105+
if(this.options.route){
106+
var routeOptions = this.options.route;
107+
if(pydio.Router) {
108+
this._bindToRouter(routeOptions);
109+
} else pydio.observeOnce("loaded", function(){
110+
if(pydio.Router) this._bindToRouter(routeOptions);
111+
}.bind(this));
112+
}
105113

106114
},
107115

@@ -484,7 +492,29 @@ Class.create("AjxpTabulator", AjxpPane, {
484492
this._eventPath = cNode.getPath();
485493
},
486494

487-
/**
495+
_bindToRouter: function(routeOptions){
496+
this.observe("switch", function(tabId){
497+
if(tabId){
498+
pydio.Router.router.navigate(routeOptions.base + "/" + tabId);
499+
}
500+
});
501+
this._routerObserver = function(object){
502+
if('/' + object.workspace === routeOptions.base){
503+
var tabId = PathUtils.getBasename(object.path);
504+
if(tabId) {
505+
this.switchTabulator(tabId);
506+
}else{
507+
this.switchTabulator(this.tabulatorData.first().id);
508+
}
509+
}
510+
}.bind(this);
511+
pydio.observe("routechange", this._routerObserver);
512+
window.setTimeout(function(){
513+
this.notify("switch", this.tabulatorData.first().id);
514+
}.bind(this), 500);
515+
},
516+
517+
/**
488518
* Resizes the widget
489519
*/
490520
resize : function(size, loop){
@@ -604,6 +634,9 @@ Class.create("AjxpTabulator", AjxpPane, {
604634
this.htmlElement.update("");
605635
try{pydio.UI.removeInstanceFromCache(this.htmlElement.id);}catch(e){}
606636
this.htmlElement = null;
637+
if(this._routerObserver){
638+
pydio.stopObserving("routechange", this._routerObserver);
639+
}
607640
},
608641

609642

0 commit comments

Comments
 (0)