diff --git a/client/components/build/LeftSidebar/sections/Section.tsx b/client/components/build/LeftSidebar/sections/Section.tsx index 8f2cee6e..c42d77e0 100644 --- a/client/components/build/LeftSidebar/sections/Section.tsx +++ b/client/components/build/LeftSidebar/sections/Section.tsx @@ -99,7 +99,7 @@ const Section: React.FC = ({ diff --git a/client/components/shared/Heading.tsx b/client/components/shared/Heading.tsx index 790c69a2..5a86a9bb 100644 --- a/client/components/shared/Heading.tsx +++ b/client/components/shared/Heading.tsx @@ -62,7 +62,7 @@ const Heading: React.FC = ({ {editMode ? ( ) : ( -

{t(`builder.leftSidebar.${path}.heading`, heading)}

+

{t(`builder.leftSidebar.${path}.heading`, { defaultValue: heading })}

)} diff --git a/client/modals/auth/UserProfileModal.tsx b/client/modals/auth/UserProfileModal.tsx index b83f831b..1de75112 100644 --- a/client/modals/auth/UserProfileModal.tsx +++ b/client/modals/auth/UserProfileModal.tsx @@ -89,7 +89,7 @@ const UserProfileModal = () => { render={({ field, fieldState }) => ( ('modals.auth.profile.form.name.label')} error={!!fieldState.error} helperText={fieldState.error?.message} {...field} @@ -114,16 +114,16 @@ const UserProfileModal = () => { render={({ field, fieldState }) => ( ('modals.auth.profile.form.email.label')} error={!!fieldState.error} - helperText={t('modals.auth.profile.form.email.help-text')} + helperText={t('modals.auth.profile.form.email.help-text')} {...field} /> )} />
- +
@@ -133,10 +133,12 @@ const UserProfileModal = () => {
-
{t('modals.auth.profile.delete-account.heading')}
+
{t('modals.auth.profile.delete-account.heading')}
-

{t('modals.auth.profile.delete-account.body', { keyword: 'delete' })}

+

+ {t('modals.auth.profile.delete-account.body', { keyword: 'delete' })} +

{
diff --git a/client/modals/builder/sections/WorkModal.tsx b/client/modals/builder/sections/WorkModal.tsx index 952f5f84..7ec74ceb 100644 --- a/client/modals/builder/sections/WorkModal.tsx +++ b/client/modals/builder/sections/WorkModal.tsx @@ -57,12 +57,17 @@ const WorkModal: React.FC = () => { const isEditMode = useMemo(() => !!item, [item]); const addText = useMemo( - () => t('builder.common.actions.add', { token: t(`builder.leftSidebar.${path}.heading`, heading) }), + () => + t('builder.common.actions.add', { + token: t(`builder.leftSidebar.${path}.heading`, { defaultValue: heading }), + }), [t, heading] ); const editText = useMemo( () => - t('builder.common.actions.edit', { token: t(`builder.leftSidebar.${path}.heading`, heading) }), + t('builder.common.actions.edit', { + token: t(`builder.leftSidebar.${path}.heading`, { defaultValue: heading }), + }), [t, heading] ); diff --git a/client/next-i18next.config.js b/client/next-i18next.config.js index 9f71c75f..c2150d5a 100644 --- a/client/next-i18next.config.js +++ b/client/next-i18next.config.js @@ -48,6 +48,7 @@ const i18nConfig = { ], }, nsSeparator: '.', + returnNull: false, localePath: path.resolve('./public/locales'), ns: ['common', 'modals', 'landing', 'dashboard', 'builder'], }; diff --git a/client/types/next-env.d.ts b/client/types/next-env.d.ts deleted file mode 100644 index 4f11a03d..00000000 --- a/client/types/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/server/src/auth/auth.module.ts b/server/src/auth/auth.module.ts index b5ab02ec..58710a58 100644 --- a/server/src/auth/auth.module.ts +++ b/server/src/auth/auth.module.ts @@ -19,7 +19,7 @@ import { LocalStrategy } from './strategy/local.strategy'; imports: [ConfigModule], inject: [ConfigService], useFactory: async (configService: ConfigService) => ({ - secret: configService.get('auth.jwtSecret'), + secret: configService.get('auth.jwtSecret'), signOptions: { expiresIn: `${configService.get('auth.jwtExpiryTime')}s`, }, diff --git a/server/src/auth/auth.service.ts b/server/src/auth/auth.service.ts index c90919bc..df0c0d44 100644 --- a/server/src/auth/auth.service.ts +++ b/server/src/auth/auth.service.ts @@ -106,15 +106,15 @@ export class AuthService { getUserFromAccessToken(accessToken: string) { const payload: User = this.jwtService.verify(accessToken, { - secret: this.configService.get('auth.jwtSecret'), + secret: this.configService.get('auth.jwtSecret'), }); return this.usersService.findById(payload.id); } async authenticateWithGoogle(credential: string) { - const clientID = this.configService.get('google.clientID'); - const clientSecret = this.configService.get('google.clientSecret'); + const clientID = this.configService.get('google.clientID'); + const clientSecret = this.configService.get('google.clientSecret'); const OAuthClient = new OAuth2Client(clientID, clientSecret); const client = await OAuthClient.verifyIdToken({ idToken: credential }); diff --git a/server/src/auth/strategy/jwt.strategy.ts b/server/src/auth/strategy/jwt.strategy.ts index 533f2f08..8cdb2ad2 100644 --- a/server/src/auth/strategy/jwt.strategy.ts +++ b/server/src/auth/strategy/jwt.strategy.ts @@ -11,7 +11,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) { constructor(configService: ConfigService, private readonly usersService: UsersService) { super({ jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(), - secretOrKey: configService.get('auth.jwtSecret'), + secretOrKey: configService.get('auth.jwtSecret'), ignoreExpiration: false, }); } diff --git a/server/src/database/database.module.ts b/server/src/database/database.module.ts index 2bdee512..5e97b179 100644 --- a/server/src/database/database.module.ts +++ b/server/src/database/database.module.ts @@ -12,15 +12,15 @@ import { User } from '@/users/entities/user.entity'; inject: [ConfigService], useFactory: async (configService: ConfigService) => ({ type: 'postgres', - host: configService.get('postgres.host'), + host: configService.get('postgres.host'), port: configService.get('postgres.port'), - username: configService.get('postgres.username'), - password: configService.get('postgres.password'), - database: configService.get('postgres.database'), + username: configService.get('postgres.username'), + password: configService.get('postgres.password'), + database: configService.get('postgres.database'), poolSize: 22, synchronize: true, entities: [User, Resume], - ssl: configService.get('postgres.certificate') && { + ssl: configService.get('postgres.certificate') && { ca: Buffer.from(configService.get('postgres.certificate'), 'base64').toString('ascii'), }, }), diff --git a/server/src/fonts/fonts.service.ts b/server/src/fonts/fonts.service.ts index 743ab0b6..0e40b8e4 100644 --- a/server/src/fonts/fonts.service.ts +++ b/server/src/fonts/fonts.service.ts @@ -12,7 +12,7 @@ export class FontsService { constructor(private configService: ConfigService, private httpService: HttpService) {} async getAll(): Promise { - const apiKey = this.configService.get('google.apiKey'); + const apiKey = this.configService.get('google.apiKey'); const url = 'https://www.googleapis.com/webfonts/v1/webfonts?key=' + apiKey; let data = []; diff --git a/server/src/mail/mail.service.ts b/server/src/mail/mail.service.ts index db02b31b..674d7810 100644 --- a/server/src/mail/mail.service.ts +++ b/server/src/mail/mail.service.ts @@ -12,14 +12,14 @@ export class MailService { constructor(private configService: ConfigService) { this.transporter = createTransport({ - host: this.configService.get('mail.host'), + host: this.configService.get('mail.host'), port: this.configService.get('mail.port'), pool: true, secure: false, tls: { ciphers: 'SSLv3' }, auth: { - user: this.configService.get('mail.username'), - pass: this.configService.get('mail.password'), + user: this.configService.get('mail.username'), + pass: this.configService.get('mail.password'), }, }); } @@ -35,13 +35,13 @@ export class MailService { } async sendForgotPasswordEmail(user: User, resetToken: string): Promise { - const appUrl = this.configService.get('app.url'); + const appUrl = this.configService.get('app.url'); const url = `${appUrl}?modal=auth.reset&resetToken=${resetToken}`; const sendMailDto: SendMailDto = { from: { - name: this.configService.get('mail.from.name'), - email: this.configService.get('mail.from.email'), + name: this.configService.get('mail.from.name'), + email: this.configService.get('mail.from.email'), }, to: { name: user.name, diff --git a/server/src/main.ts b/server/src/main.ts index 826d11fa..b11905ba 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -10,7 +10,7 @@ const bootstrap = async () => { const app = await NestFactory.create(AppModule); const configService = app.get(ConfigService); - const appUrl = configService.get('app.url'); + const appUrl = configService.get('app.url'); // Middleware app.enableCors({ origin: [appUrl], credentials: true }); diff --git a/server/src/printer/printer.service.ts b/server/src/printer/printer.service.ts index ae65bc7f..b12bd46d 100644 --- a/server/src/printer/printer.service.ts +++ b/server/src/printer/printer.service.ts @@ -24,7 +24,7 @@ export class PrinterService implements OnModuleInit, OnModuleDestroy { } async printAsPdf(username: string, slug: string, lastUpdated: string): Promise { - const serverUrl = this.configService.get('app.serverUrl'); + const serverUrl = this.configService.get('app.serverUrl'); const directory = join(__dirname, '..', 'assets/exports'); const filename = `RxResume_PDFExport_${username}_${slug}_${lastUpdated}.pdf`; @@ -47,8 +47,8 @@ export class PrinterService implements OnModuleInit, OnModuleDestroy { ); }); - const url = this.configService.get('app.url'); - const secretKey = this.configService.get('app.secretKey'); + const url = this.configService.get('app.url'); + const secretKey = this.configService.get('app.secretKey'); const pdfDeletionTime = this.configService.get('cache.pdfDeletionTime'); const page = await this.browser.newPage(); diff --git a/server/src/resume/resume.service.ts b/server/src/resume/resume.service.ts index bbaab27c..b14e0b19 100644 --- a/server/src/resume/resume.service.ts +++ b/server/src/resume/resume.service.ts @@ -34,15 +34,15 @@ export class ResumeService { private configService: ConfigService, private usersService: UsersService ) { - this.s3Enabled = !isEmpty(configService.get('storage.bucket')); + this.s3Enabled = !isEmpty(configService.get('storage.bucket')); if (this.s3Enabled) { this.s3Client = new S3({ - endpoint: configService.get('storage.endpoint'), - region: configService.get('storage.region'), + endpoint: configService.get('storage.endpoint'), + region: configService.get('storage.region'), credentials: { - accessKeyId: configService.get('storage.accessKey'), - secretAccessKey: configService.get('storage.secretKey'), + accessKeyId: configService.get('storage.accessKey'), + secretAccessKey: configService.get('storage.secretKey'), }, }); } @@ -141,7 +141,7 @@ export class ResumeService { const isPrivate = !resume.public; const isOwner = resume.user.id === userId; - const isInternal = secretKey === this.configService.get('app.secretKey'); + const isInternal = secretKey === this.configService.get('app.secretKey'); if (!isInternal && isPrivate && !isOwner) { throw new HttpException('The resume you are looking does not exist, or maybe never did?', HttpStatus.NOT_FOUND); @@ -159,7 +159,7 @@ export class ResumeService { const isPrivate = !resume.public; const isOwner = resume.user.id === userId; - const isInternal = secretKey === this.configService.get('app.secretKey'); + const isInternal = secretKey === this.configService.get('app.secretKey'); if (!isInternal && isPrivate && !isOwner) { throw new HttpException('The resume you are looking does not exist, or maybe never did?', HttpStatus.NOT_FOUND); @@ -247,7 +247,7 @@ export class ResumeService { let updatedResume = null; if (this.s3Enabled) { - const urlPrefix = this.configService.get('storage.urlPrefix'); + const urlPrefix = this.configService.get('storage.urlPrefix'); const key = `uploads/${userId}/${id}/${filename}`; const publicUrl = urlPrefix + key; await this.s3Client.send( @@ -255,13 +255,13 @@ export class ResumeService { Key: key, Body: file.buffer, ACL: 'public-read', - Bucket: this.configService.get('storage.bucket'), + Bucket: this.configService.get('storage.bucket'), }) ); updatedResume = set(resume, 'basics.photo.url', publicUrl); } else { const path = `${__dirname}/../assets/uploads/${userId}/${id}/`; - const serverUrl = this.configService.get('app.serverUrl'); + const serverUrl = this.configService.get('app.serverUrl'); try { await fs.mkdir(path, { recursive: true }); @@ -286,16 +286,16 @@ export class ResumeService { if (!publicUrl || publicUrl === '') return; if (this.s3Enabled) { - const urlPrefix = this.configService.get('storage.urlPrefix'); + const urlPrefix = this.configService.get('storage.urlPrefix'); const key = publicUrl.replace(urlPrefix, ''); await this.s3Client.send( new DeleteObjectCommand({ Key: key, - Bucket: this.configService.get('storage.bucket'), + Bucket: this.configService.get('storage.bucket'), }) ); } else { - const serverUrl = this.configService.get('app.serverUrl'); + const serverUrl = this.configService.get('app.serverUrl'); const filePath = __dirname + '/..' + resume.basics.photo.url.replace(serverUrl, ''); const isValidFile = (await fs.stat(filePath)).isFile();