Skip to content

Commit ef384be

Browse files
renemadsenclaude
andcommitted
fix(calendar): place required * directly after field name in eForm preview
Remove flex:1 from .eform-field-label so the red asterisk sits right after the label instead of floating to the far right of the row. Bump asterisk font-size to 12px to match the label for a cleaner visual. Also adds 'Assign to...' translation key across all languages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e82218e commit ef384be

260 files changed

Lines changed: 96621 additions & 441 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eFormAPI/eFormAPI.sln

Lines changed: 144 additions & 144 deletions
Large diffs are not rendered by default.
Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,306 @@
1+
import {PageWithNavbarPage} from '../../PageWithNavbar.page';
2+
import backendConfigurationPropertyWorkersPage from './BackendConfigurationPropertyWorkers.page';
3+
import {selectValueInNgSelector} from '../../helper-functions';
4+
5+
class BackendConfigurationAreaRulesPage extends PageWithNavbarPage {
6+
constructor() {
7+
super();
8+
}
9+
10+
public rowNum() {
11+
return cy.get('#mainTable .mat-row').its('length');
12+
}
13+
14+
public ruleCreateBtn() {
15+
return cy.get('#ruleCreateBtn').should('be.visible').should('be.enabled');
16+
}
17+
18+
public createAreaRulesString() {
19+
return cy.get('#createAreaRulesString').should('be.visible');
20+
}
21+
22+
public areaRulesGenerateBtn() {
23+
return cy.get('#areaRulesGenerateBtn').should('be.visible').should('be.enabled');
24+
}
25+
26+
public areaRuleCreateSaveCancelBtn() {
27+
return cy.get('#areaRuleCreateSaveCancelBtn').should('be.visible').should('be.enabled');
28+
}
29+
30+
public areaRuleCreateSaveBtn() {
31+
return cy.get('#areaRuleCreateSaveBtn').should('be.visible').should('be.enabled');
32+
}
33+
34+
public createRuleType(i: number) {
35+
return cy.get(`#createRuleType${i}`).should('be.visible');
36+
}
37+
38+
public createRuleAlarm(i: number) {
39+
return cy.get(`#createRuleAlarm${i}`).should('be.visible');
40+
}
41+
42+
public createAreaDayOfWeek(i: number) {
43+
return cy.get(`#createAreaDayOfWeek${i}`).should('be.visible');
44+
}
45+
46+
public newAreaRulesDayOfWeek() {
47+
return cy.get(`#newAreaRulesDayOfWeek`).should('be.visible');
48+
}
49+
50+
public createAreasDayOfWeek() {
51+
return cy.get(`#createAreasDayOfWeek`).should('be.visible');
52+
}
53+
54+
public createRuleEformId(i: number) {
55+
return cy.get(`#createRuleEformId${i}`).should('be.visible');
56+
}
57+
58+
public areaRuleDeleteDeleteBtn() {
59+
return cy.get('#areaRuleDeleteDeleteBtn').should('be.visible').should('be.enabled');
60+
}
61+
62+
public areaRuleDeleteCancelBtn() {
63+
return cy.get('#areaRuleDeleteCancelBtn').should('be.visible').should('be.enabled');
64+
}
65+
66+
public areaRuleEditSaveBtn() {
67+
return cy.get('#areaRuleEditSaveBtn').should('be.visible');
68+
}
69+
70+
public areaRuleEditSaveCancelBtn() {
71+
return cy.get('#areaRuleEditSaveCancelBtn').should('be.visible').should('be.enabled');
72+
}
73+
74+
public editRuleName(i: number) {
75+
return cy.get(`#editRuleName${i}`).should('be.visible');
76+
}
77+
78+
public editRuleEformId() {
79+
return cy.get('#editRuleEformId');
80+
}
81+
82+
public editRuleType() {
83+
return cy.get('#editRuleType');
84+
}
85+
86+
public editRuleAlarm() {
87+
return cy.get('#editRuleAlarm');
88+
}
89+
90+
public editAreaRuleDayOfWeek() {
91+
return cy.get('#editAreaRuleDayOfWeek');
92+
}
93+
94+
public updateAreaRulePlanningSaveBtn() {
95+
return cy.get('#updateAreaRulePlanningSaveBtn').should('be.visible').click();
96+
}
97+
98+
public updateAreaRulePlanningSaveCancelBtn() {
99+
return cy.get('#updateAreaRulePlanningSaveCancelBtn').should('be.visible').click();
100+
}
101+
102+
public planAreaRuleStatusToggle() {
103+
return cy.get('#planAreaRuleStatusToggle-input');
104+
}
105+
106+
public planAreaRuleNotificationsToggle() {
107+
return cy.get('#planAreaRuleNotificationsToggle-input');
108+
}
109+
110+
public planAreaRuleComplianceEnableToggle() {
111+
return cy.get('#planAreaRuleComplianceEnableToggle-input');
112+
}
113+
114+
public planRepeatEvery() {
115+
return cy.get('#planRepeatEvery');
116+
}
117+
118+
public planRepeatType() {
119+
return cy.get('#planRepeatType');
120+
}
121+
122+
public planStartFrom() {
123+
return cy.get('#planStartFrom');
124+
}
125+
126+
public checkboxCreateAssignment(i: number) {
127+
return cy.get(`#checkboxCreateAssignment${i}-input`);
128+
}
129+
130+
public updateEntityList() {
131+
return cy.get('.updateEntityList').should('be.visible').click();
132+
}
133+
134+
public entityListSaveBtn() {
135+
return cy.get('#entityListSaveBtn').should('be.visible').click();
136+
}
137+
138+
public entityListSaveCancelBtn() {
139+
return cy.get('#entityListSaveCancelBtn').should('be.visible').should('be.enabled').click();
140+
}
141+
142+
public addSingleEntitySelectableItem() {
143+
return cy.get('#addSingleEntitySelectableItem').should('be.visible').click();
144+
}
145+
146+
public entityItemEditNameBox() {
147+
return cy.get('#entityItemEditNameBox').should('be.visible');
148+
}
149+
150+
public entityItemSaveBtn() {
151+
return cy.get('#entityItemSaveBtn').should('be.visible').click();
152+
}
153+
154+
public entityItemCancelBtn() {
155+
return cy.get('#entityItemCancelBtn').should('be.visible').should('be.enabled').click();
156+
}
157+
158+
public createEntityItemName(i: number) {
159+
return cy.get(`#createEntityItemName`).eq(i).should('be.visible').type('Entity Name');
160+
}
161+
162+
public entityItemEditBtn(i) {
163+
return cy.get('#entityItemEditBtn')
164+
.eq(i)
165+
.should('be.visible')
166+
.should('be.enabled');
167+
}
168+
169+
public entityItemDeleteBtn(i) {
170+
return cy.get('#entityItemDeleteBtn')
171+
.eq(i)
172+
.should('be.visible')
173+
.should('be.enabled');
174+
}
175+
176+
public getCountEntityListItems() {
177+
cy.wait(500);
178+
return cy.get('#createEntityItemName').its('length');
179+
}
180+
181+
public getFirstAreaRuleRowObject() {
182+
return new AreaRuleRowObject().getRow(1);
183+
}
184+
185+
/* public getLastAreaRuleRowObject() {
186+
return new AreaRuleRowObject().getRow(this.rowNum());
187+
}*/
188+
189+
public getAreaRuleRowObjectByIndex(index) {
190+
return new AreaRuleRowObject().getRow(index);
191+
}
192+
193+
public getFirstRowObject(): AreaRuleRowObject {
194+
return this.getAreaRuleRowObjectByIndex(1);
195+
}
196+
197+
clearTable() {
198+
cy.log('**CLEAR AREA RULES TABLE**')
199+
this.rowNum().then(rowNum => {
200+
for (let i = rowNum; i > 0; i--) {
201+
this.getFirstRowObject().delete();
202+
cy.wait(500)
203+
}
204+
});
205+
}
206+
207+
public createAreaRule(areaRule, clickCancel = false) {
208+
this.openCreateAreaRuleModal(areaRule);
209+
this.closeCreateAreaRuleModal(clickCancel);
210+
}
211+
212+
public openCreateAreaRuleModal(areaRule?: AreaRuleCreateUpdate) {
213+
this.ruleCreateBtn().click();
214+
this.areaRuleCreateSaveCancelBtn().should('be.visible').should('be.enabled');
215+
if (areaRule) {
216+
if (areaRule.name) {
217+
if (areaRule.dayOfWeek) {
218+
selectValueInNgSelector('[id^=createAreasDayOfWeek]', areaRule.dayOfWeek);
219+
}
220+
this.createAreaRulesString().type(areaRule.name);
221+
this.areaRulesGenerateBtn().click();
222+
if (areaRule.type) {
223+
selectValueInNgSelector('[id^=createRuleType]', areaRule.type);
224+
}
225+
if (areaRule.alarm) {
226+
selectValueInNgSelector('[id^=createRuleAlarm]', areaRule.alarm);
227+
}
228+
if (areaRule.eform) {
229+
selectValueInNgSelector('[id^=createRuleEformId]', areaRule.eform, true);
230+
}
231+
}
232+
}
233+
}
234+
235+
public closeCreateAreaRuleModal(clickCancel = false) {
236+
if (clickCancel) {
237+
this.areaRuleCreateSaveCancelBtn().click();
238+
} else {
239+
this.areaRuleCreateSaveBtn().click();
240+
}
241+
this.ruleCreateBtn().should('be.visible').should('be.enabled');
242+
}
243+
}
244+
245+
const backendConfigurationAreaRulesPage = new BackendConfigurationAreaRulesPage();
246+
export default backendConfigurationAreaRulesPage;
247+
248+
export class AreaRuleRowObject {
249+
row: Cypress.Chainable<JQuery<HTMLElement>>;
250+
showAreaRulePlanningBtn: Cypress.Chainable<JQuery<HTMLElement>>;
251+
editRuleBtn: Cypress.Chainable<JQuery<HTMLElement>>;
252+
deleteRuleBtn: Cypress.Chainable<JQuery<HTMLElement>>;
253+
254+
getRow(rowNum: number) {
255+
const row = () => cy.get('.mat-row').eq(rowNum - 1);
256+
this.row = row();
257+
this.showAreaRulePlanningBtn = row().find('[id^=showAreaRulePlanningBtn]').should('be.visible').should('be.enabled');
258+
this.editRuleBtn = row().find('[id^=showEditRuleBtn]').should('be.visible').should('be.enabled');
259+
this.deleteRuleBtn = row().find('[id^=deleteRuleBtn]').should('be.visible').should('be.enabled');
260+
return this;
261+
}
262+
263+
// find first row with text
264+
getRowByName(s: string) {
265+
const row = () => cy.get('.mat-row')
266+
.contains(s) // div
267+
.parent() // met-cell
268+
.parent(); // mat-row
269+
this.row = row();
270+
this.showAreaRulePlanningBtn = row().find('[id^=showAreaRulePlanningBtn]').should('be.visible').should('be.enabled');
271+
this.editRuleBtn = row().find('[id^=editDeviceUserBtn]').should('be.visible').should('be.enabled');
272+
this.deleteRuleBtn = row().find('[id^=deleteDeviceUserBtn]').should('be.visible').should('be.enabled');
273+
return this;
274+
}
275+
276+
delete(clickCancel = false, waitCreateBtn = true) {
277+
this.openDeleteModal();
278+
this.closeDeleteModal(clickCancel, waitCreateBtn);
279+
}
280+
281+
openDeleteModal() {
282+
this.deleteRuleBtn.click();
283+
backendConfigurationAreaRulesPage.areaRuleDeleteCancelBtn().should('be.visible');
284+
}
285+
286+
closeDeleteModal(clickCancel = false, waitCreateBtn = true) {
287+
if (clickCancel) {
288+
backendConfigurationAreaRulesPage.areaRuleDeleteCancelBtn().click();
289+
} else {
290+
backendConfigurationAreaRulesPage.areaRuleDeleteDeleteBtn().click();
291+
}
292+
if (waitCreateBtn) {
293+
backendConfigurationAreaRulesPage.ruleCreateBtn().should('be.visible');
294+
} else {
295+
cy.wait(500);
296+
}
297+
}
298+
}
299+
300+
export class AreaRuleCreateUpdate {
301+
name?: string;
302+
eform?: string;
303+
type?: string;
304+
alarm?: string;
305+
dayOfWeek?: string;
306+
}

0 commit comments

Comments
 (0)