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 .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"files.exclude": {
"**/packages": true,
// "**/packages": true,
"**/.nuget": true,
"**/common": true,
"**/Data": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/login/__tests__/wizard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ test("wizard error", async ({ page, mockRequest }) => {
await expect(page).toHaveScreenshot([
"desktop",
"wizard",
"wizard-error.png",
"wizard-success-redirect.png",
]);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start-prod": "NODE_ENV=production node server.js",
"start:internal": "node ./scripts/buildTranslations.js && NODE_ENV=development API_HOST=http://127.0.0.1 node server.js",
"start-prod:internal": "NODE_ENV=production API_HOST=http://127.0.0.1 node server.js",
"lint": "next lint",
"lint": "next lint --max-warnings=0",
"clean": "shx rm -rf .next",
"deploy": "shx --silent mkdir -p ../../../publish/web/login && shx --silent mkdir -p ../../../publish/web/login/.next && shx --silent mkdir -p ../../../publish/web/login/node_modules && shx --silent mkdir -p ../../../publish/web/login/.next/static && shx cp -r .next/standalone/node_modules/* ../../../publish/web/login/node_modules && shx cp -r .next/static/* ../../../publish/web/login/.next/static && shx cp -r .next/standalone/packages/login/.next/* ../../../publish/web/login/.next && shx cp -f server.prod.js ../../../publish/web/login/server.js",
"test:build": "node ./scripts/buildTranslations.js && E2E_TEST=true next build",
Expand Down
3 changes: 2 additions & 1 deletion packages/login/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
reporter: [["html", { outputFolder: "../../playwright-report/login" }]],

/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
Expand Down
2 changes: 1 addition & 1 deletion packages/login/src/hooks/useDeviceType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const useDeviceType = () => {
return () => {
window.removeEventListener("resize", onResize);
};
}, [onResize]);
}, []);

return { currentDeviceType };
};
Expand Down
1 change: 1 addition & 0 deletions packages/login/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { OAuth2ErrorKey } from "./utils/enums";
export function middleware(request: NextRequest) {
const requestHeaders = new Headers(request.headers);

console.log("1");
const host = request.headers.get("x-forwarded-host");
const proto = request.headers.get("x-forwarded-proto");

Expand Down
23 changes: 21 additions & 2 deletions packages/shared/utils/beforeBuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,33 @@ const path = require("path");
const fs = require("fs");
const { readdir } = require("fs").promises;
// @ts-expect-error path is correct
const appSettings = require("../../../../1.work/DocSpace/buildtools/config/appsettings.json");

let appSettings = null;

try {
appSettings = require("../../../1.work/DocSpace/buildtools/config/appsettings.json");
} catch (e) {
console.log(e);
}

const beforeBuild = async (
pathsToLocales,
pathToFile,
additionalPath,
isSSR = false,
) => {
async function getCultures() {
const fileInDir = await readdir(pathsToLocales[0], {
withFileTypes: true,
});

const cultures = fileInDir
.filter((dirent) => dirent.isDirectory())
.map((d) => d.name);

return cultures;
}

async function* getFiles(dir) {
const dirents = await readdir(dir, { withFileTypes: true });
for (const dirent of dirents) {
Expand Down Expand Up @@ -74,7 +93,7 @@ const beforeBuild = async (

const localesFiles = await getLocalesFiles();

const cultures = appSettings.web.cultures;
const cultures = appSettings ? appSettings.web.cultures : await getCultures();

const collectionByLng = new Map();
const truthLng = new Map();
Expand Down