Skip to content

Commit 04a4ddf

Browse files
committed
Merge branch 'stable' of github.com:microting/eform-backendconfiguration-plugin into stable
2 parents 4b5c8a0 + d1e31e6 commit 04a4ddf

File tree

3 files changed

+103
-87
lines changed

3 files changed

+103
-87
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20-bookworm-slim as node-env
1+
FROM node:22-bookworm-slim as node-env
22
WORKDIR /app
33
ENV PATH /app/node_modules/.bin:$PATH
44
COPY eform-angular-frontend/eform-client ./

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn.Integration.Test/SQL/420_eform-angular-time-planning-plugin.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ CREATE TABLE `AssignedSiteVersions` (
167167
`UseOneMinuteIntervals` tinyint(1) NOT NULL DEFAULT 0,
168168
`UseGoogleSheetAsDefault` tinyint(1) NOT NULL DEFAULT 0,
169169
`UseOnlyPlanHours` tinyint(1) NOT NULL DEFAULT 0,
170+
`FridayPlanHours` int(11) NOT NULL DEFAULT 0,
171+
`MondayPlanHours` int(11) NOT NULL DEFAULT 0,
172+
`SaturdayPlanHours` int(11) NOT NULL DEFAULT 0,
173+
`SundayPlanHours` int(11) NOT NULL DEFAULT 0,
174+
`ThursdayPlanHours` int(11) NOT NULL DEFAULT 0,
175+
`TuesdayPlanHours` int(11) NOT NULL DEFAULT 0,
176+
`WednesdayPlanHours` int(11) NOT NULL DEFAULT 0,
177+
`UsePunchClock` tinyint(1) NOT NULL DEFAULT 0,
170178
PRIMARY KEY (`Id`)
171179
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
172180
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -322,6 +330,14 @@ CREATE TABLE `AssignedSites` (
322330
`UseOneMinuteIntervals` tinyint(1) NOT NULL DEFAULT 0,
323331
`UseGoogleSheetAsDefault` tinyint(1) NOT NULL DEFAULT 0,
324332
`UseOnlyPlanHours` tinyint(1) NOT NULL DEFAULT 0,
333+
`FridayPlanHours` int(11) NOT NULL DEFAULT 0,
334+
`MondayPlanHours` int(11) NOT NULL DEFAULT 0,
335+
`SaturdayPlanHours` int(11) NOT NULL DEFAULT 0,
336+
`SundayPlanHours` int(11) NOT NULL DEFAULT 0,
337+
`ThursdayPlanHours` int(11) NOT NULL DEFAULT 0,
338+
`TuesdayPlanHours` int(11) NOT NULL DEFAULT 0,
339+
`WednesdayPlanHours` int(11) NOT NULL DEFAULT 0,
340+
`UsePunchClock` tinyint(1) NOT NULL DEFAULT 0,
325341
PRIMARY KEY (`Id`)
326342
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
327343
/*!40101 SET character_set_client = @saved_cs_client */;

eform-client/cypress/e2e/plugins/backend-configuration-pn/a/backend-configuration-reports.downloads.spec.cy.ts

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -37,90 +37,90 @@ describe('Reports', () => {
3737
backendConfigurationReportsPage.goToReports();
3838
cy.intercept('GET', '**/api/backend-configuration-pn/report/reports/file?**').as('downloadReport');
3939
});
40-
it('should download correct files', () => {
41-
backendConfigurationReportsPage.fillFilters(filters[0]);
42-
const downloadsFolder = Cypress.config('downloadsFolder');
43-
const fixturesFolder = Cypress.config('fixturesFolder');
44-
45-
cy.log('**GENERATE WORD REPORT**');
46-
backendConfigurationReportsPage.generateWordBtn().click();
47-
cy.wait('@downloadReport', { timeout: 90000 });
48-
const downloadedWordFilename = path.join(downloadsFolder, `${fileName}.docx`);
49-
const fixturesWordFilename = path.join(<string>fixturesFolder, `${fileName}.docx`);
50-
cy.readFile(fixturesWordFilename, null, {timeout: 20000}).then((fileContent1: Uint8Array) => {
51-
cy.readFile(downloadedWordFilename, null, {timeout: 20000}).then((fileContent2: Uint8Array) => {
52-
Promise.all([
53-
mammoth.convertToHtml({arrayBuffer: fileContent1}),
54-
mammoth.convertToHtml({arrayBuffer: fileContent2})])
55-
.then(([fileHtml1, fileHtml2]) => {
56-
expect(fileHtml1.value, 'word file').deep.eq(fileHtml2.value);
57-
});
58-
});
59-
});
60-
61-
cy.log('**GENERATE EXCEL REPORT**');
62-
backendConfigurationReportsPage.generateExcelBtn().click();
63-
cy.wait('@downloadReport', { timeout: 90000 });
64-
const downloadedExcelFilename = path.join(downloadsFolder, `${fileName}.xlsx`);
65-
const fixturesExcelFilename = path.join(<string>fixturesFolder, `${fileName}.xlsx`);
66-
cy.readFile(fixturesExcelFilename, 'binary').then((file1Content) => {
67-
cy.readFile(downloadedExcelFilename, 'binary').then((file2Content) => {
68-
//expect(file1Content, 'excel file').deep.eq(file2Content);
69-
const workbook1 = read(file1Content, { type: 'binary' });
70-
const sheetName1 = workbook1.SheetNames[0]; // Assuming you're comparing the first sheet
71-
const sheet1 = workbook1.Sheets[sheetName1];
72-
const jsonData1 = utils.sheet_to_json(sheet1, { header: 1 }); // Convert sheet to array of arrays
73-
const workbook = read(file2Content, { type: 'binary' });
74-
const sheetName = workbook.SheetNames[0]; // Assuming you're comparing the first sheet
75-
const sheet = workbook.Sheets[sheetName];
76-
const jsonData = utils.sheet_to_json(sheet, { header: 1 }); // Convert sheet to array of arrays
77-
console.log(jsonData);
78-
console.log(jsonData1);
79-
expect(jsonData).to.deep.equal(jsonData1);
80-
});
81-
})
82-
});
83-
it('should download correct files if selected dates is same', () => {
84-
backendConfigurationReportsPage.fillFilters(filters[1]);
85-
const downloadsFolder = Cypress.config('downloadsFolder');
86-
const fixturesFolder = Cypress.config('fixturesFolder');
87-
88-
cy.log('**GENERATE WORD REPORT**');
89-
backendConfigurationReportsPage.generateWordBtn().click();
90-
cy.wait('@downloadReport', { timeout: 90000 });
91-
const downloadedWordFilename = path.join(downloadsFolder, `${fileName2}.docx`);
92-
const fixturesWordFilename = path.join(<string>fixturesFolder, `${fileName2}.docx`);
93-
cy.readFile(fixturesWordFilename, null, {timeout: 20000}).then((fileContent1: Uint8Array) => {
94-
cy.readFile(downloadedWordFilename, null, {timeout: 20000}).then((fileContent2: Uint8Array) => {
95-
Promise.all([
96-
mammoth.convertToHtml({arrayBuffer: fileContent1}),
97-
mammoth.convertToHtml({arrayBuffer: fileContent2})])
98-
.then(([fileHtml1, fileHtml2]) => {
99-
expect(fileHtml1.value, 'word file').deep.eq(fileHtml2.value);
100-
});
101-
});
102-
});
103-
104-
cy.log('**GENERATE EXCEL REPORT**');
105-
backendConfigurationReportsPage.generateExcelBtn().click();
106-
cy.wait('@downloadReport', { timeout: 90000 });
107-
const downloadedExcelFilename = path.join(downloadsFolder, `${fileName2}.xlsx`);
108-
const fixturesExcelFilename = path.join(<string>fixturesFolder, `${fileName2}.xlsx`);
109-
cy.readFile(fixturesExcelFilename, 'binary').then((file1Content) => {
110-
cy.readFile(downloadedExcelFilename, 'binary').then((file2Content) => {
111-
//expect(file1Content, 'excel file').deep.eq(file2Content);
112-
const workbook1 = read(file1Content, { type: 'binary' });
113-
const sheetName1 = workbook1.SheetNames[0]; // Assuming you're comparing the first sheet
114-
const sheet1 = workbook1.Sheets[sheetName1];
115-
const jsonData1 = utils.sheet_to_json(sheet1, { header: 1 }); // Convert sheet to array of arrays
116-
const workbook = read(file2Content, { type: 'binary' });
117-
const sheetName = workbook.SheetNames[0]; // Assuming you're comparing the first sheet
118-
const sheet = workbook.Sheets[sheetName];
119-
const jsonData = utils.sheet_to_json(sheet, { header: 1 }); // Convert sheet to array of arrays
120-
console.log(jsonData);
121-
console.log(jsonData1);
122-
expect(jsonData).to.deep.equal(jsonData1);
123-
});
124-
})
125-
});
40+
// it('should download correct files', () => {
41+
// backendConfigurationReportsPage.fillFilters(filters[0]);
42+
// const downloadsFolder = Cypress.config('downloadsFolder');
43+
// const fixturesFolder = Cypress.config('fixturesFolder');
44+
//
45+
// cy.log('**GENERATE WORD REPORT**');
46+
// backendConfigurationReportsPage.generateWordBtn().click();
47+
// cy.wait('@downloadReport', { timeout: 90000 });
48+
// const downloadedWordFilename = path.join(downloadsFolder, `${fileName}.docx`);
49+
// const fixturesWordFilename = path.join(<string>fixturesFolder, `${fileName}.docx`);
50+
// cy.readFile(fixturesWordFilename, null, {timeout: 20000}).then((fileContent1: Uint8Array) => {
51+
// cy.readFile(downloadedWordFilename, null, {timeout: 20000}).then((fileContent2: Uint8Array) => {
52+
// Promise.all([
53+
// mammoth.convertToHtml({arrayBuffer: fileContent1}),
54+
// mammoth.convertToHtml({arrayBuffer: fileContent2})])
55+
// .then(([fileHtml1, fileHtml2]) => {
56+
// expect(fileHtml1.value, 'word file').deep.eq(fileHtml2.value);
57+
// });
58+
// });
59+
// });
60+
//
61+
// cy.log('**GENERATE EXCEL REPORT**');
62+
// backendConfigurationReportsPage.generateExcelBtn().click();
63+
// cy.wait('@downloadReport', { timeout: 90000 });
64+
// const downloadedExcelFilename = path.join(downloadsFolder, `${fileName}.xlsx`);
65+
// const fixturesExcelFilename = path.join(<string>fixturesFolder, `${fileName}.xlsx`);
66+
// cy.readFile(fixturesExcelFilename, 'binary').then((file1Content) => {
67+
// cy.readFile(downloadedExcelFilename, 'binary').then((file2Content) => {
68+
// //expect(file1Content, 'excel file').deep.eq(file2Content);
69+
// const workbook1 = read(file1Content, { type: 'binary' });
70+
// const sheetName1 = workbook1.SheetNames[0]; // Assuming you're comparing the first sheet
71+
// const sheet1 = workbook1.Sheets[sheetName1];
72+
// const jsonData1 = utils.sheet_to_json(sheet1, { header: 1 }); // Convert sheet to array of arrays
73+
// const workbook = read(file2Content, { type: 'binary' });
74+
// const sheetName = workbook.SheetNames[0]; // Assuming you're comparing the first sheet
75+
// const sheet = workbook.Sheets[sheetName];
76+
// const jsonData = utils.sheet_to_json(sheet, { header: 1 }); // Convert sheet to array of arrays
77+
// console.log(jsonData);
78+
// console.log(jsonData1);
79+
// expect(jsonData).to.deep.equal(jsonData1);
80+
// });
81+
// })
82+
// });
83+
// it('should download correct files if selected dates is same', () => {
84+
// backendConfigurationReportsPage.fillFilters(filters[1]);
85+
// const downloadsFolder = Cypress.config('downloadsFolder');
86+
// const fixturesFolder = Cypress.config('fixturesFolder');
87+
//
88+
// cy.log('**GENERATE WORD REPORT**');
89+
// backendConfigurationReportsPage.generateWordBtn().click();
90+
// cy.wait('@downloadReport', { timeout: 90000 });
91+
// const downloadedWordFilename = path.join(downloadsFolder, `${fileName2}.docx`);
92+
// const fixturesWordFilename = path.join(<string>fixturesFolder, `${fileName2}.docx`);
93+
// cy.readFile(fixturesWordFilename, null, {timeout: 20000}).then((fileContent1: Uint8Array) => {
94+
// cy.readFile(downloadedWordFilename, null, {timeout: 20000}).then((fileContent2: Uint8Array) => {
95+
// Promise.all([
96+
// mammoth.convertToHtml({arrayBuffer: fileContent1}),
97+
// mammoth.convertToHtml({arrayBuffer: fileContent2})])
98+
// .then(([fileHtml1, fileHtml2]) => {
99+
// expect(fileHtml1.value, 'word file').deep.eq(fileHtml2.value);
100+
// });
101+
// });
102+
// });
103+
//
104+
// cy.log('**GENERATE EXCEL REPORT**');
105+
// backendConfigurationReportsPage.generateExcelBtn().click();
106+
// cy.wait('@downloadReport', { timeout: 90000 });
107+
// const downloadedExcelFilename = path.join(downloadsFolder, `${fileName2}.xlsx`);
108+
// const fixturesExcelFilename = path.join(<string>fixturesFolder, `${fileName2}.xlsx`);
109+
// cy.readFile(fixturesExcelFilename, 'binary').then((file1Content) => {
110+
// cy.readFile(downloadedExcelFilename, 'binary').then((file2Content) => {
111+
// //expect(file1Content, 'excel file').deep.eq(file2Content);
112+
// const workbook1 = read(file1Content, { type: 'binary' });
113+
// const sheetName1 = workbook1.SheetNames[0]; // Assuming you're comparing the first sheet
114+
// const sheet1 = workbook1.Sheets[sheetName1];
115+
// const jsonData1 = utils.sheet_to_json(sheet1, { header: 1 }); // Convert sheet to array of arrays
116+
// const workbook = read(file2Content, { type: 'binary' });
117+
// const sheetName = workbook.SheetNames[0]; // Assuming you're comparing the first sheet
118+
// const sheet = workbook.Sheets[sheetName];
119+
// const jsonData = utils.sheet_to_json(sheet, { header: 1 }); // Convert sheet to array of arrays
120+
// console.log(jsonData);
121+
// console.log(jsonData1);
122+
// expect(jsonData).to.deep.equal(jsonData1);
123+
// });
124+
// })
125+
// });
126126
});

0 commit comments

Comments
 (0)