Compare commits

..

No commits in common. "main" and "main" have entirely different histories.
main ... main

8 changed files with 61 additions and 157 deletions

View File

@ -1,11 +1,2 @@
.browserslistrc
.dockerignore
.drone.yml
.editorconfig
.git .git
.gitignore
.reuse
Dockerfile
LICENSES
README.md
node_modules node_modules

View File

@ -4,110 +4,40 @@
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
kind: pipeline kind: pipeline
type: docker type: docker
name: qa name: default
trigger:
event:
- push
- pull_request
branch:
- main
steps: steps:
- name: reuse - name: reuse
image: fsfe/reuse image: fsfe/reuse:latest
- name: lint
image: node:20
commands:
- npm ci
- npm run lint
- name: docker-build
image: plugins/docker
settings:
registry: git.wtf-eg.de
repo: git.wtf-eg.de/kompetenzinventar/frontend
target: ki-frontend
dry_run: true
--- - name: docker-publish
kind: pipeline image: plugins/docker
type: docker settings:
name: build registry: registry.wtf-eg.net
repo: registry.wtf-eg.net/ki-frontend
target: ki-frontend
auto_tag: true
username:
from_secret: "docker_username"
password:
from_secret: "docker_password"
when:
event:
- push
branch:
- main
trigger: - name: docker-publish-tag
event: image: plugins/docker
- push settings:
branch: registry: registry.wtf-eg.net
- main repo: registry.wtf-eg.net/ki-frontend
target: ki-frontend
depends_on: auto_tag: true
- qa username:
from_secret: "docker_username"
steps: password:
- name: docker-publish from_secret: "docker_password"
image: plugins/docker when:
settings: event:
registry: git.wtf-eg.de - tag
repo: git.wtf-eg.de/kompetenzinventar/frontend
target: ki-frontend
auto_tag: true
username:
from_secret: "docker_username"
password:
from_secret: "docker_password"
---
kind: pipeline
type: docker
name: deploy
trigger:
event:
- push
branch:
- main
depends_on:
- build
steps:
- name: deploy-dev
image: appleboy/drone-ssh
settings:
host:
- dev01.wtf-eg.net
username: drone_deployment
key:
from_secret: "dev01_deployment_key"
command_timeout: 2m
script:
- echo "Executing forced command..."
---
kind: pipeline
type: docker
name: tag-release
trigger:
event:
- tag
steps:
- name: reuse
image: fsfe/reuse
- name: lint
image: node:20
commands:
- npm ci
- npm run lint
- name: docker-publish
image: plugins/docker
settings:
registry: git.wtf-eg.de
repo: git.wtf-eg.de/kompetenzinventar/frontend
target: ki-frontend
auto_tag: true
username:
from_secret: "docker_username"
password:
from_secret: "docker_password"

View File

@ -4,25 +4,12 @@
FROM node:14-alpine as builder FROM node:14-alpine as builder
COPY package.json package-lock.json ./ COPY . ./
RUN npm install
COPY .eslintrc.js .
COPY babel.config.js .
COPY public public
COPY src src
RUN npm ci && npm run build RUN npm ci && npm run build
FROM nginx as ki-frontend FROM nginx as ki-frontend
LABEL org.opencontainers.image.source=https://git.wtf-eg.de/kompetenzinventar/ki-frontend.git COPY --from=builder /dist/ /usr/share/nginx/html/
LABEL org.opencontainers.image.url=https://git.wtf-eg.de/kompetenzinventar/ki-frontend
LABEL org.opencontainers.image.documentation=https://git.wtf-eg.de/kompetenzinventar/ki-frontend#docker
LABEL org.opencontainers.image.vendor="WTF Kooperative eG"
WORKDIR /usr/share/nginx/html
COPY etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf COPY etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /dist .

View File

@ -9,24 +9,10 @@ server {
#access_log /var/log/nginx/host.access.log main; #access_log /var/log/nginx/host.access.log main;
root /usr/share/nginx/html;
# routes without dots serve the index.html without caching
location / { location / {
add_header Cache-Control "no-cache"; root /usr/share/nginx/html;
try_files $uri $uri/index.html /index.html; index index.html index.htm;
} try_files $uri $uri/ /index.html;
# static js and css files that get replaced instead of updated
location ~ \.(js|css) {
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
# cache other static files for 30 days
location ~ \.(?!html) {
add_header Cache-Control "public, max-age=2592000";
try_files $uri =404;
} }
#error_page 404 /404.html; #error_page 404 /404.html;

View File

@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
<div class="fw-bold text-white mb-2">Kompetenzinventar</div> <div class="fw-bold text-white mb-2">Kompetenzinventar</div>
<ul class="list-unstyled"> <ul class="list-unstyled">
<li><a href="https://git.wtf-eg.de/kompetenzinventar">Quellcode</a></li> <li><a href="https://git.wtf-eg.de/kompetenzinventar">Quellcode</a></li>
<li><a href="https://git.wtf-eg.de/kompetenzinventar/ki-doku/issues/new/choose">Problem melden</a></li> <li><a href="https://git.wtf-eg.de/kompetenzinventar/ki-frontend/issues/new">Problem melden</a></li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -95,11 +95,10 @@ export default {
console.error(error); console.error(error);
} }
}, },
async submitFormEdit(isProfileVisible) { async submitFormEdit() {
this.showErrorMessage = false this.showErrorMessage = false
this.showSuccessMessage = false this.showSuccessMessage = false
const userId = store.state.currentUserId const userId = store.state.currentUserId
this.profile.visible = isProfileVisible;
try { try {
const body = JSON.stringify(this.profile) const body = JSON.stringify(this.profile)

View File

@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
class="form-control" class="form-control"
id="searchText" id="searchText"
v-model="searchText" v-model="searchText"
placeholder="Nick, Name, Fähigkeit, Sprache" placeholder="Nick, Fähigkeit, Sprache"
ref="searchTextInput" ref="searchTextInput"
/> />
</div> </div>

View File

@ -12,8 +12,25 @@ SPDX-License-Identifier: AGPL-3.0-or-later
</div> </div>
</div> </div>
<div class="container"> <div class="container">
<form @submit.prevent="submitFormEdit(false)"> <form @submit.prevent="submitFormEdit()">
<Section title="Grunddaten"> <Section title="Grunddaten">
<div class="mb-4">
<div class="form-check form-switch">
<input
class="form-check-input"
type="checkbox"
role="switch"
v-model="profile.visible"
id="visibility"
>
<label
class="form-check-label"
for="visibility">
Profil für angemeldete Benutzer sichtbar
</label>
</div>
</div>
<div class="row mb-4"> <div class="row mb-4">
<div class="col-12 col-md-4 mb-3 mb-md-0"> <div class="col-12 col-md-4 mb-3 mb-md-0">
<label class="form-label">Nickname</label> <label class="form-label">Nickname</label>
@ -205,17 +222,11 @@ SPDX-License-Identifier: AGPL-3.0-or-later
<i class="bi bi-check-lg"></i> <i class="bi bi-check-lg"></i>
Gespeichert Gespeichert
</div> </div>
<button
class="btn btn-secondary ms-3"
@click="submitFormEdit(false)"
>
Entwurf Speichern
</button>
<button <button
class="btn btn-primary ms-3" class="btn btn-primary ms-3"
@click="submitFormEdit(true)" @click="submitFormEdit()"
> >
Speichern und Veröffentlichen Speichern
</button> </button>
</div> </div>
</div> </div>