Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/components/DataForms/BoxForms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const BoxForms: React.FC<BoxFormsProps> = ({ defaultValues, onClose }) => {

const validatePhaseTransition = () => {
let ideasWithApprovalStatus = 0;
for (let idea of ideas) {
for (const idea of ideas) {
if (idea.approved) ideasWithApprovalStatus += 1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/DataForms/MessageForms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const MessageForms: React.FC<MessageFormsProps> = ({ defaultValues, onClose }) =
headline: data.headline,
body: data.body,
status: data.status as StatusTypes,
msg_type: 2 as 2,
msg_type: 2 as const,
target_id,
target_group,
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/PrintUsers/PrintUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const PrintUsers = forwardRef<ButtonProps>(({ ...restOfProps }) => {
const instanceCode = localStorageGet('code');
const rows = chunkArray(filteredUsers, columns);

let usersPasswords = rows
const usersPasswords = rows
.map((row) => {
const cells = row
.map((user) => {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { RoleTypes } from '@/types/SettingsTypes';
* - user_level: User's permission level
* - temp_pw: Optional flag indicating temporary password status
*/
export function parseJwt(token: String): {
export function parseJwt(token: string): {
exp: number;
user_id: number;
user_hash: string;
Expand All @@ -21,13 +21,13 @@ export function parseJwt(token: String): {
} | null {
try {
// Extract the payload (second) part of the JWT
var base64Url = token.split('.')[1];
const base64Url = token.split('.')[1];

// Convert base64url to regular base64 by replacing characters
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');

// Decode base64 and convert to UTF-8 string using percent encoding
var jsonPayload = decodeURIComponent(
const jsonPayload = decodeURIComponent(
window
.atob(base64)
.split('')
Expand Down
2 changes: 1 addition & 1 deletion src/views/BoxPhase/BoxPhaseView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const BoxPhaseView = () => {
setBoxes(response.data || []);
setLoading(false);

let roomName = await getRoomName(room_id);
const roomName = await getRoomName(room_id);

dispatch({
action: 'SET_BREADCRUMB',
Expand Down
6 changes: 3 additions & 3 deletions src/views/Idea/IdeaView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const IdeaView = () => {
const getRoomName = (id: string) => {
return getRoom(id).then((response) => {
if (response.error || !response.data) return;
let roomName = response.data.room_name;
const roomName = response.data.room_name;
return roomName;
});
};
Expand All @@ -49,7 +49,7 @@ const IdeaView = () => {

let roomName = 'aula';
if (room_id) {
let nameResponse = await getRoomName(room_id);
const nameResponse = await getRoomName(room_id);
if (nameResponse) roomName = nameResponse;
}

Expand All @@ -64,7 +64,7 @@ const IdeaView = () => {
}

if (response.data && response.data.title) {
let breadCrumbs = [
const breadCrumbs = [
[roomName, `/room/${room_id}/phase/0`],
[t(`phases.name-${phase}`), `/room/${room_id}/phase/${phase}`],
];
Expand Down
4 changes: 2 additions & 2 deletions src/views/IdeasBox/IdeasBoxView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const IdeasBoxView = () => {
const getRoomName = (id: string) => {
return getRoom(id).then((response) => {
if (response.error || !response.data) return '';
let roomName = response.data.room_name;
const roomName = response.data.room_name;
return roomName;
});
};
Expand Down Expand Up @@ -214,7 +214,7 @@ const IdeasBoxView = () => {
};

useEffect(() => {
let ideasList = document.getElementById('box-ideas');
const ideasList = document.getElementById('box-ideas');
if (ideasList) {
if (appState.lastIdeaList == 'box-ideas-' + phase) {
ideasList.scrollTop = appState.lastScroll;
Expand Down
4 changes: 2 additions & 2 deletions src/views/WildIdeas/WildIdeasView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const WildIdeas = () => {
const getRoomName = (id: string) => {
return getRoom(id).then((response) => {
if (response.error || !response.data) return;
let roomName = response.data.room_name;
const roomName = response.data.room_name;
return roomName;
});
};
Expand Down Expand Up @@ -112,7 +112,7 @@ const WildIdeas = () => {
};

useEffect(() => {
let ideasList = document.getElementById('wild-ideas-list');
const ideasList = document.getElementById('wild-ideas-list');
if (ideasList) {
if (appState.lastIdeaList == 'wild-ideas') {
ideasList.scrollTop = appState.lastScroll;
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/db-backchannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class DbBackchannel {
let result;
try {
result = await centralConnection.query<any>(`SELECT data FROM tenants WHERE instance_code = ?`, [instanceCode]);
let { data } = result[0];
const { data } = result[0];

const self = new DbBackchannel();
// Create pool so that we can reuse connections
Expand Down
2 changes: 1 addition & 1 deletion tests/lifecycle/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export async function cleanupTestData(opts: { keepAdminContext: boolean } = { ke
const authStatesDir = path.join(process.cwd(), 'tests/auth-states');
const generatedTestDataDir = path.join(process.cwd(), 'tests/generated-test-data');
try {
for (let dir of [authStatesDir, generatedTestDataDir]) {
for (const dir of [authStatesDir, generatedTestDataDir]) {
if (fs.existsSync(dir)) {
for (const file of fs.readdirSync(dir)) {
if (opts.keepAdminContext && file.endsWith('admin-context.json')) {
Expand Down
2 changes: 1 addition & 1 deletion tests/specs/core/csv-import.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ test('CSV Import', async ({ dbInstanceCode, ensureStatePathFor, newPageFor }) =>
const page = await newPageFor(user.username);
await page.goto(shared.getHost(), { waitUntil: 'domcontentloaded' });
await users.ensureSpecificInstanceEntered(page, dbInstanceCode);
await users.firstLoginFlow(page, user, user.tempPass!!);
await users.firstLoginFlow(page, user, user.tempPass!);
await ensureStatePathFor(user.username);
}
});
Expand Down
2 changes: 1 addition & 1 deletion tests/specs/core/rooms-search-and-sort.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('Rooms Search (Dashboard/Home page)', async ({ seededUser, newPageFor }) =>
const adminPage = await newPageFor('admin');
const userPage = await newPageFor('user');

let room: RoomData = entities.createRoom('search-sort');
const room: RoomData = entities.createRoom('search-sort');
room.users = [seededUser];
await roomsSettings.create(adminPage, room);

Expand Down
2 changes: 1 addition & 1 deletion tests/support/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (!process.env.APP_FRONTEND_HOST || process.env.APP_FRONTEND_HOST.toString().m

console.info('[info] using frontend:', process.env.APP_FRONTEND_HOST);

export const getHost = () => process.env.APP_FRONTEND_HOST!!;
export const getHost = () => process.env.APP_FRONTEND_HOST!;

export function gensym(prefix = 'GG') {
// tests will fail on collision.. very rare
Expand Down