solve conflicts

This commit is contained in:
2024-10-12 06:40:18 +02:00
7 changed files with 40 additions and 18 deletions

View File

@@ -149,6 +149,8 @@ GEM
net-smtp (0.5.0) net-smtp (0.5.0)
net-protocol net-protocol
nio4r (2.7.3) nio4r (2.7.3)
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux) nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4) racc (~> 1.4)
psych (5.1.2) psych (5.1.2)
@@ -219,11 +221,14 @@ GEM
actionpack (>= 5.2) actionpack (>= 5.2)
activesupport (>= 5.2) activesupport (>= 5.2)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x86_64-linux) sqlite3 (1.7.3-x86_64-linux)
stimulus-rails (1.3.3) stimulus-rails (1.3.3)
railties (>= 6.0.0) railties (>= 6.0.0)
stringio (3.1.0) stringio (3.1.0)
strscan (3.1.0) strscan (3.1.0)
tailwindcss-rails (2.6.0-arm64-darwin)
railties (>= 7.0.0)
tailwindcss-rails (2.6.0-x86_64-linux) tailwindcss-rails (2.6.0-x86_64-linux)
railties (>= 7.0.0) railties (>= 7.0.0)
thor (1.3.1) thor (1.3.1)
@@ -249,6 +254,7 @@ GEM
zeitwerk (2.6.14) zeitwerk (2.6.14)
PLATFORMS PLATFORMS
arm64-darwin-23
x86_64-linux x86_64-linux
DEPENDENCIES DEPENDENCIES

View File

@@ -10,15 +10,4 @@
} }
} }
*/ */
body {
height: 100vw;
overflow: hidden;
}
toastui-calendar-time {
height: 100% !important;
}
.toastui-calendar-timegrid { height: 100%; }
.toastui-calendar-panel.toastui-calendar-time { overflow-y: inherit; }

View File

@@ -0,0 +1,24 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
/*
@layer components {
.btn-primary {
@apply py-2 px-4 bg-blue-200;
}
}
*/
body.calendar {
height: 99vw;
overflow: hidden;
}
toastui-calendar-time {
height: 99% !important;
}
.toastui-calendar-timegrid { height: 99%; }
.toastui-calendar-panel.toastui-calendar-time { overflow-y: inherit; }

View File

@@ -5,7 +5,6 @@ class ReservationsController < ApplicationController
layout :determine_layout layout :determine_layout
# GET /reservations or /reservations.json # GET /reservations or /reservations.json
def index def index
@reservations = Reservation.all.includes(:team, :customer).where(company: @company) @reservations = Reservation.all.includes(:team, :customer).where(company: @company)
@reservations = ActiveModelSerializers::SerializableResource.new(@reservations).as_json @reservations = ActiveModelSerializers::SerializableResource.new(@reservations).as_json
end end

View File

@@ -27,7 +27,7 @@ export default class extends Controller {
], ],
}); });
this.calendar = calendar; window.calendar = calendar;
this.getCalendardata(); this.getCalendardata();
calendar.render(); calendar.render();
} }
@@ -36,11 +36,11 @@ export default class extends Controller {
var reservations = JSON.parse(document.querySelector("#main-calendar").dataset.reservations); var reservations = JSON.parse(document.querySelector("#main-calendar").dataset.reservations);
window.reservations = reservations; window.reservations = reservations;
reservations.forEach(reservation => { reservations.forEach(reservation => {
this.calendar.createSchedules([ window.calendar.createEvents([
{ {
id: reservation.id, id: reservation.id,
calendarId: 'cal1', calendarId: 'cal1',
title: reservation.customer, title: reservation.customer.name,
category: 'time', category: 'time',
dueDateClass: reservation.dueDateClass, dueDateClass: reservation.dueDateClass,
location: reservation.team.name, location: reservation.team.name,

View File

@@ -7,3 +7,7 @@ class Reservation < ApplicationRecord
validates :customer_id, presence: true validates :customer_id, presence: true
validates :team_id, presence: true validates :team_id, presence: true
end end
class ReservationSerializer < ActiveModel::Serializer
attributes :id, :company, :customer, :team, :start_time, :end_time
end

View File

@@ -8,12 +8,12 @@
<link rel="stylesheet" href="https://uicdn.toast.com/calendar/latest/toastui-calendar.min.css" /> <link rel="stylesheet" href="https://uicdn.toast.com/calendar/latest/toastui-calendar.min.css" />
<script src="https://uicdn.toast.com/calendar/latest/toastui-calendar.min.js"></script> <script src="https://uicdn.toast.com/calendar/latest/toastui-calendar.min.js"></script>
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> <%= stylesheet_link_tag "calendar.tailwind", "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %> <%= javascript_importmap_tags %>
</head> </head>
<body> <body class="calendar">
<main style="height: 100vw;"> <main style="height: 100vw;">
<%= yield %> <%= yield %>
</main> </main>