Skip to content

Commit

Permalink
Merge pull request #469 from MaMpf-HD/mampf-next
Browse files Browse the repository at this point in the history
Continuous Release v1.4.5
  • Loading branch information
Splines authored Apr 23, 2023
2 parents 16ad954 + 77ccd62 commit e4c2498
Show file tree
Hide file tree
Showing 38 changed files with 271 additions and 3,739 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
name: test-integration
on: [push]
name: Integration tests
on:
push:
branches:
- main
- mampf-next
- production
- experimental
pull_request:
jobs:
build:
e2e-test-job:
name: Run E2E tests & upload results to Cypress
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- run: docker-compose pull

- name: Pull docker images
run: docker compose pull --ignore-buildable
working-directory: docker/run_cypress_tests
- uses: satackey/[email protected]
# Ignore the failure of a step and avoid terminating the job.

- name: Use Docker layer caching # https://github.com/jpribyl/action-docker-layer-caching
uses: jpribyl/[email protected]
continue-on-error: true
- run: docker-compose build

- name: Build docker containers
run: docker compose build
working-directory: docker/run_cypress_tests
- name: Test

- name: Run integration tests
working-directory: docker/run_cypress_tests
env:
# pass the Dashboard record key as an environment variable
CYPRESS_baseUrl: http://mampf:3000
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: docker-compose run -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} cypress_runner cypress run --record --key ${{ secrets.CYPRESS_RECORD_KEY }}
run: docker compose run -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} --entrypoint="" cypress_runner sh -c "while ! curl http://mampf:3000 ; do echo waiting for MaMpf to come online at http://mampf:3000; sleep 3; done; cypress run --record --key ${{ secrets.CYPRESS_RECORD_KEY }}"
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

## Writing own tests

The describing test files can be found/ must be placed in `spec/cypress/integration/*.js`.
The describing test files can be found/ must be placed in `spec/cypress/e2e/*.cy.js`.
You can call arbitrary functions/files in mampf by calling `cy.app("clean")` for example located in `spec/cypress/app_commands`.
Furthermore, you can setup special scenarios by providing a file in `spec/cypress/app_commands/scenarios/`,
that can be called by `cy.appScenario("setup")` for example. Always try to
Expand Down
5 changes: 5 additions & 0 deletions app/assets/javascripts/footer_modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
document.addEventListener("turbolinks:load", () => {
if (window.location.hash == "#sponsors") {
$('#sponsors').modal('show');
}
});
2 changes: 1 addition & 1 deletion app/assets/stylesheets/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
}

li {
.sidebar-item li {
display: flex;
align-items: center;

Expand Down
3 changes: 1 addition & 2 deletions app/controllers/main_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# MainController
class MainController < ApplicationController
skip_before_action :authenticate_user!, only: [:home, :about, :news,
:sponsors]

before_action :check_for_consent
authorize_resource class: false, only: :start
layout 'application_no_sidebar'
Expand Down
17 changes: 10 additions & 7 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
<%= render partial: 'shared/navbar' %>
<div class="d-flex container-fluid flex-grow-1">
<div class="row" id="main-content-row">
<div id="sidebar-container"
class="col-sm-4 col-md-3 col-xl-2">
<nav id="sidebar">
<%= render partial: 'shared/sidebar',
locals: { lecture: @lecture || current_lecture } %>
</nav>
</div>
<% lecture = @lecture || current_lecture %>
<% if lecture %>
<div id="sidebar-container"
class="col-sm-4 col-md-3 col-xl-2">
<nav id="sidebar">
<%= render partial: 'shared/sidebar',
locals: { lecture: lecture } %>
</nav>
</div>
<% end %>
<main class="col-sm-8 ml-auto col-md-9 col-xl-10 pt-3" role="main">
<div class="alert alert-danger" id="js-messages" role="alert"
style="display: none;">
Expand Down
111 changes: 111 additions & 0 deletions app/views/main/_sponsors.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<h3 class="mb-4">
<%= t('sponsors.sponsorships') %>
</h3>
<h5>
<%= t('sponsors.uni_hd') %>
</h5>
<ul>
<li class="d-block">
<strong>
2022-2023:
</strong>
<%= t('sponsors.heiquality_html',
hendrik: link_to('Hendrik Kasten',
'https://www.mathi.uni-heidelberg.de/~kasten/',
target: :_blank),
denis: link_to('Denis Vogel',
'https://www.mathi.uni-heidelberg.de/~vogel/',
target: :_blank)) %>
</li>
<li class="d-block">
<strong>
2019-2020:
</strong>
<%= t('sponsors.heistart_html',
hendrik: link_to('Hendrik Kasten',
'https://www.mathi.uni-heidelberg.de/~kasten/',
target: :_blank),
oli: link_to('Oliver Thomas',
'https://www.mathi.uni-heidelberg.de/~othomas/',
target: :_blank),
denis: link_to('Denis Vogel',
'https://www.mathi.uni-heidelberg.de/~vogel/',
target: :_blank),
fs_mathphysinfo: link_to('Fachschaft MathPhysInfo',
'https://mathphys.fsk.uni-heidelberg.de/w/',
target: :_blank)) %>
</li>
<li class="d-block">
<strong>
2018:
</strong>
<%= t('sponsors.physics_html',
physics_faculty: link_to('Fakultät für Physik und Astronomie',
'https://www.physik.uni-heidelberg.de/',
target: :_blank)) %>
</li>
<li class="d-block">
<strong>
<%= t('basics.since') %> 2017:
</strong>
<%= t('sponsors.math_html',
math_faculty: link_to('Fakultät für Mathematik und Informatik',
'https://mathinf.uni-heidelberg.de/',
target: :_blank)) %>
</li>
</ul>
<h5>
<%= t('sponsors.hse') %>
</h5>
<ul>
<li class="d-block">
<strong>
2019:
</strong>
<%= t('sponsors.go_digital_html',
digital_now: link_to('HSE: Go digital! Now!',
'https://hse-heidelberg.de/ueber-uns/hse-go-digital-now',
target: :_blank)) %>
</li>
<li class="d-block">
<strong>
2018-2019:
</strong>
<%= t('sponsors.fellowship_html',
place: link_to('PLACE',
'https://www.hse-heidelberg.de/ueber-uns/place',
target: :_blank),
hendrik: link_to('Hendrik Kasten',
'https://www.mathi.uni-heidelberg.de/~kasten/',
target: :_blank),
fellowship_project: link_to('"Geometrie und Unterricht - Ausgestaltung eines
profillinienübergreifenden Verschränkungsmoduls im
Fach Mathematik"',
'https://hse-heidelberg.de/forschung/forschungsprojekte/geometrie-und-unterricht-ausgestaltung-eines',
target: :_blank)) %>
</li>
<li class="d-block">
<strong>
2018:
</strong>
<%= t('sponsors.zurlamitmu_html',
place: link_to('PLACE',
'https://www.hse-heidelberg.de/ueber-uns/place',
target: :_blank),
markus: link_to('Markus Vogel',
'https://www.ph-heidelberg.de/vogel-markus.html',
target: :_blank),
denis: link_to('Denis Vogel',
'https://www.mathi.uni-heidelberg.de/~vogel/',
target: :_blank),
zurlamitmu_project: link_to('"ZurLAmitMU"',
'https://hse-heidelberg.de/forschung/forschungsprojekte/zurlamitmu-zugaenge-zur-linearen-algebra-mit-multimedia-erleichtern',
target: :_blank)) %>
</li>
</ul>

<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">
&times;
</span>
</button>
107 changes: 0 additions & 107 deletions app/views/main/sponsors.html.erb

This file was deleted.

4 changes: 2 additions & 2 deletions app/views/profile/_data.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="col-12 mb-3">
<div class="mb-3">
<%= t('profile.data_explanation') %>
</div>
<div class="col-12 text-center">
<div>
<%= link_to t('profile.data_request'),
request_data_path,
class: 'btn btn-sm btn-primary',
Expand Down
7 changes: 7 additions & 0 deletions app/views/profile/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,10 @@
<%= render partial: 'shared/generic_modal',
locals: { sort: 'deleteAccount',
title: t('profile.delete_account') } %>

<div>
<%= link_to :root, class: "btn btn-sm btn-primary" do %>
<span class="bi bi-arrow-left">
<%= t('back_to_home') %>
<% end %>
</div>
18 changes: 15 additions & 3 deletions app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
<%= javascript_include_tag :footer_modal %>

<% I18n.with_locale(current_user.try(:locale)) do %>

<%# Sponsors modal %>
<div id="sponsors" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="Sponsors list modal" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content p-4">
<%= render partial: 'main/sponsors' %>
</div>
</div>
</div>

<%# Footbar %>
<div class="container-fluid bg-grey-lighten-6 p-3">
<div class="row">
<div class="col text-md-left">
Expand Down Expand Up @@ -39,9 +52,8 @@
target: :_blank)) %>
</div>
<div class="col text-md-right">
<%= t('footer.sponsors_html',
sponsors: link_to(t('basics.sponsors'),
sponsors_path)) %>
<a href="#sponsors" data-toggle="modal"
data-target="#sponsors"><%= t('basics.sponsors') %></a>
<span style="margin-left: 20px;"></span>
<a href="https://hse-heidelberg.de/"
target="_blank"
Expand Down
Loading

0 comments on commit e4c2498

Please sign in to comment.