Skip to content

Commit

Permalink
release: v0.33.0 (#212)
Browse files Browse the repository at this point in the history
* feat: Create laboratory (#173)

* feat: List laboratories (#177)

* feat: Create and edit markdown blocks (#183)

* feat: Sort enrolled students by full name (#201)

* feat: Create test blocks (#203)

* feat: Delete markdown block (#205)

* chore(deps): Bump dependencies (#206)

* feat: Download language template (#209)

* build: Update nginx config (#210)

* feat: Show laboratory content to students (#211)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
PedroChaparro and dependabot[bot] authored Jan 1, 2024
1 parent d198c9c commit 171cf91
Show file tree
Hide file tree
Showing 110 changed files with 5,875 additions and 685 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ dist-ssr
/test-results/
/playwright-report/
/playwright/.cache/

# Test data
e2e/laboratories/data/java-downloaded.zip
20 changes: 10 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# [0.24.0](https://github.com/upb-code-labs/react-client/compare/v0.23.0...v0.24.0) (2023-11-19)
# [0.33.0](https://github.com/upb-code-labs/react-client/compare/v0.32.0...v0.33.0) (2024-01-01)


### Features

* Delete rubric objective ([#143](https://github.com/upb-code-labs/react-client/issues/143)) ([f869366](https://github.com/upb-code-labs/react-client/commit/f869366463800ae0525a4faed4f0c71d97d3ec04))
* Show laboratory content to students ([#211](https://github.com/upb-code-labs/react-client/issues/211)) ([6d7c2e4](https://github.com/upb-code-labs/react-client/commit/6d7c2e45527ca3d0f3122d5a6ffbd3d43f4495af))



# [0.23.0](https://github.com/upb-code-labs/react-client/compare/v0.22.0...v0.23.0) (2023-11-19)
# [0.32.0](https://github.com/upb-code-labs/react-client/compare/v0.31.0...v0.32.0) (2023-12-31)


### Features

* Delete criteria ([#142](https://github.com/upb-code-labs/react-client/issues/142)) ([e645ff6](https://github.com/upb-code-labs/react-client/commit/e645ff6a47b80df019a165c3434a077cbed07a13))
* Download language template ([#209](https://github.com/upb-code-labs/react-client/issues/209)) ([d2f1b9c](https://github.com/upb-code-labs/react-client/commit/d2f1b9cf758e2f3507b41c355304134dcc373740))



# [0.22.0](https://github.com/upb-code-labs/react-client/compare/v0.21.0...v0.22.0) (2023-11-18)
# [0.31.0](https://github.com/upb-code-labs/react-client/compare/v0.30.0...v0.31.0) (2023-12-31)


### Features

* Update criteria ([#141](https://github.com/upb-code-labs/react-client/issues/141)) ([489403e](https://github.com/upb-code-labs/react-client/commit/489403e541a0158688bdb706c12561f847af7674))
* Delete tests block ([2c0e6d4](https://github.com/upb-code-labs/react-client/commit/2c0e6d4c6c21ff0f6e74e93ef5535d4f688a8ef0))



# [0.21.0](https://github.com/upb-code-labs/react-client/compare/v0.20.0...v0.21.0) (2023-11-18)
# [0.30.0](https://github.com/upb-code-labs/react-client/compare/v0.29.0...v0.30.0) (2023-12-31)


### Features

* Update rubric objective ([#140](https://github.com/upb-code-labs/react-client/issues/140)) ([7dffd39](https://github.com/upb-code-labs/react-client/commit/7dffd3963c9567327f0ed6eb4838949cf4568853))
* Delete markdown block ([#205](https://github.com/upb-code-labs/react-client/issues/205)) ([e19079f](https://github.com/upb-code-labs/react-client/commit/e19079f1a137854c612b110a3bec13526746a426))



# [0.20.0](https://github.com/upb-code-labs/react-client/compare/v0.19.0...v0.20.0) (2023-11-17)
# [0.29.0](https://github.com/upb-code-labs/react-client/compare/v0.28.0...v0.29.0) (2023-12-31)


### Features

* Update rubric name ([#139](https://github.com/upb-code-labs/react-client/issues/139)) ([8d46db1](https://github.com/upb-code-labs/react-client/commit/8d46db16ca01d1081e6664d86bcf2b0fac2e4751))
* Create test blocks ([#203](https://github.com/upb-code-labs/react-client/issues/203)) ([a1a975f](https://github.com/upb-code-labs/react-client/commit/a1a975f3b0eafa25dc6349be4511ee417845e20f))



5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ RUN pnpm build

# --- Run stage ---
FROM nginx:1-alpine3.18-slim AS runner
RUN rm /etc/nginx/conf.d/default.conf

COPY ./config/default.nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/dist /var/www/codelabs/html
COPY ./config/default.nginx.conf /etc/nginx/conf.d
COPY --from=builder /app/dist /usr/share/nginx/html

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
7 changes: 3 additions & 4 deletions config/default.nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ server {
listen 80;
listen [::]:80;

root /var/www/codelabs/html;
index index.html;

location / {
try_files $uri $uri/ =404;
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}
16 changes: 13 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,30 @@ services:
POSTGRES_DB: codelabs
ports:
- "127.0.0.1:5432:5432"

# Microservices
codelabs_static_files:
image: ghcr.io/upb-code-labs/static-files-microservice:latest
container_name: codelabs_static_files
restart: on-failure
ports:
- "127.0.0.1:8081:8080"
depends_on:
- codelabs_postgres_db

codelabs_main_api:
image: ghcr.io/upb-code-labs/main-api:latest
container_name: codelabs_main_api
restart: on-failure
environment:
- DB_CONNECTION_STRING=postgres://postgres:postgres@codelabs_postgres_db:5432/codelabs?sslmode=disable
- ENVIRONMENT=production
- DB_CONNECTION_STRING=postgres://postgres:postgres@codelabs_postgres_db:5432/codelabs?sslmode=disable
- STATIC_FILES_MICROSERVICE_ADDRESS=http://codelabs_static_files:8080
ports:
- "127.0.0.1:8080:8080"
depends_on:
- codelabs_postgres_db
- codelabs_static_files

# Utils
postgres_db_admin:
Expand All @@ -38,4 +49,3 @@ services:
- "127.0.0.1:5050:80"
depends_on:
- codelabs_postgres_db

88 changes: 88 additions & 0 deletions e2e/laboratories/create-laboratory.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import { expect, test } from "@playwright/test";
import {
getDefaultPassword,
getDevelopmentAdminCredentials,
getRandomEmail,
getRandomName
} from "e2e/Utils";

test.describe.serial("Teachers can create laboratories", () => {
const teacherEmail = getRandomEmail();
const teacherPassword = getDefaultPassword();
const courseName = "Create laboratories - course";

test("Register test teacher", async ({ page }) => {
// Login as an admin
const adminCredentials = getDevelopmentAdminCredentials();
await page.goto("/login");
await page.getByLabel("Email").fill(adminCredentials.email);
await page.getByLabel("Password").fill(adminCredentials.password);
await page.getByRole("button", { name: "Submit" }).click();

// Register a teacher
await page
.getByRole("link", { name: "Register Teachers", exact: true })
.click();
await page.getByLabel("Full name").fill(getRandomName());
await page.getByLabel("Email").fill(teacherEmail);
await page.getByLabel("Password").fill(teacherPassword);
await page.getByRole("button", { name: "Submit" }).click();
});

test("Create test course", async ({ page }) => {
// Login as a teacher
await page.goto("/login");
await page.getByLabel("Email").fill(teacherEmail);
await page.getByLabel("Password").fill(teacherPassword);
await page.getByRole("button", { name: "Submit" }).click();

// Create a course
const createCourseButton = page.getByRole("button", {
name: "Create a new course"
});
await createCourseButton.click();
await page.getByLabel("Name").fill(courseName);
await page.getByRole("button", { name: "Create" }).click();
});

test("Create a laboratory", async ({ page }) => {
// Login as a teacher
await page.goto("/login");
await page.getByLabel("Email").fill(teacherEmail);
await page.getByLabel("Password").fill(teacherPassword);
await page.getByRole("button", { name: "Submit" }).click();

// Go to the course page
await page.getByRole("link", { name: courseName }).click();

// Open the modal
const createLaboratoryButton = page.getByRole("button", {
name: "Create Laboratory"
});
await createLaboratoryButton.click();

// Assert the modal is open
await expect(page.getByRole("dialog")).toBeVisible();

// Fill the form
const laboratoryName = "Laboratory 1";
await page.getByLabel("Name").fill(laboratoryName);
await page.getByLabel("Opening date").fill("2023-12-01T00:00");
await page.getByLabel("Closing date").fill("2023-12-01T23:59");
await page.getByRole("button", { name: "Create" }).click();

// Assert the modal is close and an alert is shown
await expect(page.getByRole("dialog")).not.toBeVisible();
await expect(
page.getByText("The laboratory has been created successfully")
).toBeVisible();

// Assert the laboratory is created
await expect(page.getByText("Laboratory 1")).toBeVisible();

// Assert actions buttons are shown
await expect(
page.getByRole("link", { name: `Edit ${laboratoryName} laboratory` })
).toBeVisible();
});
});
Binary file added e2e/laboratories/data/java.zip
Binary file not shown.
Loading

0 comments on commit 171cf91

Please sign in to comment.