How to add buttons to my Spartacus storefront? - sap-commerce-cloud

I am trying to add buttons to my Spartacus storefront.
The problem that is preventing me to progress ahead is:
1)If I generate new button angular component, using Angular, should it be mentioned inside the
tag or outside of that?
2)Should it be rendered in a different way as first?

Check out this repo and the corresponding stackblitz project. The easiest way add new buttons would be to place it in reference to an existing standard component using the outlets. Essentially, you could do some like the following, placing your new angular component app-custom-component before the ExistingComponent.
<ng-template cxOutletRef="ExistingComponent" cxOutletPos="before">
<app-custom-component></app-custom-component>
</ng-template>

Can you describe the problem more clearly? As much as I understood you are looking for below kind of code. For code check this link Spartacus Product Page
<div class="row">
<div class="col-md-6">
<button
class="btn btn-block btn-action"
(click)="addAddressButtonHandle()"
>
{{ 'addressBook.addNewAddress' | cxTranslate }}
</button>
</div>
</div>

Related

Does waitForElementVisible not search for input elements?

I am using nightwatch.js to perform end-to-end testing and have to use a roundabout method for a waitForElementVisible command to work as expected. For example, my code below:
browser.waitForElementVisible(".profile label[for='Admin']") // works
browser.waitForElementVisible(".profile label[for='Admin'] input[id='Admin']") // breaks
For further clarification, I am testing to see if a radio button is visible. The radio button's DOM elements is as such:
<div class='profile'>
<div class='roleSelector'>
<label for="Admin">
<input type="radio" id="Admin" class="Admin">
</label>
</div>
</div>
As far as I know, there is no such specific case.
Did you try using '.profile input[id='Admin']' ?
Hope that serves your purpose at hand.

Multi column combo box in Kendo for Angular 2

I am trying to create multi-column combo-box in Kendo-Angular 2.I can't find it in the documentation: https://www.telerik.com/kendo-angular-ui/components/dropdowns/ Is this option present in the Kendo support for Angular 2?
The MultiSelect component provides numerous templates, which could be used to control the rendering of the header, footer and the item content. That being said, we can easily achieve different layout using some additional styling.
<kendo-multiselect
[data]="listItems"
[(ngModel)]="value"
[textField]="'text'"
[valueField]="'value'"
>
<ng-template kendoMultiSelectHeaderTemplate>
<div class="dropdown-header k-widget k-header">
<span>Value</span>
<span>Text</span>
</div>
</ng-template>
<ng-template kendoMultiSelectItemTemplate let-dataItem>
<span class="k-state-default"><h3>{{dataItem.value}}</h3></span>
<span class="k-state-default"><h3>{{dataItem.text}}</h3></span>
</ng-template>
</kendo-multiselect>
Here is a plunker that demonstrates the templates usage:
http://plnkr.co/edit/BvdyXuQ4TQ5OFwDliqYd?p=preview
Please note, that the component doesn't have table-like layout and you will need to implement it manually. Nevertheless as it is shown in the demo, this shouldn't be a tough task.

Bootstrap Fileinput cannot hide progress bar (nodejs/Electron)

I am creating an Electron project and I am using Bootstrap Fileinput.
<div class="form-group">
<label class="control-label col-xs-3">Folder containing installation/patch scripts</label>
<div class="col-xs-9">
<input id="input-2" name="input2" type="file" class="file" data-show-upload="false" data-show-preview="false" data-show-cancel="false" webkitdirectory>
</div>
</div>
The control is rendered fine and works. The issue is that, as soon as the control is rendered, I can see "0%" above it. No matter what I have tried I cannot remove that. I don't want a progress bar to be visible, the control will work only to locate a folder name, which will then be used for other purposes.
Any ideas why I always see the progress bar?
I found the solution. I had to add the following option in js code when I create fileinput:
layoutTemplates: {progress: ''}

Ionic Framework: Left and Right sidemenus disappear on navigation

I'm trying to create an ionic app which has a left and right sidemenu, but I'm finding that the side-menu icons (and the ability to swipe left or right to open them) is disappearing when I try to navigate. I'm obviously doing something wrong, but I can't see what it is.
see here ... http://plnkr.co/NpqmVT ... for plunker which demonstrates the problem. To replicate the bug simply click on the 'click to view details' button.
My main user interface (I'm guessing this is where I'm doing something wrong) looks like this...
<ion-side-menu-content>
<ion-nav-bar class="bar-positive">
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
</ion-nav-buttons>
<ion-nav-buttons side="right">
<button class="button button-icon button-clear ion-navicon" menu-toggle="right">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="centre-panel"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-dark">
<h1 class="title">Main Menu</h1>
</ion-header-bar>
<ion-content>
<ion-list>
<ion-item ui-sref="ui.page1" nav-clear menu-close >Page 1</ion-item>
<ion-item ui-sref="ui.page2" nav-clear menu-close >Page 2</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
<ion-side-menu side="right">
<ion-header-bar class="bar-dark">
<h1 class="title">Right Menu</h1>
</ion-header-bar>
<ion-nav-view name="right-panel"></ion-nav-view>
</ion-side-menu>
</ion-side-menus>
All the routes, etc can be found in the plunkr (http://plnkr.co/NpqmVT)
Thanks for any help you can offer.
just faced the same problem and found a solution - add this directive to the ion-side menus:
<ion-side-menus enable-menu-with-back-views="true">

Why isn't my list displaying in Orchard?

In Orchard 1.3.10 when I create a list it gets assigned a permalink such as /people. When I add a person to the list and go to /people the person does not display. I see
When I add a widget to display people the person displays.
Am I doing something wrong, or is this Orchard working as designed?
Using the shape tracing module I see this In my content zone:
<div class="zone zone-content"> <div class="content-control">
<div class="manage-actions">Edit</div>
<article class="content-item list">
<header>
</header>
</article>
</div>
</div>
Creating a new site fixed my issue.
On my debug site I'm able to work around the issue by changing my list sort order, but not on my real site.
I filed a bug here: http://orchard.codeplex.com/workitem/18421

Resources