chore: rename from app to desk
This commit is contained in:
parent
befa024365
commit
49714e916f
17 changed files with 19 additions and 19 deletions
|
|
@ -81,7 +81,7 @@ def get_default_path():
|
|||
if len(_apps) == 1:
|
||||
return _apps[0].get("route") or "/apps"
|
||||
elif is_desk_apps(_apps):
|
||||
return "/app"
|
||||
return "/desk"
|
||||
return "/apps"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class LoginManager:
|
|||
frappe.local.cookie_manager.set_cookie("system_user", "yes", deduplicate=True)
|
||||
if not resume:
|
||||
frappe.local.response["message"] = "Logged In"
|
||||
frappe.local.response["home_page"] = get_default_path() or "/app"
|
||||
frappe.local.response["home_page"] = get_default_path() or "/desk"
|
||||
|
||||
if not resume:
|
||||
frappe.response["full_name"] = self.full_name
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ class TestUser(IntegrationTestCase):
|
|||
frappe.set_user("testpassword@example.com")
|
||||
test_user = frappe.get_doc("User", "testpassword@example.com")
|
||||
key = self.reset_password(test_user)
|
||||
self.assertEqual(update_password(new_password, key=key), "/app")
|
||||
self.assertEqual(update_password(new_password, key=key), "/desk")
|
||||
self.assertEqual(
|
||||
update_password(new_password, key="wrong_key"),
|
||||
"The reset password link has either been used before or is invalid",
|
||||
|
|
|
|||
|
|
@ -951,7 +951,7 @@ def update_password(
|
|||
frappe.db.set_value("User", user, "reset_password_key", "")
|
||||
|
||||
if user_doc.user_type == "System User":
|
||||
return get_default_path() or "/app"
|
||||
return get_default_path() or "/desk"
|
||||
else:
|
||||
return redirect_url or get_default_path() or get_home_page()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
context("Client Script", () => {
|
||||
before(() => {
|
||||
cy.login();
|
||||
cy.visit("/app");
|
||||
cy.visit("/desk");
|
||||
});
|
||||
|
||||
it("should run form script in doctype form", () => {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ frappe.setup = {
|
|||
|
||||
frappe.pages["setup-wizard"].on_page_load = function (wrapper) {
|
||||
if (frappe.boot.setup_complete) {
|
||||
window.location.href = frappe.boot.apps_data.default_path || "/app";
|
||||
window.location.href = frappe.boot.apps_data.default_path || "/desk";
|
||||
}
|
||||
let requires = frappe.boot.setup_wizard_requires || [];
|
||||
frappe.require(requires, function () {
|
||||
|
|
@ -219,7 +219,7 @@ frappe.setup.SetupWizard = class SetupWizard extends frappe.ui.Slides {
|
|||
localStorage.current_route = "";
|
||||
localStorage.current_app = "";
|
||||
|
||||
window.location.href = current_route || frappe.boot.apps_data.default_path || "/app";
|
||||
window.location.href = current_route || frappe.boot.apps_data.default_path || "/desk";
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ def callback(state: str, code: str | None = None, error: str | None = None) -> N
|
|||
along with committing and redirecting us back to frappe site."""
|
||||
|
||||
state = json.loads(state)
|
||||
redirect = state.pop("redirect", "/app")
|
||||
redirect = state.pop("redirect", "/desk")
|
||||
success_query_param = state.pop("success_query_param", "")
|
||||
failure_query_param = state.pop("failure_query_param", "")
|
||||
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
|
|||
|
||||
show() {
|
||||
// show it
|
||||
if (window.location.pathname.startsWith("/app")) {
|
||||
if (window.location.pathname.startsWith("/desk")) {
|
||||
this.handle_focus();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="sticky-top">
|
||||
<header class="navbar navbar-expand" role="navigation">
|
||||
<div class="container">
|
||||
<a class="navbar-brand navbar-home" href="/app">
|
||||
<a class="navbar-brand navbar-home" href="/desk">
|
||||
<img
|
||||
class="app-logo"
|
||||
src="{{ frappe.boot.app_data[0].app_logo_url }}"
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ frappe.breadcrumbs = {
|
|||
}
|
||||
|
||||
this.append_breadcrumb_element(
|
||||
`/app/${frappe.router.slug(breadcrumbs.workspace)}`,
|
||||
`/desk/${frappe.router.slug(breadcrumbs.workspace)}`,
|
||||
__(breadcrumbs.workspace)
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ frappe.show_message_page = function (opts) {
|
|||
<div class="text-center message-page-content">\
|
||||
%(img)s\
|
||||
<p class="lead">%(message)s</p>\
|
||||
<a class="btn btn-default btn-sm btn-home" href="/app">%(home)s</a>\
|
||||
<a class="btn btn-default btn-sm btn-home" href="/desk">%(home)s</a>\
|
||||
</div>\
|
||||
</div>',
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
</a>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
<a class="dropdown-item switch-to-desk hidden" href="/app">{{ _('Switch To Desk') }}</a>
|
||||
<a class="dropdown-item switch-to-desk hidden" href="/desk">{{ _('Switch To Desk') }}</a>
|
||||
<a class="dropdown-item apps hidden" href="/apps">{{ _('Apps') }}</a>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
{{ _("Success") }}</span>
|
||||
</div>
|
||||
<p>{{ _("Your connection request to Google Calendar was successfully accepted") }}</p>
|
||||
<div><a href='{{ "/app" }}' class='btn btn-primary btn-sm'>
|
||||
<div><a href='{{ "/desk" }}' class='btn btn-primary btn-sm'>
|
||||
{{ _("Back to Desk") }}</a></div>
|
||||
</div>
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ class TestPerformance(IntegrationTestCase):
|
|||
)
|
||||
|
||||
def test_homepage_resolver(self):
|
||||
paths = ["/", "/app"]
|
||||
paths = ["/", "/desk"]
|
||||
for path in paths:
|
||||
PathResolver(path).resolve()
|
||||
with self.assertQueryCount(1):
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class NotPermittedPage(TemplatePage):
|
|||
|
||||
def render(self):
|
||||
action = f"/login?redirect-to={quote_plus(frappe.request.path)}"
|
||||
if frappe.request.path.startswith("/app/") or frappe.request.path == "/app":
|
||||
if frappe.request.path.startswith("/app/") or frappe.request.path == "/desk":
|
||||
action = "/login"
|
||||
frappe.local.message_title = _("Not Permitted")
|
||||
frappe.local.response["context"] = dict(
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ def get_context():
|
|||
default_app = user_default_app if user_default_app else system_default_app
|
||||
|
||||
if len(all_apps) == 0:
|
||||
frappe.local.flags.redirect_location = "/app"
|
||||
frappe.local.flags.redirect_location = "/desk"
|
||||
raise frappe.Redirect
|
||||
|
||||
for app in all_apps:
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ def get_context(context):
|
|||
if frappe.session.data.user_type == "Website User":
|
||||
redirect_to = get_default_path() or get_home_page()
|
||||
else:
|
||||
redirect_to = get_default_path() or "/app"
|
||||
redirect_to = get_default_path() or "/desk"
|
||||
|
||||
if redirect_to != "login":
|
||||
frappe.local.flags.redirect_location = redirect_to
|
||||
|
|
@ -215,7 +215,7 @@ def sanitize_redirect(redirect: str | None) -> str | None:
|
|||
)
|
||||
if parsed_redirect.netloc:
|
||||
if parsed_request_host.netloc != parsed_redirect.netloc:
|
||||
output_parsed_url = output_parsed_url._replace(path="/app")
|
||||
output_parsed_url = output_parsed_url._replace(path="/desk")
|
||||
else:
|
||||
output_parsed_url = output_parsed_url._replace(path=parsed_redirect.path)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue