diff --git a/backend/samfundet/migrations/0040_alter_notification_options_and_more.py b/backend/samfundet/migrations/0040_alter_notification_options_and_more.py new file mode 100644 index 000000000..551297f60 --- /dev/null +++ b/backend/samfundet/migrations/0040_alter_notification_options_and_more.py @@ -0,0 +1,102 @@ +# Generated by Django 4.2.6 on 2023-10-14 04:06 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import jsonfield.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('contenttypes', '0002_remove_content_type_name'), + ('samfundet', '0039_remove_recruitmentadmission_interview_location_and_more'), + ] + + operations = [ + migrations.AlterModelOptions( + name='notification', + options={'ordering': ('-timestamp',), 'verbose_name': 'Notification', 'verbose_name_plural': 'Notifications'}, + ), + migrations.AlterField( + model_name='notification', + name='action_object_content_type', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notify_action_object', to='contenttypes.contenttype', verbose_name='action object content type'), + ), + migrations.AlterField( + model_name='notification', + name='action_object_object_id', + field=models.CharField(blank=True, max_length=255, null=True, verbose_name='action object object id'), + ), + migrations.AlterField( + model_name='notification', + name='actor_content_type', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notify_actor', to='contenttypes.contenttype', verbose_name='actor content type'), + ), + migrations.AlterField( + model_name='notification', + name='actor_object_id', + field=models.CharField(max_length=255, verbose_name='actor object id'), + ), + migrations.AlterField( + model_name='notification', + name='data', + field=jsonfield.fields.JSONField(blank=True, null=True, verbose_name='data'), + ), + migrations.AlterField( + model_name='notification', + name='deleted', + field=models.BooleanField(db_index=True, default=False, verbose_name='deleted'), + ), + migrations.AlterField( + model_name='notification', + name='description', + field=models.TextField(blank=True, null=True, verbose_name='description'), + ), + migrations.AlterField( + model_name='notification', + name='emailed', + field=models.BooleanField(db_index=True, default=False, verbose_name='emailed'), + ), + migrations.AlterField( + model_name='notification', + name='level', + field=models.CharField(choices=[('success', 'success'), ('info', 'info'), ('warning', 'warning'), ('error', 'error')], default='info', max_length=20, verbose_name='level'), + ), + migrations.AlterField( + model_name='notification', + name='public', + field=models.BooleanField(db_index=True, default=True, verbose_name='public'), + ), + migrations.AlterField( + model_name='notification', + name='recipient', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL, verbose_name='recipient'), + ), + migrations.AlterField( + model_name='notification', + name='target_content_type', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notify_target', to='contenttypes.contenttype', verbose_name='target content type'), + ), + migrations.AlterField( + model_name='notification', + name='target_object_id', + field=models.CharField(blank=True, max_length=255, null=True, verbose_name='target object id'), + ), + migrations.AlterField( + model_name='notification', + name='timestamp', + field=models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='timestamp'), + ), + migrations.AlterField( + model_name='notification', + name='unread', + field=models.BooleanField(db_index=True, default=True, verbose_name='unread'), + ), + migrations.AlterField( + model_name='notification', + name='verb', + field=models.CharField(max_length=255, verbose_name='verb'), + ), + ] diff --git a/docker-compose.yml b/docker-compose.yml index 5467591be..88d190e55 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,6 @@ version: '3.9' ### Services ### services: - ### Backend Django ### backend: build: ./backend # Build in the context of this directory (meaning: use Dockerfile, .dockerignore etc.) @@ -51,7 +50,7 @@ services: - CYPRESS_baseUrl=http://frontend:3000 volumes: - ./frontend/cypress:/frontend/cypress - command: "yarn run cypress:run" + command: 'yarn run cypress:run' ## Storybook React ### storybook: @@ -87,5 +86,3 @@ services: ------------------------------------------------------------------------------- "' - - diff --git a/frontend/.yarnrc.yml b/frontend/.yarnrc.yml index 08d714dfc..6f472ab50 100644 --- a/frontend/.yarnrc.yml +++ b/frontend/.yarnrc.yml @@ -1,3 +1,2 @@ nodeLinker: node-modules - yarnPath: .yarn/releases/yarn-3.6.4.cjs diff --git a/frontend/Dockerfile.cypress b/frontend/Dockerfile.cypress index 095c95738..2f0cbd686 100644 --- a/frontend/Dockerfile.cypress +++ b/frontend/Dockerfile.cypress @@ -3,11 +3,12 @@ FROM cypress/base:18.16.0 WORKDIR /app -# Copy package file to docker -COPY package.json yarn.lock ./ +# Copy package file to docker. +COPY package.json yarn.lock .yarnrc.yml ./ +COPY .yarn/releases /app/.yarn/releases # Require up to date package.json and yarn.lock, fail otherwise. -RUN yarn install --frozen-lockfile +RUN yarn install --immutable # Copy remaining files COPY . /app diff --git a/frontend/Dockerfile.frontend b/frontend/Dockerfile.frontend index 789a39382..d9f1c4885 100644 --- a/frontend/Dockerfile.frontend +++ b/frontend/Dockerfile.frontend @@ -1,14 +1,15 @@ # For cypress dependencies use cypress image, eg. cypress/base:19 -FROM node:19.3-bullseye-slim +FROM node:20-bullseye-slim EXPOSE 3000 WORKDIR /app # Copy package file to docker. COPY package.json yarn.lock .yarnrc.yml ./ -COPY .yarn/ .yarn/ +COPY .yarn/releases /app/.yarn/releases # Require up to date package.json and yarn.lock, fail otherwise. -RUN yarn install --frozen-lockfile +# RUN --mount=type=cache,target=/app/.yarn/cache yarn install --immutable +RUN yarn install --immutable # Copy remaining files COPY . /app diff --git a/frontend/package.json b/frontend/package.json index 1ffa9b628..a1a0bc30d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,7 @@ "start:docker": "vite serve", "dev": "yarn run start", "build": "vite build", - "ci": "yarn install --frozen-lockfile", + "ci": "yarn install --immutable", "preview": "vite preview", "upgrade": "yarn upgrade", "outdated": "yarn outdated", diff --git a/frontend/src/Components/Button/Button.tsx b/frontend/src/Components/Button/Button.tsx index 33a46826e..797979a65 100644 --- a/frontend/src/Components/Button/Button.tsx +++ b/frontend/src/Components/Button/Button.tsx @@ -1,7 +1,7 @@ import { default as classNames, default as classnames } from 'classnames'; +import { Link } from 'react-router-dom'; import { ButtonType, Children } from '~/types'; import styles from './Button.module.scss'; -import { Link } from 'react-router-dom'; type ButtonTheme = | 'basic'