diff --git a/.husky/_/pre-push b/.husky/_/pre-push index cf59fe1..a0d96ef 100755 --- a/.husky/_/pre-push +++ b/.husky/_/pre-push @@ -48,9 +48,6 @@ call_lefthook() elif command -v mint >/dev/null 2>&1 then mint run csjones/lefthook-plugin "$@" - elif command -v npx >/dev/null 2>&1 - then - npx lefthook "$@" else echo "Can't find lefthook in PATH" fi diff --git a/.husky/_/prepare-commit-msg b/.husky/_/prepare-commit-msg index e8e8dda..2655902 100755 --- a/.husky/_/prepare-commit-msg +++ b/.husky/_/prepare-commit-msg @@ -48,9 +48,6 @@ call_lefthook() elif command -v mint >/dev/null 2>&1 then mint run csjones/lefthook-plugin "$@" - elif command -v npx >/dev/null 2>&1 - then - npx lefthook "$@" else echo "Can't find lefthook in PATH" fi diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 0000000..a0d96ef --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,57 @@ +#!/bin/sh + +if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then + set -x +fi + +if [ "$LEFTHOOK" = "0" ]; then + exit 0 +fi + +call_lefthook() +{ + if test -n "$LEFTHOOK_BIN" + then + "$LEFTHOOK_BIN" "$@" + elif lefthook -h >/dev/null 2>&1 + then + lefthook "$@" + else + dir="$(git rev-parse --show-toplevel)" + osArch=$(uname | tr '[:upper:]' '[:lower:]') + cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/') + if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" + then + "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@" + elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" + then + "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@" + elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" + then + "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@" + elif test -f "$dir/node_modules/lefthook/bin/index.js" + then + "$dir/node_modules/lefthook/bin/index.js" "$@" + + elif bundle exec lefthook -h >/dev/null 2>&1 + then + bundle exec lefthook "$@" + elif yarn lefthook -h >/dev/null 2>&1 + then + yarn lefthook "$@" + elif pnpm lefthook -h >/dev/null 2>&1 + then + pnpm lefthook "$@" + elif swift package plugin lefthook >/dev/null 2>&1 + then + swift package --disable-sandbox plugin lefthook "$@" + elif command -v mint >/dev/null 2>&1 + then + mint run csjones/lefthook-plugin "$@" + else + echo "Can't find lefthook in PATH" + fi + fi +} + +call_lefthook run "pre-push" "$@" diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg new file mode 100755 index 0000000..2655902 --- /dev/null +++ b/.husky/prepare-commit-msg @@ -0,0 +1,57 @@ +#!/bin/sh + +if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then + set -x +fi + +if [ "$LEFTHOOK" = "0" ]; then + exit 0 +fi + +call_lefthook() +{ + if test -n "$LEFTHOOK_BIN" + then + "$LEFTHOOK_BIN" "$@" + elif lefthook -h >/dev/null 2>&1 + then + lefthook "$@" + else + dir="$(git rev-parse --show-toplevel)" + osArch=$(uname | tr '[:upper:]' '[:lower:]') + cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/') + if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" + then + "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@" + elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" + then + "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@" + elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" + then + "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@" + elif test -f "$dir/node_modules/lefthook/bin/index.js" + then + "$dir/node_modules/lefthook/bin/index.js" "$@" + + elif bundle exec lefthook -h >/dev/null 2>&1 + then + bundle exec lefthook "$@" + elif yarn lefthook -h >/dev/null 2>&1 + then + yarn lefthook "$@" + elif pnpm lefthook -h >/dev/null 2>&1 + then + pnpm lefthook "$@" + elif swift package plugin lefthook >/dev/null 2>&1 + then + swift package --disable-sandbox plugin lefthook "$@" + elif command -v mint >/dev/null 2>&1 + then + mint run csjones/lefthook-plugin "$@" + else + echo "Can't find lefthook in PATH" + fi + fi +} + +call_lefthook run "prepare-commit-msg" "$@" diff --git a/app/changesets/register.ts b/app/changesets/register.ts index ecb9f78..97f5d01 100644 --- a/app/changesets/register.ts +++ b/app/changesets/register.ts @@ -4,13 +4,18 @@ export interface RegisterDTO { id?: string; firstName: string; lastName: string; - category: string; - birthDate?: Date; + category: string | null; + birthDate: Date | null; phone: string; email: string; gift: number; password: string; confirmPassword?: string; + isFree: boolean; + period: Date[] | null; + time: Date | null; + status: string | null; + cv: File | null; } export class RegisterChangeset extends ImmerChangeset {} diff --git a/app/components/forms/register.gts b/app/components/forms/register.gts index 98da7f6..1653c55 100644 --- a/app/components/forms/register.gts +++ b/app/components/forms/register.gts @@ -3,7 +3,6 @@ import type { RegisterChangeset } from 'ember-boilerplate/changesets/register'; import TpkForm from '@triptyk/ember-input-validation/components/tpk-form'; import type validationsRegister from 'ember-boilerplate/validations/register'; import Component from '@glimmer/component'; -import { action } from '@ember/object'; export interface FormsRegisterSignature { Args: { @@ -19,15 +18,13 @@ export interface FormsRegisterSignature { } export default class FormsRegister extends Component { - @action - setBirthdate(date: unknown) { + setBirthdate = (date: unknown) => { this.args.changeset.set('birthDate', date as Date); - } + }; - @action - selectCategory(category: unknown) { + selectCategory = (category: unknown) => { this.args.changeset.set('category', category as string); - } + }; ; + } diff --git a/app/components/login-layout.gts b/app/components/login-layout.gts index fc7b7c5..fadc75f 100644 --- a/app/components/login-layout.gts +++ b/app/components/login-layout.gts @@ -1,27 +1,27 @@ -import type { TOC } from "@ember/component/template-only"; +import type { TOC } from '@ember/component/template-only'; export interface LoginLayoutSignature { Args: { - title: string - }, + title: string; + }; Blocks: { - default: [] - }, - Element: HTMLDivElement + default: []; + }; + Element: HTMLDivElement; } const LoginLayout: TOC = +; export default LoginLayout; diff --git a/app/routes/404.ts b/app/routes/404.ts index f8006c3..2ce5d42 100644 --- a/app/routes/404.ts +++ b/app/routes/404.ts @@ -1,3 +1,3 @@ import Route from '@ember/routing/route'; -export default class NotFound extends Route {} +export default class NotFoundRoute extends Route {} diff --git a/app/routes/application.ts b/app/routes/application.ts index ca91278..8acb054 100644 --- a/app/routes/application.ts +++ b/app/routes/application.ts @@ -9,7 +9,7 @@ import type { IntlService } from 'ember-intl'; import type SessionService from 'ember-simple-auth/services/session'; import { setupWorker } from 'msw/browser'; -export default class Application extends Route { +export default class ApplicationRoute extends Route { @service declare session: SessionService; @service declare currentUser: CurrentUserService; @service declare intl: IntlService; diff --git a/app/routes/login.ts b/app/routes/login.ts index 9eafd0d..db5835b 100644 --- a/app/routes/login.ts +++ b/app/routes/login.ts @@ -3,7 +3,7 @@ import { service } from '@ember/service'; import type SessionService from 'ember-simple-auth/services/session'; -export default class Login extends Route { +export default class LoginRoute extends Route { @service declare session: SessionService; beforeModel() { diff --git a/app/routes/register.ts b/app/routes/register.ts index b9ab6e5..a366e77 100644 --- a/app/routes/register.ts +++ b/app/routes/register.ts @@ -1,9 +1,5 @@ import Route from '@ember/routing/route'; -export interface RegisterRouteParams {} - -export type RegisterRouteModel = Resolved>; - export default class RegisterRoute extends Route { model() { return {}; diff --git a/app/services/store.js b/app/services/store.ts similarity index 55% rename from app/services/store.js rename to app/services/store.ts index 97f291e..cd54506 100644 --- a/app/services/store.js +++ b/app/services/store.ts @@ -1,6 +1,7 @@ import Store from 'ember-data/store'; import { service } from '@ember/service'; +import type requestManager from './request-manager'; export default class AppStore extends Store { - @service requestManager; + @service declare requestManager: requestManager; } diff --git a/app/styles/app.css b/app/styles/app.css index 4cbef1a..c4e6d05 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -1,21 +1,10 @@ @import url("tailwindcss/base"); @import url("tailwindcss/components"); @import url("tailwindcss/utilities"); -@import url("flash-messages.css"); @import url("loading.css"); -@import url("input.css"); -@import url("table.css"); -@import url("button.css"); @import url("@eonasdan/tempus-dominus/dist/css/tempus-dominus.css"); @import url("ember-power-select/vendor/ember-power-select.css"); - -/*** GENERAL ****/ -button:focus-visible, -a:focus-visible, -input:focus-visible, -textarea:focus-visible { - @apply outline-none ring-2 ring-primary rounded; -} +@import url("@triptyk/ember-input-validation/dist/app.css"); h1 { @apply text-3xl font-medium; @@ -26,9 +15,13 @@ h2 { } h3 { - @apply text-text text-base; + @apply text-base; } h4 { - @apply text-text text-lg mb-4 font-bold pb-4 border-b border-text/30; + @apply text-lg mb-4 font-bold pb-4 border-b; +} + +.alert-danger { + @apply alert-error; } diff --git a/app/styles/button.css b/app/styles/button.css deleted file mode 100644 index 60d47ff..0000000 --- a/app/styles/button.css +++ /dev/null @@ -1,29 +0,0 @@ -.btn { - @apply relative flex items-center justify-center px-10 py-2 overflow-hidden font-medium text-white uppercase rounded bg-primary transition duration-300; -} - -.btn::before { - content: ""; - - @apply absolute top-0 left-0 block w-full h-full bg-secondary scale-y-0 origin-bottom text-white; - - transition: all 0.5s cubic-bezier(0.2, 2.36, 0.36, 0.34); -} - -.btn:hover::before { - @apply scale-100; -} - -.btn span { - @apply relative z-10; -} - -.btn img { - @apply absolute -left-[50px] w-5 h-5 mb-1; - - transition: all 0.5s cubic-bezier(0.2, 2.36, 0.36, 0.34); -} - -.btn:hover img { - @apply left-[15px]; -} diff --git a/app/styles/flash-messages.css b/app/styles/flash-messages.css deleted file mode 100644 index 612c751..0000000 --- a/app/styles/flash-messages.css +++ /dev/null @@ -1,37 +0,0 @@ -.alert { - @apply flex items-center justify-center w-full mb-2 text-primary rounded-full bg-error; - - opacity: 0; - right: -100px; - height: 50px; - padding: 0 20px; - transition: all 1s cubic-bezier(0.68, -0.55, 0.265, 1.55); -} - -.alert::before { - content: "\00D7"; - width: 50px; - height: 22px; -} - -.alert:hover { - cursor: pointer; -} - -.alert.active { - opacity: 1; - right: 0; -} - -.alert-success { - @apply bg-primary; -} - -.alert-warning { - @apply bg-warn; -} - -.active.exiting { - opacity: 0; - right: -100px; -} diff --git a/app/styles/input.css b/app/styles/input.css deleted file mode 100644 index b1b10be..0000000 --- a/app/styles/input.css +++ /dev/null @@ -1,280 +0,0 @@ -/* stylelint-disable no-descending-specificity */ -/* stylelint-disable selector-class-pattern */ -fieldset { - @apply my-5; -} - -/******* FORM INPUTS ****/ - -.input_block { - @apply relative w-full; -} - -.input_sm { - @apply w-full max-w-[170px]; -} - -.input_xs { - @apply w-full max-w-[85px]; -} - -.input_block input, -.textarea_block textarea { - @apply w-full px-3 py-2 border border-transparent rounded bg-background text-text/70; -} - -.input_block label, -.tpk-input-label, -.tpk-select-label, -.tpk-textarea-label { - @apply relative block mb-1 text-text; -} - -.input_block aside { - @apply absolute z-40 flex invisible mt-2 text-xs; -} - -.disabled input, -.disabled textarea { - @apply border border-dashed cursor-not-allowed bg-background-disabled border-text/30 text-text/60 transition-none outline-none; -} - -/******* DATEPICKER ****/ - -.flatpickr-wrapper { - @apply w-full; -} - -.error-message { - @apply bg-error shrink-0 h-5 w-5 text-white font-bold flex justify-center items-center rounded-full relative top-[5px] cursor-pointer z-50; - - content: "!"; -} - -/******* DATEPICKER ****/ - -/*** SEARCH BAR ****/ - -.search_bar { - @apply relative rounded bg-background; -} - -.search_bar label { - @apply sr-only; -} - -.search_bar input { - @apply p-2 bg-transparent w-full pl-14; -} - -.search_bar button { - @apply absolute left-0 top-2.5 w-5 h-5 ml-3; - - background: url("/assets/icons/search.svg") center left no-repeat; - background-size: cover; -} - -.search_bar button span { - @apply sr-only; -} - -/******* ERROR ****/ - -[data-has-error="true"] aside::before { - @apply error-message; -} - -[data-has-error="true"] input, -[data-has-error="true"] textarea, -[data-has-error="true"] .tpk-select-button { - @apply text-error border-0 ring-2 ring-error; -} - -[data-has-error="true"] aside { - @apply visible text-error absolute min-h-[30px] w-auto flex text-sm z-40; -} - -.input_sm[data-has-error="true"] aside, -.input_xs[data-has-error="true"] aside { - @apply overflow-x-hidden w-[320px] z-50; -} - -[data-has-error="true"] aside span { - @apply flex items-center w-auto px-3 ml-2 bg-red-100 rounded leading-6; - - transition: 0.5s cubic-bezier(0.18, 1.85, 0.16, 0.8); -} - -.input_sm[data-has-error="true"] aside span, -.input_xs[data-has-error="true"] aside span { - @apply flex items-center bg-red-100 leading-6 px-3 rounded ml-2 relative left-[-400px] z-40; -} - -[data-has-error="true"]:hover aside { - z-index: 55; -} - -[data-has-error="true"]:hover aside span { - @apply left-[0]; -} - -/******* Checkbox/radio ****/ - -.checkbox_block, -.radio_block { - @apply flex items-center space-x-2; -} - -label { - @apply cursor-pointer select-none; -} - -.checkbox_block div { - @apply flex items-center gap-3; -} - -.checkbox_block input[type="checkbox"], -.radio_block input { - appearance: none; - - @apply w-5 h-5 cursor-pointer rounded flex items-center justify-center relative outline outline-background outline-2 outline-offset-[-2px] text-background transition duration-500 shrink-0; - - transition: all 0.5s cubic-bezier(0.2, 3, 0.8, 0); - box-shadow: inset 2rem 2rem currentcolor; -} - -.radio_block input { - @apply rounded-full; -} - -.checkbox_block input[type="checkbox"]::before { - content: ""; - - @apply block w-6 h-6 mb-1 ml-1.5 scale-0 absolute; - - background: url("/assets/icons/icon-check.svg"); - transition: all 0.1s linear; -} - -.radio_block input::before { - content: ""; - - @apply block w-2 h-2 rounded-full scale-0 bg-text; - - transition: all 0.1s linear; -} - -.checkbox_block:hover input[type="checkbox"], -.radio_block:hover input { - @apply outline-offset-2 outline-text; -} - -.checkbox_block input[type="checkbox"]:disabled, -.radio_block input[type="radio"]:disabled { - @apply transition-none; -} - -.checkbox_block:hover input[type="checkbox"]:disabled, -.radio_block:hover input[type="radio"]:disabled { - @apply outline-none cursor-not-allowed; -} - -.checkbox_block input[type="checkbox"]:checked, -.radio_block input:checked { - @apply text-text outline-offset-2 outline-text; -} - -.checkbox_block input[type="checkbox"]:checked:disabled, -.radio_block input[type="radio"]:checked:disabled { - @apply cursor-not-allowed text-background-disabled outline-background-disabled; -} - -.checkbox_block input[type="checkbox"]:checked::before, -.radio_block input:checked::before { - @apply scale-100; - - transition: all 0.5s cubic-bezier(0.18, 2.85, 0.16, 0.8); -} - -/******* SelectBox ****/ - -.tpk-select-options-option[data-has-focus="true"] { - @apply bg-secondary/50; -} - -.tpk-select { - @apply relative; -} - -.tpk-select-options { - @apply w-full bg-white z-[60] absolute hidden shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm mt-1.5; -} - -.tpk-select[data-is-open="true"] .tpk-select-options { - @apply block z-[60]; -} - -.tpk-select-options-option[aria-selected="true"] { - @apply bg-secondary; -} - -.tpk-select-options-option { - @apply relative py-2 pl-3 text-gray-900 cursor-pointer select-none pr-9 hover:bg-text/60 focus:outline-none focus-visible:border-secondary; -} - -.tpk-select-button { - @apply bg-background relative w-full flex rounded border text-text/70 border-background shadow-sm pl-3 pr-10 py-2.5 text-left cursor-default focus:outline-none focus:ring-2 ring-secondary focus:border-secondary; -} - -.tpk-select-button::after { - content: "▾"; - - @apply absolute right-[10px]; -} - -.tpk-select[data-is-open="true"] .tpk-select-button::after { - @apply transform -rotate-180 mt-0.5; -} - -.tpk-select-button:disabled, -.disabled .tpk-select-button { - @apply border border-dashed cursor-not-allowed bg-background-disabled border-text/30 text-text/60 ring-0; -} - -.disabled .tpk-select-options { - @apply hidden w-0 h-0 ring-0; -} - -.tpk-select-search-container { - @apply pt-1; -} - -.disabled .tpk-select-button::after { - content: none; -} - -.tpk-select aside { - @apply mt-2; -} - -/******* SelectBox Search ****/ - -.tpk-select-search-input { - @apply text-text/70; -} - -.tpk-select-search { - @apply relative; -} - -.tpk-select-search-options { - @apply w-full bg-white z-[60] hidden absolute shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm mt-1.5; -} - -.tpk-select-search[data-is-open="true"] .tpk-select-search-options { - @apply block; -} - -.tpk-select-search-options-option { - @apply relative py-2 pl-3 text-gray-900 cursor-pointer select-none pr-9 hover:bg-text/60 focus:outline-none focus-visible:border-primary; -} diff --git a/app/styles/table.css b/app/styles/table.css deleted file mode 100644 index 5d68b8c..0000000 --- a/app/styles/table.css +++ /dev/null @@ -1,202 +0,0 @@ -/* stylelint-disable no-descending-specificity */ -/* stylelint-disable selector-class-pattern */ -.tableYeti { - @apply mt-8; -} - -.tableYeti a { - @apply text-primary inline-block; -} - -.tableYeti a::before { - display: none; -} - -.tableYeti thead tr { - @apply border-b-2 bg-background; -} - -.tableYeti th { - @apply py-3 h-12 font-medium border-b-2 border-b-gray-900/30 shrink-0 grow-0; -} - -.tableYeti td { - @apply relative text-center py-4 border-b-[3px] border-white shrink-0 grow-0; -} - -.tableYeti tr { - @apply bg-background; -} - -.tableYeti td:first-child, -.tableYeti th:first-child { - @apply rounded-l-md; -} - -.tableYeti td, -.tableYeti td:last-child, -.tableYeti th:last-child { - @apply rounded-r; -} - -.tableYeti th, -.tableYeti td { - @apply w-[100px] max-w-[150px] px-4 box-content; -} - -.tableYeti td.small, -.tableYeti th.small { - @apply w-[50px] max-w-[50px] grow-0 shrink; -} - -.tableYeti td.selectable, -.tableYeti th.selectable { - @apply w-[50px] max-w-[50px] m-0 p-0; -} - -.tableYeti td.custom-cell, -.tableYeti th.custom-cell { - @apply w-[30px]; -} - -.tableYeti td.big, -.tableYeti th.big { - @apply w-[250px] min-w-[150px] grow whitespace-normal; -} - -.tableYeti .status::before { - content: ""; - - @apply absolute w-2.5 rounded-sm h-full block left-0 top-0; -} - -.tableYeti tfoot tr { - @apply bg-transparent; -} - -.yeti-table-pagination-controls { - @apply w-full flex flex-col justify-center items-center my-8; -} - -.yeti-table-pagination-controls-page-info, -.yeti-table-pagination-controls-page-size { - @apply bg-transparent text-center text-text; -} - -.yeti-table-pagination-controls-page-size select { - @apply border-b-2 border-text/30; -} - -.yeti-table-pagination-buttons button { - @apply cursor-pointer; -} - -.yeti-table-pagination-buttons button img { - filter: invert(13%) sepia(6%) saturate(5813%) hue-rotate(157deg) brightness(100%) contrast(90%); -} - -.yeti-table-pagination-buttons button:hover img { - filter: invert(61%) sepia(99%) saturate(3877%) hue-rotate(167deg) brightness(89%) contrast(96%); -} - -.yeti-table-pagination-buttons button:disabled { - @apply cursor-default; -} - -.yeti-table-pagination-buttons button:disabled img { - filter: invert(70%) sepia(0%) saturate(2309%) hue-rotate(26deg) brightness(92%) contrast(97%); - opacity: 0.5; -} - -.yeti-table-pagination-controls-previous { - @apply mr-12; -} - -.yeti-table-pagination-controls-next { - @apply ml-12; -} - -.actions { - @apply flex justify-center items-center p-0 relative; -} - -.actions ul { - @apply flex flex-col overflow-hidden absolute z-50 bg-white top-[20px] right-[50%] shadow-text/70 shadow-xl rounded transform scale-y-0 items-start origin-top-right transition duration-300 ease-in-out; -} - -.actions li { - @apply w-full relative my-1; -} - -.actions button { - @apply pl-5 pr-12 py-3 flex items-center justify-start transition duration-300 text-text w-full; -} - -.actions ul button img { - @apply mr-3 block; - - transition: all 0.5s cubic-bezier(0.2, 2.36, 0.36, 0.34); -} - -.actions ul button:hover { - @apply bg-background; -} - -.actions button:hover img { - @apply transform rotate-[360deg]; -} - -.actions.aopened ul { - @apply scale-y-100; -} - -.actions .open_actions { - @apply flex justify-center items-center px-4 py-2 w-auto; -} - -.actions .close_actions:hover { - @apply bg-transparent; -} - -.actions .close_actions img { - @apply absolute top-[10px] right-[5px] p-2; -} - -.actions .close_actions:hover img { - @apply rotate-0; -} - -.custom-table td, -.custom-table th { - flex-grow: 1; -} - -.tableYeti th.yeti-table-sortable { - @apply relative; -} - -.tableYeti th.yeti-table-sortable::after { - @apply inline-block text-secondary; - - content: "\25BF"; - margin-left: 5px; -} - -table.yeti-table thead th.yeti-table-sorted-asc::after { - @apply text-secondary; - - content: "\25BE"; - margin-left: 5px; -} - -table.yeti-table thead th.yeti-table-sorted-desc::after { - @apply text-secondary; - - content: "\25BE"; - transform: rotate(180deg); - margin-left: 5px; -} - -table.yeti-table .yeti-table-sortable { - white-space: nowrap; -} diff --git a/app/templates/404.gts b/app/templates/404.gts index f4cb0a4..b8ef24c 100644 --- a/app/templates/404.gts +++ b/app/templates/404.gts @@ -1,35 +1,30 @@ import Component from '@glimmer/component'; import { on } from '@ember/modifier'; -import { action } from '@ember/object'; - import t from 'ember-intl/helpers/t'; import RouteTemplate from 'ember-route-template'; +import type { RouteTemplateSignature } from 'ember-boilerplate/utils/route-template'; +import type NotFoundRoute from 'ember-boilerplate/routes/404'; export interface NotFoundRouteComponentSignature {} -class NotFoundRouteComponent extends Component { - @action - comeback() { +class NotFoundRouteComponent extends Component> { + comeback = () => { window.history.back(); - } + }; } diff --git a/app/templates/application.gts b/app/templates/application.gts index 83a299e..eed6d8e 100644 --- a/app/templates/application.gts +++ b/app/templates/application.gts @@ -7,15 +7,45 @@ import HeadLayout from 'ember-cli-head/components/head-layout'; import RouteTemplate from 'ember-route-template'; import type FlashMessageService from 'ember-cli-flash/services/flash-messages'; +import type { RouteTemplateSignature } from 'ember-boilerplate/utils/route-template'; +import type ApplicationRoute from 'ember-boilerplate/routes/application'; -class ApplicationRouteComponent extends Component { +class ApplicationRouteComponent extends Component> { @service declare flashMessages: FlashMessageService; + flashTypes = (type: 'Success' | 'Warning' | 'Danger') => { + if (type === 'Warning') { + return 'alert-warning'; + } + + if (type === 'Danger') { + return 'alert-danger'; + } + + return 'alert-success'; + }; +