Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h2>Grid</h2>
<sac-gridcolumnaction
name="editCol"
[type]="type"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
width="105px">
<sac-gridbutton
name="editrow"
Expand All @@ -38,17 +39,20 @@ <h2>Grid</h2>
[type]="type"
header="ID"
[value]="row.Id"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
(rowclicked)="action(row.Id)"></sac-gridcolumn>
<sac-gridcolumn
name="someName14"
[type]="type"
header="Bild"
[value]="row.Image"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
width="25%"></sac-gridcolumn>
<sac-gridcolumn
name="someName35"
[type]="type"
header="Bezeichnung"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
[value]="row.Bezeichnung"
width="25%"></sac-gridcolumn>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h2>Grid</h2>
<sac-gridcolumnaction
name="editCol"
[type]="type"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
width="116px">
<sac-gridbutton
name="editrow"
Expand All @@ -38,18 +39,21 @@ <h2>Grid</h2>
[type]="type"
header="ID"
[value]="row.Id"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
(rowclicked)="action(row.Id)"></sac-gridcolumn>
<sac-gridcolumn
name="someName14"
[type]="type"
header="Bild"
[value]="row.Image"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
width="25%"></sac-gridcolumn>
<sac-gridcolumn
name="someName35"
[type]="type"
header="Bezeichnung"
[value]="row.Bezeichnung"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
width="25%"></sac-gridcolumn>
</ng-template>
</sac-grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h2>Grid</h2>
<sac-gridcolumnaction
name="editCol"
[type]="type"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
width="116px">
<sac-gridbutton
name="editrow"
Expand All @@ -38,18 +39,21 @@ <h2>Grid</h2>
[type]="type"
header="ID"
[value]="row.Id"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
(rowclicked)="action(row.Id)"></sac-gridcolumn>
<sac-gridcolumn
name="someName14"
[type]="type"
header="Bild"
[value]="row.Image"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
width="25%"></sac-gridcolumn>
<sac-gridcolumn
name="someName35"
[type]="type"
header="Bezeichnung"
[value]="row.Bezeichnung"
[contextstyle]="row.Id === 4 ? 'info' : 'none'"
width="25%"></sac-gridcolumn>
</ng-template>
</sac-grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('SacGridComponent', () => {
componentProperties: {
values: [],
},
}
},
);

cy.get('table').should('exist');
Expand Down Expand Up @@ -125,7 +125,7 @@ describe('SacGridComponent', () => {
sortAction: createOutputSpy('sortAction'),
sortSorting: { SortColumn: 'Id', SortOrder: SortOrder.Ascending },
},
}
},
);

cy.get('table').should('exist');
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('SacGridComponent', () => {
pageAction: createOutputSpy('pageAction'),
pageData: { TotalRowCount: 21, CurrentPageIndex: 0, PageSize: 20 },
},
}
},
);

cy.get('table').should('exist');
Expand Down Expand Up @@ -271,7 +271,7 @@ describe('SacGridComponent', () => {
],
columnAction: createOutputSpy('columnAction'),
},
}
},
);

cy.get('table').should('exist');
Expand Down Expand Up @@ -346,7 +346,7 @@ describe('SacGridComponent', () => {
},
],
},
}
},
);

cy.get('table').should('exist');
Expand Down Expand Up @@ -411,7 +411,7 @@ describe('SacGridComponent', () => {
],
columnAction: createOutputSpy('columnAction'),
},
}
},
);

cy.get('table').should('exist');
Expand Down Expand Up @@ -500,13 +500,98 @@ describe('SacGridComponent', () => {
},
],
},
}
},
);

cy.get('table').should('exist');
cy.get('table tr td').eq(3).isTruncated();
});

it('should have context class at row', () => {
cy.mount(
`<form>
<sac-grid name="gridDefault" [value]="values" emptytext="No Data">
<ng-template
let-row="row"
let-type="type">
<sac-gridcolumnaction
name="actionCol"
[type]="type"
[contextstyle]="row.Style"
width="116px">
<sac-gridbutton
name="editrow"
icon="edit"
isdisabled="true"
(clicked)="columnAction.emit(row.Id)">
</sac-gridbutton>
<sac-gridbutton
name="deleterow"
icon="delete"
(clicked)="action($event)"
[isdisabled]="true">
</sac-gridbutton>
<sac-gridbutton
iconstyle="fa"
icon="fa-info-circle"
(clicked)="action('info')">
</sac-gridbutton>
<sac-gridimage iconstyle="fa fa-exclamation-triangle"></sac-gridimage>
</sac-gridcolumnaction>
<sac-gridcolumn
name="columnId"
[type]="type"
header="ID"
[value]="row.Id"
sortkey="Id"
[contextstyle]="row.Style"
(rowclicked)="action(row.Id)">
</sac-gridcolumn>
<sac-gridcolumn
name="columnText"
[type]="type"
header="Bild"
[value]="row.Image"
[contextstyle]="row.Style"
width="25%">
</sac-gridcolumn>
</ng-template>
</sac-grid>
</form>`,
{
declarations: [SacFormDirective],
imports: [FormsModule, SACBootstrap3GridModule, SACBootstrap3LayoutModule, SACCommonUtliltiesModule],
componentProperties: {
values: [
{
Id: 1,
Image: 'Bild 1',
Style: 'success',
},
{
Id: 2,
Image: 'Bild 2',
Style: 'none',
},
{
Id: 3,
Image: 'Bild 3',
Style: 'info',
},
],
},
},
);

cy.get('table').should('exist');
cy.get('table tr td').eq(0).should('have.class', 'success');
cy.get('table tr td').eq(2).should('have.class', 'success');
cy.get('table tr td').eq(3).should('not.have.class', 'success');
cy.get('table tr td').eq(5).should('not.have.class', 'success');
cy.get('table tr td').eq(6).should('have.class', 'info');
cy.get('table tr td').eq(8).should('have.class', 'info');
});

it('should has e2 testkey with name', () => {
cy.mount(
`<form>
Expand Down Expand Up @@ -565,7 +650,7 @@ describe('SacGridComponent', () => {
},
},
],
}
},
);

cy.shouldHaveTestAttributeWithName('sac-grid > table', 'myControl');
Expand Down Expand Up @@ -629,7 +714,7 @@ describe('SacGridComponent', () => {
},
},
],
}
},
);

cy.shouldHaveTestAttributeWithName('sac-grid > table', 'myTestidentifier');
Expand Down Expand Up @@ -693,7 +778,7 @@ describe('SacGridComponent', () => {
},
},
],
}
},
);

cy.shouldHaveTestAttributeWithName('sac-grid > table', 'myTestidentifier');
Expand Down Expand Up @@ -749,7 +834,7 @@ describe('SacGridComponent', () => {
componentProperties: {
values: [],
},
}
},
);

cy.shouldHaveDisabledTestAttribute('sac-grid > table');
Expand Down Expand Up @@ -792,7 +877,7 @@ describe('SacGridComponent', () => {
],
columnvisible: true,
},
}
},
);

cy.get('table').should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
[style.text-overflow]="IsEllipsis() ? 'ellipsis' : null"
[style.white-space]="IsEllipsis() ? 'nowrap' : null"
[class.text-right]="alignment === 'right'"
[class.text-center]="alignment === 'center'">
[class.text-center]="alignment === 'center'"
[class.active]="contextstyle === 'active' || contextstyle === 'primary' || contextstyle === 'secondary' || contextstyle === 'light' || contextstyle === 'dark'"
[class.success]="contextstyle === 'success'"
[class.warning]="contextstyle === 'warning'"
[class.danger]="contextstyle === 'danger'"
[class.info]="contextstyle === 'info'">
<span
[attr.title]="IsEllipsis() ? value : null"
[innerHtml]="value"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
scope="col"
*ngIf="IsBody()"
[class.text-right]="alignment === 'right'"
[class.text-center]="alignment === 'center'">
[class.text-center]="alignment === 'center'"
[class.active]="contextstyle === 'active' || contextstyle === 'primary' || contextstyle === 'secondary' || contextstyle === 'light' || contextstyle === 'dark'"
[class.success]="contextstyle === 'success'"
[class.warning]="contextstyle === 'warning'"
[class.danger]="contextstyle === 'danger'"
[class.info]="contextstyle === 'info'">
<ng-content></ng-content>
</td>
Loading
Loading