diff --git a/index.html b/index.html
index 289f255..6057ddd 100644
--- a/index.html
+++ b/index.html
@@ -2874,24 +2874,6 @@
diff --git a/js/modules/shiftRequest.js b/js/modules/shiftRequest.js
index cc8ba7c..ad10c14 100644
--- a/js/modules/shiftRequest.js
+++ b/js/modules/shiftRequest.js
@@ -170,196 +170,6 @@ function displayCapacityWithCountsOnCalendar(capacityData, shiftCounts = {}) {
});
}
-/**
- * シフト申請モーダルを開く(旧UI用)
- * @param {string} dateKey - 日付キー(YYYY-MM-DD形式)
- */
-function openShiftRequestModal(dateKey) {
- const modal = document.getElementById('shiftRequestModal');
- const modalTitle = document.getElementById('modalTitle');
- const timeSlotContainer = document.getElementById('timeSlotContainer');
-
- // タイトルを設定
- const dateFormatted = new Date(dateKey).toLocaleDateString('ja-JP', {
- year: 'numeric',
- month: 'long',
- day: 'numeric',
- weekday: 'short'
- });
- modalTitle.textContent = `${dateFormatted} のシフト申請`;
-
- // 時間枠を生成
- generateTimeSlots(timeSlotContainer);
-
- // 時間枠の残り枠数を更新
- updateTimeSlotCapacity(dateKey);
-
- // モーダルを表示
- modal.style.display = 'flex';
-}
-
-/**
- * 時間枠の残り容量を更新する関数(旧UI用)
- * @param {string} dateKey - 日付キー(YYYY-MM-DD形式)
- */
-function updateTimeSlotCapacity(dateKey) {
- // 13:00から18:00まで、30分単位で時間枠を生成
- const startHour = 13;
- const endHour = 18;
- const slots = [];
-
- for (let hour = startHour; hour < endHour; hour++) {
- slots.push(`${hour}:00-${hour}:30`);
- slots.push(`${hour}:30-${hour + 1}:00`);
- }
-
- const currentShiftCounts = getCurrentShiftCounts();
-
- slots.forEach(slot => {
- const capacityElement = document.getElementById(`capacity-${slot.replace(/[:\s-]/g, '')}`);
- const checkboxElement = document.getElementById(`slot-${slot.replace(/[:\s-]/g, '')}`);
-
- if (capacityElement && checkboxElement) {
- // その日付・時間枠の現在の申請数を取得
- const currentCount = (currentShiftCounts[dateKey] && currentShiftCounts[dateKey][slot]) || 0;
- const maxCapacity = 1; // 30分枠は1人まで
- const remainingCount = Math.max(0, maxCapacity - currentCount);
-
- // 表示を更新
- capacityElement.textContent = `(${remainingCount}/${maxCapacity}人)`;
-
- // 満員の場合はチェックボックスを無効化
- if (remainingCount === 0) {
- checkboxElement.disabled = true;
- capacityElement.style.color = '#dc3545'; // 赤色
- checkboxElement.parentElement.style.opacity = '0.6';
- } else if (remainingCount === 1) {
- checkboxElement.disabled = false;
- capacityElement.style.color = '#ffc107'; // 黄色
- checkboxElement.parentElement.style.opacity = '1';
- } else {
- checkboxElement.disabled = false;
- capacityElement.style.color = '#28a745'; // 緑色
- checkboxElement.parentElement.style.opacity = '1';
- }
- }
- });
-}
-
-/**
- * 時間枠のチェックボックスを生成する関数(旧UI用)
- * @param {HTMLElement} container - コンテナ要素
- */
-function generateTimeSlots(container) {
- container.innerHTML = '';
-
- // 13:00から18:00まで、30分単位で時間枠を生成
- const startHour = 13;
- const endHour = 18;
- const slots = [];
-
- for (let hour = startHour; hour < endHour; hour++) {
- slots.push(`${hour}:00-${hour}:30`);
- slots.push(`${hour}:30-${hour + 1}:00`);
- }
-
- // 時間枠のチェックボックスを生成
- slots.forEach(slot => {
- const slotDiv = document.createElement('div');
- slotDiv.className = 'time-slot';
-
- const checkbox = document.createElement('input');
- checkbox.type = 'checkbox';
- checkbox.id = `slot-${slot.replace(/[:\s-]/g, '')}`;
- checkbox.value = slot;
- checkbox.className = 'time-slot-checkbox';
-
- const labelContainer = document.createElement('div');
- labelContainer.className = 'time-slot-label-container';
-
- const label = document.createElement('label');
- label.htmlFor = checkbox.id;
- label.textContent = slot;
- label.className = 'time-slot-label';
-
- const capacityInfo = document.createElement('span');
- capacityInfo.className = 'time-slot-capacity';
- capacityInfo.id = `capacity-${slot.replace(/[:\s-]/g, '')}`;
- capacityInfo.textContent = '(0/1人)'; // デフォルト値
-
- labelContainer.appendChild(label);
- labelContainer.appendChild(capacityInfo);
-
- slotDiv.appendChild(checkbox);
- slotDiv.appendChild(labelContainer);
- container.appendChild(slotDiv);
- });
-}
-
-/**
- * シフト申請モーダルを閉じる関数(旧UI用)
- */
-function closeShiftRequestModal() {
- const modal = document.getElementById('shiftRequestModal');
- modal.style.display = 'none';
-
- // 選択をクリア
- const checkboxes = document.querySelectorAll('.time-slot-checkbox');
- checkboxes.forEach(cb => cb.checked = false);
-
- // 備考欄をクリア
- document.getElementById('shiftRemarks').value = '';
-}
-
-/**
- * シフト申請を送信する関数(旧UI用)
- */
-async function submitShiftRequest() {
- const selectedSlots = [];
- const checkboxes = document.querySelectorAll('.time-slot-checkbox:checked');
-
- checkboxes.forEach(cb => {
- selectedSlots.push(cb.value);
- });
-
- if (selectedSlots.length === 0) {
- alert('時間枠を選択してください。');
- return;
- }
-
- const remarks = document.getElementById('shiftRemarks').value.trim();
- const currentUser = getCurrentUser();
- const currentShiftRequestDate = getCurrentShiftRequestDate();
-
- // ボタンを無効化
- const submitBtn = document.querySelector('#shiftRequestModal .submit-btn');
- submitBtn.disabled = true;
- submitBtn.textContent = '申請中...';
-
- try {
- // 複数時間枠の一括申請
- const response = await API.createMultipleShifts({
- user_id: currentUser.sub,
- user_name: currentUser.name,
- date: currentShiftRequestDate,
- time_slots: selectedSlots
- });
-
- if (!response.success) {
- throw new Error(response.error || 'シフト申請に失敗しました');
- }
-
- closeShiftRequestModal();
-
- } catch (error) {
- console.error('シフト申請の保存に失敗しました:', error);
- alert('シフト申請の保存に失敗しました。再度お試しください。');
- } finally {
- submitBtn.disabled = false;
- submitBtn.textContent = '申請する';
- }
-}
-
/**
* 日付詳細モーダルを開く関数
* @param {string} dateKey - 日付キー(YYYY-MM-DD形式)
diff --git a/js/modules/state.js b/js/modules/state.js
index 28880b6..7cacb82 100644
--- a/js/modules/state.js
+++ b/js/modules/state.js
@@ -12,7 +12,6 @@ const AppState = {
scrollToShiftAfterLoad: null,
// シフト申請関連
- currentShiftRequestDate: null,
currentShiftCapacity: 0,
currentShiftCounts: {},
@@ -70,14 +69,6 @@ function setScrollToShiftAfterLoad(scrollInfo) {
AppState.scrollToShiftAfterLoad = scrollInfo;
}
-function getCurrentShiftRequestDate() {
- return AppState.currentShiftRequestDate;
-}
-
-function setCurrentShiftRequestDate(date) {
- AppState.currentShiftRequestDate = date;
-}
-
function getCurrentShiftCapacity() {
return AppState.currentShiftCapacity;
}
@@ -142,7 +133,6 @@ function resetState() {
AppState.isAdminUser = false;
AppState.currentUserShifts = [];
AppState.scrollToShiftAfterLoad = null;
- AppState.currentShiftRequestDate = null;
AppState.currentShiftCapacity = 0;
AppState.currentShiftCounts = {};
AppState.currentDetailDateKey = null;
diff --git a/test/setup.js b/test/setup.js
index de706c6..931fd0f 100644
--- a/test/setup.js
+++ b/test/setup.js
@@ -20,7 +20,6 @@ global.currentUser = {
// Mock global variables
global.isAdminUser = false;
global.currentShiftCounts = {};
-global.currentShiftRequestDate = null;
global.currentDetailDateKey = null;
global.selectedTimeSlots = [];