glib-web 4.44.3 → 4.44.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/glib-web/fieldsCaptcha.cy.ts +4 -4
- package/cypress/e2e/glib-web/panelsBulkEdit2.cy.ts +13 -2
- package/cypress/helper.ts +1 -1
- package/cypress/support/e2e.ts +9 -0
- package/cypress.config.ts +4 -0
- package/cypress.yml.example +4 -5
- package/index.js +2 -0
- package/package.json +2 -2
- package/utils/dom.js +19 -1
- package/.claude/settings.local.json +0 -34
|
@@ -2,12 +2,12 @@ import { testPageUrl } from "../../helper"
|
|
|
2
2
|
|
|
3
3
|
const url = testPageUrl('fields_captcha')
|
|
4
4
|
|
|
5
|
-
const visitWithCaptcha = (executeResult
|
|
5
|
+
const visitWithCaptcha = (executeResult) => {
|
|
6
6
|
cy.visit(url, {
|
|
7
|
-
onBeforeLoad(win
|
|
8
|
-
|
|
7
|
+
onBeforeLoad(win) {
|
|
8
|
+
win.grecaptcha = {
|
|
9
9
|
enterprise: {
|
|
10
|
-
ready: function(cb
|
|
10
|
+
ready: function(cb) { cb(); },
|
|
11
11
|
execute: function() { return executeResult(); }
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -2,7 +2,11 @@ import { testPageUrl } from "../../helper"
|
|
|
2
2
|
|
|
3
3
|
const url = testPageUrl('panels_bulkEdit2')
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const csvFixtureContents = [
|
|
6
|
+
'month,electricity_usage,gas_usage,sources,compliant',
|
|
7
|
+
'January,120,10,Generators,yes',
|
|
8
|
+
'February,150,12,Solar Panels,no'
|
|
9
|
+
].join('\n')
|
|
6
10
|
|
|
7
11
|
describe('panels_bulkEdit2', () => {
|
|
8
12
|
it('loads csv rows and toggles column variants', () => {
|
|
@@ -10,7 +14,14 @@ describe('panels_bulkEdit2', () => {
|
|
|
10
14
|
|
|
11
15
|
cy.contains('Drag your CSV file here').should('exist')
|
|
12
16
|
|
|
13
|
-
cy.get('input[type="file"]').selectFile(
|
|
17
|
+
cy.get('input[type="file"]').selectFile(
|
|
18
|
+
{
|
|
19
|
+
contents: Cypress.Buffer.from(csvFixtureContents),
|
|
20
|
+
fileName: 'bulk_edit.csv',
|
|
21
|
+
mimeType: 'text/csv'
|
|
22
|
+
},
|
|
23
|
+
{ force: true }
|
|
24
|
+
)
|
|
14
25
|
|
|
15
26
|
cy.get('tbody tr').should('have.length', 2)
|
|
16
27
|
cy.contains('Submit (top)').should('be.visible')
|
package/cypress/helper.ts
CHANGED
package/cypress/support/e2e.ts
CHANGED
|
@@ -17,5 +17,14 @@
|
|
|
17
17
|
import './commands'
|
|
18
18
|
import '@cypress/code-coverage/support'
|
|
19
19
|
|
|
20
|
+
// Ignore retry failures from backend error pages so specs can assert UI state.
|
|
21
|
+
Cypress.on('uncaught:exception', (err) => {
|
|
22
|
+
const message = `${err}`;
|
|
23
|
+
if (message.includes('Retry failed')) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
});
|
|
28
|
+
|
|
20
29
|
// Alternatively you can use CommonJS syntax:
|
|
21
30
|
// require('./commands')
|
package/cypress.config.ts
CHANGED
package/cypress.yml.example
CHANGED
|
@@ -43,14 +43,13 @@ jobs:
|
|
|
43
43
|
- run: cp config/database.yml.github-actions config/database.yml
|
|
44
44
|
- run: bundle exec rake db:test:prepare
|
|
45
45
|
- run: bundle exec rails server -d
|
|
46
|
-
- name: Cypress run
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
- name: Cypress run (e2e)
|
|
47
|
+
run: env -u ELECTRON_RUN_AS_NODE yarn cypress run --browser chrome
|
|
48
|
+
- name: Cypress run (component)
|
|
49
|
+
run: env -u ELECTRON_RUN_AS_NODE yarn cypress run --component
|
|
50
50
|
- name: Upload screenshots
|
|
51
51
|
uses: actions/upload-artifact@v4
|
|
52
52
|
if: failure()
|
|
53
53
|
with:
|
|
54
54
|
name: cypress-screenshots
|
|
55
55
|
path: cypress/screenshots
|
|
56
|
-
- run: yarn run cypress run
|
package/index.js
CHANGED
|
@@ -61,6 +61,7 @@ import CommonResponsive from "./components/responsive.vue";
|
|
|
61
61
|
import CommonTemplateMenu from "./templates/_menu.vue";
|
|
62
62
|
import BigProgressCircle from "./templates/bigProgressCircle.vue";
|
|
63
63
|
import RichButton from "./components/button.vue";
|
|
64
|
+
import Dom from "./utils/dom";
|
|
64
65
|
Vue.component("panels-vertical", VerticalPanel);
|
|
65
66
|
Vue.component("panels-responsive", ResponsivePanel);
|
|
66
67
|
Vue.component("common-avatar", CommonAvatar);
|
|
@@ -123,6 +124,7 @@ const vPhoneInput = createVPhoneInput({
|
|
|
123
124
|
|
|
124
125
|
Vue.use(vPhoneInput);
|
|
125
126
|
|
|
127
|
+
Dom.ensureCsrfElement();
|
|
126
128
|
|
|
127
129
|
document.addEventListener("DOMContentLoaded", () => {
|
|
128
130
|
Vue.mount(`#${APP_ID}`);
|
package/package.json
CHANGED
package/utils/dom.js
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
|
+
import * as TypeUtils from "./type";
|
|
2
|
+
|
|
1
3
|
export default class {
|
|
4
|
+
static ensureCsrfElement() {
|
|
5
|
+
let element = document.querySelector('meta[name="csrf-token"]');
|
|
6
|
+
if (!TypeUtils.isObject(element)) {
|
|
7
|
+
const meta = document.createElement("meta");
|
|
8
|
+
meta.setAttribute("name", "csrf-token");
|
|
9
|
+
meta.setAttribute("content", "");
|
|
10
|
+
if (TypeUtils.isObject(document.head)) {
|
|
11
|
+
document.head.appendChild(meta);
|
|
12
|
+
} else {
|
|
13
|
+
document.documentElement.appendChild(meta);
|
|
14
|
+
}
|
|
15
|
+
element = meta;
|
|
16
|
+
}
|
|
17
|
+
return element;
|
|
18
|
+
}
|
|
19
|
+
|
|
2
20
|
static get csrfElement() {
|
|
3
|
-
return
|
|
21
|
+
return this.ensureCsrfElement();
|
|
4
22
|
}
|
|
5
23
|
|
|
6
24
|
static getCsrf() {
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"Read(//home/hgani/workspace/glib-web/app/views/json_ui/garage/**)",
|
|
5
|
-
"Read(//home/hgani/workspace/glib-web-npm/doc/garage/**)",
|
|
6
|
-
"Read(//home/hgani/workspace/glib-web-npm/doc/common/**)",
|
|
7
|
-
"Bash(find:*)",
|
|
8
|
-
"Bash(npx cypress run:*)",
|
|
9
|
-
"Read(//home/hgani/workspace/glib-web/**)",
|
|
10
|
-
"Bash(curl:*)",
|
|
11
|
-
"Bash(pkill:*)",
|
|
12
|
-
"Bash(gh pr list:*)",
|
|
13
|
-
"WebSearch",
|
|
14
|
-
"WebFetch(domain:vuetifyjs.com)",
|
|
15
|
-
"Bash(lsof:*)",
|
|
16
|
-
"Bash(readlink:*)",
|
|
17
|
-
"WebFetch(domain:github.com)",
|
|
18
|
-
"Bash(npm run dev)",
|
|
19
|
-
"Bash(npm run)",
|
|
20
|
-
"Bash(npx eslint:*)",
|
|
21
|
-
"Bash(npm install:*)",
|
|
22
|
-
"Bash(yarn lint:*)",
|
|
23
|
-
"Bash(bin/rails db:migrate:*)",
|
|
24
|
-
"Bash(bin/rails server:*)",
|
|
25
|
-
"Bash(dpkg -S:*)",
|
|
26
|
-
"Bash(source:*)",
|
|
27
|
-
"Bash(node --version:*)",
|
|
28
|
-
"Bash(nvm ls:*)",
|
|
29
|
-
"Bash(nvm use:*)"
|
|
30
|
-
],
|
|
31
|
-
"deny": [],
|
|
32
|
-
"ask": []
|
|
33
|
-
}
|
|
34
|
-
}
|