Skip to content

Commit 65bbc57

Browse files
authored
Merge pull request #985 from ruxailab/organization-feature
[Refactor PR] Main code refactor to improve management and code quality
2 parents 53d8adf + c558a4d commit 65bbc57

File tree

496 files changed

+39262
-37213
lines changed

Some content is hidden

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

496 files changed

+39262
-37213
lines changed

.env.example

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
VUE_APP_FIREBASE_API_KEY=""
2-
VUE_APP_FIREBASE_AUTH_DOMAIN=""
3-
VUE_APP_FIREBASE_STORAGE_BUCKET=""
4-
VUE_APP_FIREBASE_DB_URL=""
5-
VUE_APP_FIREBASE_PROJECT_ID=""
6-
VUE_APP_FIREBASE_MESSAGING_SENDER_ID=""
7-
VUE_APP_FIREBASE_APP_ID=""
8-
VUE_APP_I18N_LOCALE=""
9-
VUE_APP_I18N_FALLBACK_LOCALE=""
10-
VUE_APP_FIREBASE_PYTHON_FUNCTION=""
11-
LARAVEL_PDF=""
12-
ACCESSIBILITY_API=""
1+
2+
3+
SMTP_HOST=
4+
SMTP_PORT=
5+
SMTP_USER=
6+
SMTP_PASS=
7+
SMTP_SECURE=
8+
SITE_URL=

.firebaserc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"default": "retlab-dev",
44
"dev": "retlab-dev",
55
"production": "retlab",
6-
"prod": "ruxailab-prod"
6+
"prod": "ruxailab-prod",
7+
"develop": "ruxailab-develop"
78
},
89
"targets": {
910
"retlab-dev": {
@@ -14,5 +15,6 @@
1415
}
1516
}
1617
},
17-
"etags": {}
18+
"etags": {},
19+
"dataconnectEmulatorConfig": {}
1820
}

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ firebase.json
88
firestore.indexes.json
99
firestore.rules
1010
firestore-debug.log
11-
/docs
11+
/docs
1212

1313
# local env files
1414
.env.local
@@ -22,7 +22,7 @@ npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
2424
firebase-debug.log
25-
database-debug.log
25+
database-debug.log
2626
ui-debug.log
2727

2828
# Editor directories and files
@@ -39,4 +39,4 @@ ui-debug.log
3939

4040
# Ignore the playwright test screenshots and video
4141
/playwright/output
42-
debug-screenshot.png
42+
debug-screenshot.png

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"editor.defaultFormatter": "esbenp.prettier-vscode",
33
"editor.formatOnSave": true,
44
"[vue]": {
5-
"editor.defaultFormatter": "Vue.volar"
5+
"editor.defaultFormatter": "vscode.typescript-language-features"
66
},
77
"[javascript]": {
88
"editor.defaultFormatter": "vscode.typescript-language-features"
@@ -11,4 +11,3 @@
1111
"editor.defaultFormatter": "vscode.json-language-features"
1212
}
1313
}
14-

cypress/e2e/heuristic.spec.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('Heuristic test Suite', () => {
1515
})
1616
describe('Create Heuristic Test', () => {
1717
it('should allow a new test to create', () => {
18-
cy.visit(url + '/testslist')
18+
cy.visit(url + '/admin')
1919
cy.findByTestId('create-test-btn').click()
2020
cy.findByText('Create a blank test').click()
2121
cy.findByText('Usability Heuristic').click()

e2e/ruxailabtest.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ test.describe('Link Page Tests', () => {
164164
// '.console-button.mx-1.hidden-sm-and-down.v-btn.v-btn--text.theme--dark.v-size--default',
165165
// )
166166

167-
// await page.goto('/testslist')
167+
// await page.goto('/admin')
168168

169169
// await page.click('text=Test heuristic playwright for delate')
170170
// await page.click(
@@ -202,7 +202,7 @@ test.describe('Link Page Tests', () => {
202202
// '.console-button.mx-1.hidden-sm-and-down.v-btn.v-btn--text.theme--dark.v-size--default',
203203
// { timeout: 5000 },
204204
// )
205-
// await expect(page).toHaveURL('https://ruxailab-prod.web.app/testslist')
205+
// await expect(page).toHaveURL('https://ruxailab-prod.web.app/admin')
206206
// } catch {
207207
// console.error('Failed to click button or URL did not match:')
208208
// page.close()

e2e/signIntest.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ test.describe('Sign In Workflow', () => {
7171
await logIn(page, validEmail, validPassword);
7272

7373
// 2. Wait for URL change
74-
await expect(page).toHaveURL(/\/testslist/, { timeout: 10_000 });
74+
await expect(page).toHaveURL(/\/admin/, { timeout: 10_000 });
7575

7676
// 3. Verify that "My tests" tab is visible and selected
7777
const myTestsTab = page.getByRole('tab', { name: /My tests/i });
@@ -104,9 +104,9 @@ test.describe('Sign In Workflow', () => {
104104

105105
// Option 2: Wait for successful network response
106106
page.waitForResponse(resp =>
107-
resp.url().includes('identitytoolkit.googleapis.com/v1/accounts:sendOobCode') && resp.status() === 200,
108-
{ timeout: 10_000 }
109-
).then(() => 'network_response')
107+
resp.url().includes('identitytoolkit.googleapis.com/v1/accounts:sendOobCode') && resp.status() === 200,
108+
{ timeout: 10_000 }
109+
).then(() => 'network_response')
110110
]);
111111

112112
// 6) Assertion: reset request was processed
@@ -135,8 +135,8 @@ test.describe('Sign In Workflow', () => {
135135
// Check if there's any password strength feedback or error
136136
// This could be a validation message or error alert
137137
const hasError = await page.locator('text=Password must be stronger').isVisible().catch(() => false) ||
138-
await page.locator('text=Password too weak').isVisible().catch(() => false) ||
139-
await page.locator('[role="alert"]').isVisible().catch(() => false);
138+
await page.locator('text=Password too weak').isVisible().catch(() => false) ||
139+
await page.locator('[role="alert"]').isVisible().catch(() => false);
140140

141141
if (hasError) {
142142
console.log(`Weak password "${weakPassword}" correctly rejected`);

firebase.json

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,86 @@
44
"indexes": "firestore.indexes.json"
55
},
66
"functions": {
7-
"predeploy": ["npm --prefix \"$RESOURCE_DIR\" run lint"],
7+
"predeploy": [
8+
"npm --prefix \"$RESOURCE_DIR\" run lint"
9+
],
810
"source": "functions",
911
"runtimes": "python312"
1012
},
1113
"hosting": [
1214
{
1315
"site": "ruxailab-stage",
1416
"public": "dist",
15-
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
16-
"rewrites": [{ "source": "**", "destination": "/index.html" }]
17+
"ignore": [
18+
"firebase.json",
19+
"**/.*",
20+
"**/node_modules/**"
21+
],
22+
"rewrites": [
23+
{
24+
"source": "**",
25+
"destination": "/index.html"
26+
}
27+
]
1728
},
1829
{
1930
"site": "ruxailab-dev",
2031
"public": "dist",
21-
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
22-
"rewrites": [{ "source": "**", "destination": "/index.html" }]
32+
"ignore": [
33+
"firebase.json",
34+
"**/.*",
35+
"**/node_modules/**"
36+
],
37+
"rewrites": [
38+
{
39+
"source": "**",
40+
"destination": "/index.html"
41+
}
42+
]
43+
},
44+
{
45+
"site": "ruxailab-develop",
46+
"public": "dist",
47+
"ignore": [
48+
"firebase.json",
49+
"**/.*",
50+
"**/node_modules/**"
51+
],
52+
"rewrites": [
53+
{
54+
"source": "**",
55+
"destination": "/index.html"
56+
}
57+
]
2358
},
2459
{
2560
"site": "ruxailab-prod",
2661
"public": "dist",
27-
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
28-
"rewrites": [{ "source": "**", "destination": "/index.html" }]
62+
"ignore": [
63+
"firebase.json",
64+
"**/.*",
65+
"**/node_modules/**"
66+
],
67+
"rewrites": [
68+
{
69+
"source": "**",
70+
"destination": "/index.html"
71+
}
72+
]
2973
}
3074
],
3175
"emulators": {
3276
"auth": {
3377
"port": 9099
3478
},
3579
"functions": {
36-
"port": 5001
80+
"port": 5002
3781
},
3882
"firestore": {
3983
"port": 8081
4084
},
4185
"hosting": {
42-
"port": 5000
86+
"port": 5001
4387
},
4488
"ui": {
4589
"enabled": true
@@ -52,4 +96,4 @@
5296
"storage": {
5397
"rules": "storage.rules"
5498
}
55-
}
99+
}

functions/index.js

Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -4,80 +4,4 @@ admin.initializeApp()
44

55
export * from './src/https/index.js'
66
export * from './src/triggers/index.js'
7-
8-
9-
// const functions = require('firebase-functions')
10-
// const admin = require('firebase-admin')
11-
// const nodemailer = require('nodemailer')
12-
// require('dotenv').config()
13-
14-
// admin.initializeApp()
15-
16-
// exports.deleteAuth = functions.https.onCall(async (data, context) => {
17-
// try {
18-
// await admin.auth().deleteUser(data.id)
19-
// return 'User deleted successfully.'
20-
// } catch (err) {
21-
// console.error('Error deleting user:', err)
22-
// return err
23-
// }
24-
// })
25-
26-
// exports.sendEmail = functions.https.onCall(async (data, context) => {
27-
// const transporter = nodemailer.createTransport({
28-
// service: 'gmail',
29-
// auth: {
30-
// user: process.env.VUE_APP_FIREBASE_EMAIL,
31-
// pass: process.env.VUE_APP_FIREBASE_PASSWORD,
32-
// },
33-
// })
34-
35-
// const mail = {
36-
// from: 'Uramaki Lab',
37-
// to: data.guest.email,
38-
// subject: 'You have been invited to evaluate a test!',
39-
// html: data.template,
40-
// attachments: data.attachments ?? [],
41-
// }
42-
43-
// try {
44-
// const info = await transporter.sendMail(mail)
45-
// return `Message sent: ${info.messageId}`
46-
// } catch (error) {
47-
// console.error('Error sending email:', error)
48-
// return `Error sending email: ${error.message}`
49-
// }
50-
// })
51-
52-
// //code is in safe------------------------------------------------
53-
// // exports.processSignUp = functions.auth.user().onCreate(async (user) => {
54-
// // try {
55-
// // await admin
56-
// // .firestore()
57-
// // .collection("users")
58-
// // .doc(user.uid)
59-
// // .set({
60-
// // email: user.email,
61-
// // accessLevel: 1,
62-
// // myTests: {},
63-
// // myAnswers: {},
64-
// // notifications: [],
65-
// // });
66-
// // } catch (err) {
67-
// // console.error("Error to create user in database ", err);
68-
// // }
69-
// // });
70-
71-
// // exports.setUserRole = functions.https.onCall(async (data) => {
72-
// // try {
73-
// // return await admin
74-
// // .firestore()
75-
// // .collection("users")
76-
// // .doc(data.uid)
77-
// // .update({
78-
// // accessLevel: data.customClaims.accessLevel,
79-
// // });
80-
// // } catch (err) {
81-
// // return err;
82-
// // }
83-
// // });
7+
export * from './src/helpers/index.js'

0 commit comments

Comments
 (0)