Skip to content

Commit

Permalink
More setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilte committed Oct 14, 2023
1 parent 5f2666f commit ff2a735
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -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'),
),
]
5 changes: 1 addition & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -87,5 +86,3 @@ services:
-------------------------------------------------------------------------------
"'
1 change: 0 additions & 1 deletion frontend/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.4.cjs
7 changes: 4 additions & 3 deletions frontend/Dockerfile.cypress
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 4 additions & 3 deletions frontend/Dockerfile.frontend
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit ff2a735

Please sign in to comment.