Final auto-save before shutdown
Auto-saved at 2025-07-29 14:54:35 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -102,13 +102,13 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
|
||||
"Pohotovost IT"
|
||||
]
|
||||
|
||||
// Add separator column and "Práce mimo směnu" column
|
||||
titleRow.push("", "") // Empty separator + empty for merged cell
|
||||
dayNameRow.push("", "Práce mimo směnu") // Empty separator + the text
|
||||
yearRow.push("", "") // Empty separator + empty for merged cell
|
||||
monthRow.push("", "") // Empty separator + empty for merged cell
|
||||
dateRow.push("", "") // Empty separator + empty for merged cell
|
||||
shiftRow.push("", "") // Empty separator + empty for merged cell
|
||||
// Add one more column to the right
|
||||
titleRow.push("")
|
||||
dayNameRow.push("")
|
||||
yearRow.push("")
|
||||
monthRow.push("")
|
||||
dateRow.push("")
|
||||
shiftRow.push("")
|
||||
|
||||
const employeeRows = employees.map(name => {
|
||||
const row = [name]
|
||||
@@ -263,7 +263,7 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
|
||||
}
|
||||
|
||||
// Style weekend days (Saturday/Sunday in day name row and date rows below)
|
||||
for (let col = 1; col < (data[0]?.length || 0) - 2; col += 2) { // -2 to exclude separator and Práce mimo směnu columns
|
||||
for (let col = 1; col < (data[0]?.length || 0); col += 2) {
|
||||
const dayName = data[1]?.[col]
|
||||
if (dayName === "Sobota" || dayName === "Neděle") {
|
||||
const colLetter = getExcelColumnName(col)
|
||||
@@ -281,27 +281,9 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
|
||||
}
|
||||
}
|
||||
|
||||
// Style the "Práce mimo směnu" column (last column)
|
||||
const totalCols = data[0]?.length || 0
|
||||
if (totalCols >= 2) {
|
||||
const separatorColIndex = totalCols - 2
|
||||
const praceMimoColIndex = totalCols - 1
|
||||
const separatorColLetter = getExcelColumnName(separatorColIndex)
|
||||
const praceMimoColLetter = getExcelColumnName(praceMimoColIndex)
|
||||
|
||||
// Style separator column with left border
|
||||
for (let row = 2; row <= 6; row++) {
|
||||
styles[`${separatorColLetter}${row}`] = "border-left: 2px solid #000000;"
|
||||
}
|
||||
|
||||
// Style "Práce mimo směnu" column
|
||||
styles[`${praceMimoColLetter}2`] = "border: 1px solid #000000; text-align: center; vertical-align: middle; font-weight: bold; height: 50px;"
|
||||
for (let row = 3; row <= 6; row++) {
|
||||
styles[`${praceMimoColLetter}${row}`] = "border-left: 1px solid #000000; border-right: 1px solid #000000;"
|
||||
}
|
||||
// Bottom border for the last row of the merged cell
|
||||
styles[`${praceMimoColLetter}6`] += " border-bottom: 1px solid #000000;"
|
||||
}
|
||||
// Remove formatting specifically from BZ6 and CA6 cells
|
||||
styles["BZ6"] = "" // Override any formatting for BZ6
|
||||
styles["CA6"] = "" // Override any formatting for CA6
|
||||
}
|
||||
|
||||
console.log("Initializing jspreadsheet with config:", {
|
||||
@@ -334,10 +316,10 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
|
||||
const instance = jspreadsheetInstance.current as any
|
||||
if (instance.setMerge) {
|
||||
try {
|
||||
// Merge all pairs in rows 2, 3, 4, 5 (day names, year, month, day) excluding separator and Práce mimo směnu columns
|
||||
// Merge all pairs in rows 1, 2, 3, 4, 5 (title, day names, year, month, day)
|
||||
const totalCols = data[0]?.length || 0
|
||||
for (let row = 2; row <= 5; row++) {
|
||||
for (let col = 1; col < totalCols - 2; col += 2) { // -2 to exclude separator and Práce mimo směnu columns
|
||||
for (let row = 1; row <= 5; row++) {
|
||||
for (let col = 1; col < totalCols; col += 2) {
|
||||
const colLetter = getExcelColumnName(col)
|
||||
try {
|
||||
// Correct syntax: setMerge(cellAddress, colspan, rowspan)
|
||||
@@ -347,15 +329,6 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Merge "Práce mimo směnu" column vertically from rows 2-6
|
||||
const praceMimoColIndex = totalCols - 1
|
||||
const praceMimoColLetter = getExcelColumnName(praceMimoColIndex)
|
||||
try {
|
||||
instance.setMerge(`${praceMimoColLetter}2`, 1, 5) // 1 column, 5 rows (2-6)
|
||||
} catch (error) {
|
||||
console.error("Error merging Práce mimo směnu column:", error)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error during merging:", error)
|
||||
}
|
||||
@@ -375,17 +348,12 @@ export function TimeshiftSpreadsheet({ teamId, teamName }: TimeshiftSpreadsheetP
|
||||
if (rows[rowIndex]) {
|
||||
const cells = rows[rowIndex].querySelectorAll('td')
|
||||
cells.forEach((cell, cellIndex) => {
|
||||
// Skip first two columns (row numbers and field labels), separator column, but include Práce mimo směnu
|
||||
// Skip first two columns (row numbers and field labels)
|
||||
if (cellIndex > 1 && cellIndex < totalCells + 1) { // +1 because of row number column
|
||||
const originalText = cell.textContent?.trim()
|
||||
if (originalText) {
|
||||
// Special handling for "Práce mimo směnu" text
|
||||
if (originalText === "Práce mimo směnu") {
|
||||
cell.innerHTML = `<div style="transform: rotate(-90deg); font-size: 12px; height: 80px; display: flex; align-items: center; justify-content: center; white-space: nowrap; font-weight: bold;">${originalText}</div>`
|
||||
} else if (cellIndex < totalCells - 1) { // Don't rotate separator column (empty)
|
||||
// Use 12px font for all other rotated values (date values, day names, and shifts)
|
||||
cell.innerHTML = `<div style="transform: rotate(-90deg); font-size: 12px; height: 20px; display: flex; align-items: center; justify-content: center; white-space: nowrap;">${originalText}</div>`
|
||||
}
|
||||
// Use 12px font for all rotated values (date values, day names, and shifts)
|
||||
cell.innerHTML = `<div style="transform: rotate(-90deg); font-size: 12px; height: 20px; display: flex; align-items: center; justify-content: center; white-space: nowrap;">${originalText}</div>`
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user