mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4650] Fix and refactor amount, date and date-time widgets (#4957)
* [ADF-4650] Fix and refactor amount, date and date-time widgets * fix e2e tests * Fix people cloud test * Fix e2e date test * fix lint
This commit is contained in:
committed by
Eugenio Romano
parent
624ca9f0ae
commit
479416861f
@@ -97,30 +97,24 @@ describe('People Groups Cloud Component', () => {
|
|||||||
|
|
||||||
afterAll(async (done) => {
|
afterAll(async (done) => {
|
||||||
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
|
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
|
||||||
for (let i = 0; i < users.length; i++) {
|
users.forEach(async (user) => {
|
||||||
await identityService.deleteIdentityUser(users[i]);
|
await identityService.deleteIdentityUser(user);
|
||||||
}
|
});
|
||||||
for (let i = 0; i < groups.length; i++) {
|
|
||||||
await groupIdentityService.deleteIdentityGroup(groups[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
groups.forEach(async (group) => {
|
||||||
await identityService.deleteIdentityUser(apsUser.idIdentityService);
|
await groupIdentityService.deleteIdentityGroup(group);
|
||||||
await identityService.deleteIdentityUser(activitiUser.idIdentityService);
|
});
|
||||||
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(async () => {
|
||||||
|
await browser.refresh();
|
||||||
navigationBarPage.navigateToPeopleGroupCloudPage();
|
navigationBarPage.navigateToPeopleGroupCloudPage();
|
||||||
peopleGroupCloudComponentPage.checkGroupsCloudComponentTitleIsDisplayed();
|
peopleGroupCloudComponentPage.checkGroupsCloudComponentTitleIsDisplayed();
|
||||||
peopleGroupCloudComponentPage.checkPeopleCloudComponentTitleIsDisplayed();
|
peopleGroupCloudComponentPage.checkPeopleCloudComponentTitleIsDisplayed();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async () => {
|
|
||||||
await browser.refresh();
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('[C297674] Should be able to add filtering to People Cloud Component', () => {
|
describe('[C297674] Should be able to add filtering to People Cloud Component', () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -303,7 +297,6 @@ describe('People Groups Cloud Component', () => {
|
|||||||
`{"firstName":"${activitiUser.firstName}","lastName":"${activitiUser.lastName}",{"firstName":"${noRoleUser.firstName}","lastName":"${noRoleUser.lastName}"]`);
|
`{"firstName":"${activitiUser.firstName}","lastName":"${activitiUser.lastName}",{"firstName":"${noRoleUser.firstName}","lastName":"${noRoleUser.lastName}"]`);
|
||||||
browser.sleep(200);
|
browser.sleep(200);
|
||||||
expect(peopleCloudComponent.getAssigneeFieldContent()).toBe('');
|
expect(peopleCloudComponent.getAssigneeFieldContent()).toBe('');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@@ -86,7 +86,7 @@ describe('Form Component', () => {
|
|||||||
|
|
||||||
widget.dateWidget().checkLabelIsVisible(fields.dateWidgetId);
|
widget.dateWidget().checkLabelIsVisible(fields.dateWidgetId);
|
||||||
widget.dateWidget().setDateInput(fields.dateWidgetId, message.test);
|
widget.dateWidget().setDateInput(fields.dateWidgetId, message.test);
|
||||||
widget.dateWidget().clickOutsideWidget(fields.dateWidgetId);
|
formPage.saveForm();
|
||||||
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningDate);
|
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningDate);
|
||||||
formPage.checkErrorLogMessage(message.errorLogDate);
|
formPage.checkErrorLogMessage(message.errorLogDate);
|
||||||
|
|
||||||
|
@@ -91,16 +91,14 @@ describe('Date and time widget', () => {
|
|||||||
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
|
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
|
||||||
widget.dateTimeWidget().closeDataTimeWidget();
|
widget.dateTimeWidget().closeDataTimeWidget();
|
||||||
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-17 07:30 PM');
|
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-17 07:30 PM');
|
||||||
widget.dateTimeWidget().clickOutsideWidget(app.FIELD.date_time_between_input);
|
taskPage.formFields().saveForm();
|
||||||
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be less than');
|
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be less than');
|
||||||
|
|
||||||
|
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
|
||||||
widget.dateTimeWidget().closeDataTimeWidget();
|
widget.dateTimeWidget().closeDataTimeWidget();
|
||||||
|
|
||||||
widget.dateTimeWidget().clickOutsideWidget(app.FIELD.date_time_between_input);
|
|
||||||
widget.dateTimeWidget().removeFromDatetimeWidget(app.FIELD.date_time_between_input);
|
widget.dateTimeWidget().removeFromDatetimeWidget(app.FIELD.date_time_between_input);
|
||||||
widget.dateTimeWidget().closeDataTimeWidget();
|
|
||||||
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-19 07:30 PM');
|
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-19 07:30 PM');
|
||||||
widget.dateTimeWidget().clickOutsideWidget(app.FIELD.date_time_between_input);
|
taskPage.formFields().saveForm();
|
||||||
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be greater than');
|
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be greater than');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -78,17 +78,17 @@ describe('Date widget', () => {
|
|||||||
expect(widget.dateWidget().getDateLabel(app.FIELD.date_input)).toContain('Date');
|
expect(widget.dateWidget().getDateLabel(app.FIELD.date_input)).toContain('Date');
|
||||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||||
widget.dateWidget().setDateInput(app.FIELD.date_input, '20-10-2018');
|
widget.dateWidget().setDateInput(app.FIELD.date_input, '20-10-2018');
|
||||||
widget.dateWidget().clickOutsideWidget(app.FIELD.date_input);
|
taskPage.formFields().saveForm();
|
||||||
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('[C277234] Should be able to set advanced settings for Date widget ', () => {
|
it('[C277234] Should be able to set advanced settings for Date widget ', () => {
|
||||||
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2017');
|
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2017');
|
||||||
widget.dateWidget().clickOutsideWidget(app.FIELD.date_between_input);
|
taskPage.formFields().saveForm();
|
||||||
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be less than 1-10-2018');
|
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be less than 1-10-2018');
|
||||||
widget.dateWidget().clearDateInput(app.FIELD.date_between_input);
|
widget.dateWidget().clearDateInput(app.FIELD.date_between_input);
|
||||||
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2019');
|
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2019');
|
||||||
widget.dateWidget().clickOutsideWidget(app.FIELD.date_between_input);
|
taskPage.formFields().saveForm();
|
||||||
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be greater than 31-10-2018');
|
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be greater than 31-10-2018');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
<label class="adf-label" [attr.for]="field.id">{{field.name | translate }}<span *ngIf="isRequired()">*</span></label>
|
<label class="adf-label" [attr.for]="field.id">{{field.name | translate }}<span *ngIf="isRequired()">*</span></label>
|
||||||
<span matPrefix class="adf-amount-widget__prefix-spacing">{{ currency }}</span>
|
<span matPrefix class="adf-amount-widget__prefix-spacing">{{ currency }}</span>
|
||||||
<input matInput
|
<input matInput
|
||||||
class="adf-amount-widget"
|
class="adf-input"
|
||||||
type="text"
|
type="text"
|
||||||
[id]="field.id"
|
[id]="field.id"
|
||||||
[required]="isRequired()"
|
[required]="isRequired()"
|
||||||
|
@@ -3,38 +3,17 @@
|
|||||||
.adf {
|
.adf {
|
||||||
&-amount-widget {
|
&-amount-widget {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
vertical-align: baseline !important;
|
|
||||||
|
|
||||||
.mat-input-placeholder {
|
.mat-input-element {
|
||||||
margin-top: 5px;
|
margin-left: 13px;
|
||||||
display: none;
|
margin-right: 13px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mat-form-field-flex {
|
&-amount-widget__container .mat-form-field-label-wrapper {
|
||||||
position: relative;
|
top: 17px;
|
||||||
padding-top: 18.5px;
|
left: 12px;
|
||||||
}
|
right: 12px;
|
||||||
|
|
||||||
.mat-form-field-infix {
|
|
||||||
position: static;
|
|
||||||
padding-top: 19px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.adf-label {
|
|
||||||
position: absolute;
|
|
||||||
top: 18.5px;
|
|
||||||
left:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
&-amount-widget__container {
|
|
||||||
max-width: 100%;
|
|
||||||
|
|
||||||
.mat-form-field-label-wrapper {
|
|
||||||
top: 34px !important;
|
|
||||||
left: 13px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&-amount-widget__input .mat-focused {
|
&-amount-widget__input .mat-focused {
|
||||||
@@ -42,8 +21,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-amount-widget__prefix-spacing {
|
&-amount-widget__prefix-spacing {
|
||||||
padding-right: 5px;
|
position: absolute;
|
||||||
}
|
top: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,27 +1,11 @@
|
|||||||
@import '../form';
|
@import '../form';
|
||||||
|
|
||||||
.adf {
|
.adf {
|
||||||
|
|
||||||
&-date-time-widget {
|
&-date-time-widget {
|
||||||
|
|
||||||
.mat-form-field-suffix {
|
.mat-form-field-suffix {
|
||||||
text-align: right;
|
top: 26px;
|
||||||
position: absolute;
|
|
||||||
margin-top: 30px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* query for Microsoft IE 11*/
|
|
||||||
@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
|
|
||||||
&-date-widget {
|
|
||||||
.mat-form-field-suffix {
|
|
||||||
position: relative;
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,44 +1,9 @@
|
|||||||
@import '../form';
|
@import '../form';
|
||||||
|
|
||||||
.adf {
|
.adf {
|
||||||
|
|
||||||
&-date-widget {
|
&-date-widget {
|
||||||
.mat-form-field-suffix {
|
.mat-form-field-suffix {
|
||||||
text-align: right;
|
top: 26px;
|
||||||
position: absolute;
|
|
||||||
margin-top: 30px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-date-widget-button {
|
|
||||||
position: relative;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-date-input {
|
|
||||||
padding-top: 5px;
|
|
||||||
padding-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-grid-date-widget {
|
|
||||||
align-items: center;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-date-widget-button__cell {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* query for Microsoft IE 11*/
|
|
||||||
@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
|
|
||||||
&-date-widget {
|
|
||||||
.mat-form-field-suffix {
|
|
||||||
position: relative;
|
|
||||||
width: auto;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
@@ -17,10 +17,12 @@
|
|||||||
|
|
||||||
import { element, by } from 'protractor';
|
import { element, by } from 'protractor';
|
||||||
import { BrowserVisibility } from '../../utils/browser-visibility';
|
import { BrowserVisibility } from '../../utils/browser-visibility';
|
||||||
|
import { BrowserActions } from '../../utils/public-api';
|
||||||
|
|
||||||
export class FormPage {
|
export class FormPage {
|
||||||
|
|
||||||
errorLog = element(by.css('div[class*="console"]'));
|
errorLog = element(by.css('div[class*="console"]'));
|
||||||
|
saveButton = element(by.cssContainingText('mat-card-actions[class*="adf-for"] span', 'SAVE'));
|
||||||
|
|
||||||
checkErrorMessageForWidgetIsDisplayed(errorMessage) {
|
checkErrorMessageForWidgetIsDisplayed(errorMessage) {
|
||||||
return BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('.adf-error-text', errorMessage)));
|
return BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText('.adf-error-text', errorMessage)));
|
||||||
@@ -40,4 +42,9 @@ export class FormPage {
|
|||||||
return BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('div[class*="console"] p', errorMessage)));
|
return BrowserVisibility.waitUntilElementIsNotVisible(element(by.cssContainingText('div[class*="console"] p', errorMessage)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveForm() {
|
||||||
|
BrowserActions.click(this.saveButton);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user