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

Use History Mode in Vue Router #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions screen/store/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var appObjects = {
// see https://router.vuejs.org/en/essentials/history-mode.html
// for route path expressions see https://router.vuejs.org/en/essentials/dynamic-matching.html AND https://github.com/vuejs/vue-router/blob/dev/examples/route-matching/app.js
router: new VueRouter({
// TODO sooner or later: base: storeConfig.basePath, mode: 'history',
mode: 'history', base: ($("#confLinkBasePath").val() || "/d"),
routes: [
{ path: "/login", name: "login", component: storeComps.LoginPageTemplate,
beforeEnter: function(to, from, next){
Expand Down Expand Up @@ -38,8 +38,8 @@ const fixIdScrolling = {
document.querySelector(idToScrollTo).scrollIntoView();
}
});
},
},
}
}
};
// TODO: leave this, reminder to use vue.min.js for production: Vue.config.productionTip = false;

Expand Down
2 changes: 1 addition & 1 deletion screen/store/components/template/CheckoutSuccess.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<hr class="hr-title">
<div class="row mb-2">
<span class="col text-blight">ORDER NUMBER: </span>
<a class="col order-link-text" :href="'/store/d#/orders/'+orderList.orderHeader.orderId">
<a class="col order-link-text" :href="'/store/d/orders/'+orderList.orderHeader.orderId">
{{orderList.orderHeader.orderId}}
</a>
</div>
Expand Down
5 changes: 4 additions & 1 deletion screen/store/d.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ along with this software (see the LICENSE.md file). If not, see
]]></script></pre-actions>

<widgets>
<render-mode><text type="html"><![CDATA[<div id="app"></div>]]></text></render-mode>
<render-mode><text type="html"><![CDATA[
<input type="hidden" id="confLinkBasePath" value="${sri.currentScreenUrl.path}">
<div id="app"></div>
]]></text></render-mode>
<!-- TODO use server rendered footer to avoid redundant templates: <render-mode><text type="html" location="component://PopRestStore/template/store/footer.html.ftl"/></render-mode> -->
</widgets>
</screen>
10 changes: 5 additions & 5 deletions template/store/navbar.html.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
${partyDetail.firstName} ${partyDetail.lastName} ${partyDetail.organizationName!} <i class="fas fa-angle-down icon-down"></i>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item item-color" href="/store/d#/account">Account Settings</a>
<a class="dropdown-item item-color" href="/store/d#/orders">My Orders</a>
<a class="dropdown-item item-color" href="/store/d/account">Account Settings</a>
<a class="dropdown-item item-color" href="/store/d/orders">My Orders</a>
<div role="separator" class="dropdown-divider"></div>
<form method="get" action="/store/logOut">
<button type="submit" class="dropdown-item item-color">Signout</button>
Expand All @@ -90,10 +90,10 @@
</li>
<#else>
<li class="nav-item">
<a href="/store/d#/account/create" class="nav-link">Join Now</a>
<a href="/store/d/account/create" class="nav-link">Join Now</a>
</li>
<li class="nav-item">
<a href="/store/d#/login" class="nav-link"><i class="fas fa-user"></i> Sign In</a>
<a href="/store/d/login" class="nav-link"><i class="fas fa-user"></i> Sign In</a>
</li>
</#if>

Expand All @@ -107,7 +107,7 @@
</#if>
<li class="nav-item">
<#if cartCount gt 0>
<a class="nav-link" href="/store/d#/checkout">
<a class="nav-link" href="/store/d/checkout">
<#else>
<a class="nav-link pointer" data-toggle="modal" data-target="#emptyCartModal">
</#if>
Expand Down
2 changes: 1 addition & 1 deletion template/store/product.html.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<#if addedCorrect?? && addedCorrect == 'true'>
<div class="alert alert-primary mt-3 mb-3" role="alert">
<i class="far fa-check-square"></i> You added a ${product.productName} to your shopping cart.
<a class="float-right" href="/store/d#/checkout">Go to Checkout <i class="fas fa-arrow-right"></i></a>
<a class="float-right" href="/store/d/checkout">Go to Checkout <i class="fas fa-arrow-right"></i></a>
</div>
</#if>
<#-- <div class="row d-flex justify-content-center">
Expand Down