From 970c1fadf3edd1f1e53db01d1db1b07fc086407a Mon Sep 17 00:00:00 2001 From: Agathe Badia Date: Sun, 10 Mar 2024 18:55:59 +0100 Subject: [PATCH] fix(bildungsurlaub): Fix copy to clipboard --- app/routes/home/controller.js | 21 ++++++------------ app/routes/home/template.hbs | 40 ++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/app/routes/home/controller.js b/app/routes/home/controller.js index e620adf..40400ae 100644 --- a/app/routes/home/controller.js +++ b/app/routes/home/controller.js @@ -1,23 +1,16 @@ import Controller from '@ember/controller'; export default class HomeController extends Controller { - get onSuccess() { - return 'Copied to clipboard'; - } - - get onError() { - return 'An error occurred, please try again'; - } - - get copyContent() { - let text = document.getElementById('copyTextToClipboard').innerHTML; - const copy = async () => { + // REMINDER: copy to clipboard only works on HTTPS + async copyContent(targetText) { + let text = document.getElementById(targetText).innerHTML; try { - await navigator.clipboard.writeText(text); + await + navigator.clipboard.writeText(text); alert('Content copied to clipboard'); } catch (err) { - alert.error('Failed to copy: ', err); + alert('Failed to copy: ', err); } - } + // } } } diff --git a/app/routes/home/template.hbs b/app/routes/home/template.hbs index 676962f..da98fde 100644 --- a/app/routes/home/template.hbs +++ b/app/routes/home/template.hbs @@ -5,6 +5,7 @@ {{!-- TODO: Ideally find a way to display a SVG instead, which is more accessible --}} {{!-- Mermaid live editor: https://mermaid.live/edit#pako:eNpNkDtvwzAMhP8KwTkG6jTooKFDH0OHTtkKL4xFOwIk0dAjgRDkv1d1UFiaqA-n4-luOIpmVBgTJf4wNAdy3WU_eKhnhb2CT7dYKawbulfw5SGdGUZxC_kCkwRwErhC8vBSZ5_OsXnyXI2smc3J8ip-M1ZnP8ccLOVTIzwoeK8WOTLkBZJA_wSaSgS-cCiQrgKFKbTePXTd63-0NubKH-vbKBs-4A4dB0dG1xpuf6IB678cD6jqqHmibNOAg79XKeUkx-JHVClk3mFe9FYcqolsrLQW8iOy3VmbJOH7UfXa-P0XYap84w --}} +

Schema needs a complete alt text

TABLE OF content {{!-- TODO --}} @@ -41,9 +42,7 @@ TABLE OF content -

Include complete schema of scenarios

- General scenario of eligibility containing employment status + if already used Bildungsurlaub days, and more -

Schema needs a complete alt text

+

Find a Bildungsurlaub

In the German states with Bildungsurlaub regulations, the common rule is to be employed for at least 6 months, to be eligible for Bildungsurlaub (5 days per year or 10 days every 2 years, see #Entitlement content for details). Also, the education itself must be recognized as Bildungsurlaub in the German state you are working in.

@@ -78,9 +77,11 @@ TABLE OF content
  • Start date and end date of the Bildungsurlaub
  • - Ready to submit a request? Let's do it! Here is a template you can use: + Ready to submit a request? Let's do it! -

    To the attention of `INSERT DEPARTMENT`: +

    Here is a template you can use in English (scroll down for the German template):

    + +

    To the attention of `INSERT DEPARTMENT`: I would like to request an approval for an educational leave (Bildungsurlaub) between `INSERT STARTING DATE` and `END DATE` (`INSERT EXACT NUMBER OF DAYS` days). As stated by the `NAME OF THE STATE YOUR ARE WORKING IN` law, as an employee, I'm entitled to days for further education. I would like to use those days for `NAME OF THE COURSE`. The course consists of: @@ -89,18 +90,27 @@ TABLE OF content I have informed my direct manager of the above request (you can also CC your manager if you are sending the request as an email). + Please let me know if you need additional information. + + Best,

    - -

    Copy text in English

    - clipboard - {{!-- ember-cli-clipboard TODO: FIX --}} - {{!-- - Click To Copy - --}} - {{!-- TODO: text should contain the whole letter for application, with markups --}} - {{!-- ember-cli-clipboard --}} -

    Copy text in German

    + +

    Zu Händen von `ABTEILUNG EINFÜGEN`: + Ich möchte eine Genehmigung für einen Bildungsurlaub zwischen `Beginndatum einfügen` und `Enddatum` (genaue Anzahl der + Tage einfügen) beantragen. + Gemäß dem Gesetz `NAME DES STAATES IN DEM SIE ARBEITEN` habe ich als Arbeitnehmer Anspruch auf Tage zur Weiterbildung. + Ich möchte diese Tage für `NAME DES KURSES` verwenden. + Der Kurs besteht aus: + Fügen Sie die Hauptthemen des Kurses ein, was in etwa den Stunden des Kurses pro Tag/Woche entspricht. + In der Anlage finden Sie zusätzliche Informationen zum Kurs: "LINK ZUM KURS UND/ODER LINK ZUR SCHULE EINFÜGEN". + + Ich habe meinen direkten Vorgesetzten über den obigen Antrag informiert (Sie können auch Ihren Vorgesetzten informieren, + wenn Sie den Antrag per E-Mail senden). + +

    +

    Create table of content

    Add additional links

    Replace Tailwind logo with Bildungsurlaub one (Canva logo creation? or ask ChatGPT for platform to create logos)