Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #526

Merged
merged 78 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
51a9cf0
resolved 504
erenfn Jan 20, 2025
54b016e
Refactor banner and tooltip positioning; update modal header styles
swoopertr Jan 20, 2025
92ec70e
chore: remove userId from statistics service
DeboraSerra Jan 21, 2025
db606f9
Merge pull request #506 from bluewave-labs/502-the-stats-are-not-working
swoopertr Jan 21, 2025
5c74662
Update main.js
erenfn Jan 21, 2025
6fa4282
Update main.js
erenfn Jan 21, 2025
e92e0d2
Delete release_notes.md
erenfn Jan 21, 2025
c47253a
feat: change ENUM on tour
DeboraSerra Jan 21, 2025
d11988c
feat: change ENUM on hint
DeboraSerra Jan 21, 2025
ee829e1
feat: change ENUM on guideLog
DeboraSerra Jan 21, 2025
56d1393
feat: change ENUM on popup
DeboraSerra Jan 21, 2025
5fc2bf6
chore: undo guidelog changes
DeboraSerra Jan 21, 2025
5cd8fe8
chore: replace hard coded validations with settings values
DeboraSerra Jan 21, 2025
bd21a06
feat: change ENUM on banner
DeboraSerra Jan 21, 2025
3296c10
feat: change ENUM on token
DeboraSerra Jan 21, 2025
74565db
fix: fix banner migration
DeboraSerra Jan 21, 2025
c700a8f
fix: fix hint migration
DeboraSerra Jan 21, 2025
10edb12
fix: fix popup migration
DeboraSerra Jan 21, 2025
e32cf2b
fix: fix token migration
DeboraSerra Jan 21, 2025
617d82f
fix: remove validations from enum fields in tour
DeboraSerra Jan 21, 2025
9b48e61
chore: update banner helper logic
DeboraSerra Jan 21, 2025
d4340c0
chore: add white space to settings code
DeboraSerra Jan 21, 2025
fa760a5
Merge pull request #510 from bluewave-labs/500-code-script-overflows-…
erenfn Jan 21, 2025
8ae1cfa
Update 0000-1.0-users.js
erenfn Jan 21, 2025
d8bb58a
Update User.js
erenfn Jan 21, 2025
00e0a3f
Merge branch 'develop' into 504-fixes-before-1.0
erenfn Jan 21, 2025
00152b3
Merge pull request #505 from bluewave-labs/504-fixes-before-1.0
erenfn Jan 21, 2025
4d3e09b
Update environment configuration for production; adjust database sett…
swoopertr Jan 21, 2025
0b14ef2
fix: rollback banner migration and add new one
DeboraSerra Jan 21, 2025
5abb157
fix: update banner migrations
DeboraSerra Jan 21, 2025
5c9c030
chore: update migrtions
DeboraSerra Jan 21, 2025
244d26e
Merge branch 'develop' of github.com:bluewave-labs/bluewave-onboardin…
DeboraSerra Jan 21, 2025
c01e3c3
chore: update migrations token
DeboraSerra Jan 21, 2025
647c301
chore: update migrations popup
DeboraSerra Jan 21, 2025
503a0b9
chore: update migrations hints
DeboraSerra Jan 21, 2025
1da7a4a
chore: remove update column migrations
DeboraSerra Jan 22, 2025
f6099cf
chore: add coderabbit suggestion
DeboraSerra Jan 22, 2025
88c84e7
chore: skip email service test
DeboraSerra Jan 22, 2025
b351142
Bump vite from 5.4.11 to 5.4.14 in /frontend in the npm_and_yarn group
dependabot[bot] Jan 22, 2025
56e6327
Bug Fix: Enabled the create dialog to open properly
MandeepPaul Jan 22, 2025
93c847b
Refactor banner and popup styles to use !important for better CSS spe…
swoopertr Jan 22, 2025
6e7833b
Update .env
erenfn Jan 22, 2025
8b906f3
Enhance async handling in banner and hint interactions; add data attr…
swoopertr Jan 22, 2025
608f02f
Refactor link handling in jsAgent; streamline event listeners and sep…
swoopertr Jan 22, 2025
5358955
Merge pull request #512 from bluewave-labs/428-change-the-target-link…
erenfn Jan 22, 2025
5d9cce0
Merge pull request #509 from bluewave-labs/507-change-sequelizestring…
erenfn Jan 22, 2025
bdb412e
Update asset references in index.html and switch to @use for SCSS var…
swoopertr Jan 22, 2025
c5c9e3e
Added 'Repetition' dropdown for CreateHintPage
MandeepPaul Jan 21, 2025
0c48aeb
Added server-side validation; updated hint model and migration
MandeepPaul Jan 21, 2025
b51fb45
Updated tests
MandeepPaul Jan 22, 2025
7597fc1
Fixed typos and updated tests
MandeepPaul Jan 23, 2025
641870b
Fixed test errors
MandeepPaul Jan 23, 2025
7c03a9b
Update CreateHintPage.jsx
MandeepPaul Jan 23, 2025
b5d7a69
Added switch to the UI
MandeepPaul Jan 23, 2025
3c95420
Updated migration and modal to support isHintIconVisible boolean field
MandeepPaul Jan 23, 2025
671dca4
Updated test
MandeepPaul Jan 23, 2025
ab3bb40
Merge pull request #516 from bluewave-labs/501-add-repetition-to-hints
erenfn Jan 23, 2025
fbe3bd6
Merge pull request #518 from bluewave-labs/517-add-a-switch-to-create…
erenfn Jan 23, 2025
1b9f9b2
Refactor Dockerfile for multi-stage build; streamline npm installatio…
swoopertr Jan 23, 2025
f4b4bd3
Merge branch 'develop' into agent-1.0.2
swoopertr Jan 24, 2025
cee6f91
Add initial tour.js structure and retain Dockerfile CMD
swoopertr Jan 24, 2025
d776f93
chore: change column to enum on hint
DeboraSerra Jan 24, 2025
f0a6d29
fix: fix migration enum value
DeboraSerra Jan 24, 2025
84f05d0
fix: remove second repetition key
DeboraSerra Jan 24, 2025
f0e8581
Merge pull request #519 from bluewave-labs/507-change-sequelizestring…
erenfn Jan 24, 2025
d071a22
Update guide.controller.js
erenfn Jan 24, 2025
456b5f7
Update Popup.js
erenfn Jan 24, 2025
86a5282
fix: add index creation on guidelog into try/catch block
DeboraSerra Jan 26, 2025
d21c795
fix: change formik props to update correct values
DeboraSerra Jan 26, 2025
45d65d6
chore: undo hint migration change
DeboraSerra Jan 26, 2025
74ed81c
Merge pull request #522 from bluewave-labs/521-hint-values-arent-bein…
erenfn Jan 27, 2025
9f4be58
Merge pull request #511 from bluewave-labs/dependabot/npm_and_yarn/fr…
erenfn Jan 27, 2025
8d7b6b1
Refactor hint.js to improve bindSelector function and enhance tooltip…
swoopertr Jan 27, 2025
46e22d5
Refactor Popup model table name and update Hint model to use ENUM for…
swoopertr Jan 27, 2025
50bd74d
Remove unnecessary debugger statement from hint.js
swoopertr Jan 27, 2025
75d65b9
Update URL in data payload to use location.href instead of location.o…
swoopertr Jan 27, 2025
6c56b43
Refactor guide.controller.js to remove unused helper link retrieval a…
swoopertr Jan 27, 2025
91fac05
Merge pull request #524 from bluewave-labs/agent-1.0.2
erenfn Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 37 additions & 7 deletions backend/config/settings.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const constants = require("../src/utils/constants.helper");
const constants = require('../src/utils/constants.helper');
const userRole = constants.ROLE;

module.exports = {
user: {
role: {
'admin': userRole.ADMIN,
'member': userRole.MEMBER
admin: userRole.ADMIN,
member: userRole.MEMBER,
},
roleEnum: [userRole.ADMIN, userRole.MEMBER],
roleName: {
[userRole.ADMIN]: 'admin',
[userRole.MEMBER]: 'member'
}
[userRole.MEMBER]: 'member',
},
},
team: {
permissions: {
Expand All @@ -27,6 +27,36 @@ module.exports = {
links: [userRole.ADMIN],
tours: [userRole.ADMIN],
helpers: [userRole.ADMIN],
}
}
},
},
tour: {
triggeringFrequency: [
'just once',
'once in every session',
'once every day',
'once every week',
'once every month',
'always',
],
pageTargeting: ['equals to', 'is different from'],
themes: ['default theme'],
},
hint: {
swoopertr marked this conversation as resolved.
Show resolved Hide resolved
action: ['no action', 'open url', 'open url in a new tab'],
repetition: ['show only once', 'show every visit'],
tooltipPlacement: ['top', 'right', 'bottom', 'left'],
},
popup: {
action: ['no action', 'open url', 'open url in a new tab'],
repetition: ['show only once', 'show every visit'],
size: ['small', 'medium', 'large'],
},
banner: {
repetition: ['show only once', 'show every visit'],
position: ['top', 'bottom'],
action: ['no action', 'open url', 'open url in a new tab'],
},
token: {
type: ['auth', 'reset'],
},
};
8 changes: 4 additions & 4 deletions backend/migrations/0000-1.0-users.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ module.exports = {
autoIncrement: true,
},
name: {
type: Sequelize.STRING(50),
type: Sequelize.STRING(63),
allowNull: false,
},
surname: {
type: Sequelize.STRING(50),
type: Sequelize.STRING(63),
allowNull: true,
},
email: {
type: Sequelize.STRING(100),
type: Sequelize.STRING(255),
allowNull: false,
unique: true,
},
password: {
type: Sequelize.STRING(100),
type: Sequelize.STRING(127),
allowNull: false,
},
role: {
Expand Down
6 changes: 3 additions & 3 deletions backend/migrations/0001-1.0-helperlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ module.exports = {
allowNull: false,
},
headerBackgroundColor: {
type: Sequelize.STRING(7),
type: Sequelize.STRING(15),
allowNull: false,
defaultValue : '#F8F9F8'
},
linkFontColor: {
type: Sequelize.STRING(7),
type: Sequelize.STRING(15),
allowNull: false,
defaultValue : '#344054'
},
iconColor: {
type: Sequelize.STRING(7),
type: Sequelize.STRING(15),
allowNull: false,
defaultValue: '#7F56D9'
},
Expand Down
92 changes: 60 additions & 32 deletions backend/migrations/0004-1.0-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,68 @@ module.exports = {
up: async (queryInterface, Sequelize) => {
const transaction = await queryInterface.sequelize.transaction();
try {
await queryInterface.createTable(TABLE_NAME, {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
token: {
type: Sequelize.STRING(500),
allowNull: false,
},
userId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'users',
key: 'id'
}
},
type: {
type: Sequelize.STRING(10),
allowNull: false,
},
expiresAt: {
type: Sequelize.DATE,
allowNull: true,
await queryInterface.createTable(
TABLE_NAME,
{
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
token: {
type: Sequelize.STRING(500),
allowNull: false,
},
userId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'users',
key: 'id',
},
},
type: {
type: Sequelize.STRING(10),
allowNull: false,
},
expiresAt: {
type: Sequelize.DATE,
allowNull: true,
},
createdAt: {
type: Sequelize.DATE,
allowNull: false,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
},
},
createdAt: {
type: Sequelize.DATE,
{ transaction }
);

const [allTokens] = await queryInterface.sequelize.query(`SELECT * FROM ${TABLE_NAME}`, { transaction });
await queryInterface.removeColumn(TABLE_NAME, 'type', { transaction });

await queryInterface.addColumn(
TABLE_NAME,
'type',
{
type: Sequelize.ENUM('auth', 'reset'),
allowNull: false,
defaultValue: Sequelize.literal("CURRENT_TIMESTAMP"),
defaultValue: 'auth',
},

}, { transaction });
{ transaction }
);

if (allTokens.length > 0) {
await Promise.all(
allTokens.map(async (val) => {
await queryInterface.sequelize.query('UPDATE :table SET type = :type WHERE id = :id', {
replacements: { table: TABLE_NAME, type: val.type, id: val.id },
transaction,
});
})
);
}
swoopertr marked this conversation as resolved.
Show resolved Hide resolved

// Commit the transaction
await transaction.commit();
Expand All @@ -63,5 +91,5 @@ module.exports = {
await transaction.rollback();
throw error;
}
}
},
};
158 changes: 112 additions & 46 deletions backend/migrations/0005-1.0-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,122 @@ module.exports = {
up: async (queryInterface, Sequelize) => {
const transaction = await queryInterface.sequelize.transaction();
try {
await queryInterface.createTable(TABLE_NAME, {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
closeButtonAction: {
type: Sequelize.STRING(255),
allowNull: false
},
repetitionType: {
type: Sequelize.STRING(255),
allowNull: false,
defaultValue: 'show only once'
},
position: {
type: Sequelize.STRING(255),
allowNull: false
},
url: {
type: Sequelize.STRING(255),
allowNull: true
await queryInterface.createTable(
TABLE_NAME,
{
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},

closeButtonAction: {
type: Sequelize.STRING(31),
allowNull: false,
},
repetitionType: {
type: Sequelize.STRING(31),
allowNull: false,
defaultValue: 'show only once',
},
position: {
type: Sequelize.STRING(31),
allowNull: false,
},
url: {
type: Sequelize.STRING(255),
allowNull: true,
},
fontColor: {
type: Sequelize.STRING(15),
allowNull: false,
defaultValue: '#FFFFFF',
},
backgroundColor: {
type: Sequelize.STRING(15),
allowNull: false,
defaultValue: '#FFFFFF',
},
bannerText: {
type: Sequelize.STRING(511),
allowNull: false,
defaultValue: '',
},
actionUrl: {
type: Sequelize.STRING(255),
allowNull: true,
},
createdBy: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'users',
key: 'id',
},
},
},
fontColor: {
type: Sequelize.STRING(255),
{ transaction }
);

const [allBanners] = await queryInterface.sequelize.query(`SELECT * FROM ${TABLE_NAME}`, { transaction });
await queryInterface.removeColumn(TABLE_NAME, 'closeButtonAction', { transaction });

// Add the new column with ENUM type
await queryInterface.addColumn(
TABLE_NAME,
'closeButtonAction',
{
type: Sequelize.ENUM('no action', 'open url', 'open url in a new tab'),
allowNull: false,
defaultValue: "#FFFFFF"
defaultValue: 'no action',
},
backgroundColor: {
type: Sequelize.STRING(255),
{ transaction }
);

await queryInterface.removeColumn(TABLE_NAME, 'repetitionType', { transaction });

// Add the new column with ENUM type
await queryInterface.addColumn(
TABLE_NAME,
'repetitionType',
{
type: Sequelize.ENUM('show only once', 'show every visit'),
allowNull: false,
defaultValue: "#FFFFFF"
defaultValue: 'show only once',
},
bannerText: {
type: Sequelize.STRING(255),
{ transaction }
);

await queryInterface.removeColumn(TABLE_NAME, 'position', { transaction });

// Add the new column with ENUM type
await queryInterface.addColumn(
TABLE_NAME,
'position',
{
type: Sequelize.ENUM('top', 'bottom'),
allowNull: false,
defaultValue: ""
},
actionUrl: {
type: Sequelize.STRING(255),
allowNull: true
defaultValue: 'top',
},
createdBy: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'users',
key: 'id'
}
}
}, { transaction });
{ transaction }
);

if (allBanners.length > 0) {
const updates = allBanners.map(val => ({
id: val.id,
closeButtonAction: val.closeButtonAction,
repetitionType: val.repetitionType,
position: val.position
}));

await queryInterface.bulkUpdate(
TABLE_NAME,
updates,
null,
{ transaction }
);
}

// Commit the transaction
await transaction.commit();
Expand All @@ -71,13 +135,15 @@ module.exports = {
down: async (queryInterface, Sequelize) => {
const transaction = await queryInterface.sequelize.transaction();
try {
// Drop the guide_logs table
await queryInterface.dropTable(TABLE_NAME, { transaction });

// Commit the transaction
await transaction.commit();
} catch (error) {
// Rollback the transaction in case of an error
await transaction.rollback();
throw error;
}
}
},
};
Loading
Loading