Project

General

Profile

Feature #44567 » 0002-Organize-Gantt-chart-DOM-structure-and-semantics.patch

Katsuya HIDAKA, 2026-10-01 10:10

View differences:

app/assets/stylesheets/context_menu.css
.context-menu-selection a, .context-menu-selection a:hover { color:var(--oc-gray-0) !important; }
.context-menu-selection:hover { background-color:var(--oc-blue-7) !important; color:var(--oc-gray-0) !important; }
.context-menu-selection svg.icon-svg { stroke: var(--oc-white) !important; }
div#gantt_area .context-menu-selection { background-color: rgba(var(--oc-blue-7-rgb), 0.4) !important; }
div#gantt_area .context-menu-selection:hover { background-color: rgba(var(--oc-blue-7-rgb), 0.4) !important; }
div#gantt_area .context-menu-selection a { color: var(--oc-blue-9) !important; }
.gantt-timeline .context-menu-selection { background-color: rgba(var(--oc-blue-7-rgb), 0.4) !important; }
.gantt-timeline .context-menu-selection:hover { background-color: rgba(var(--oc-blue-7-rgb), 0.4) !important; }
.gantt-timeline .context-menu-selection a { color: var(--oc-blue-9) !important; }
app/assets/stylesheets/gantt.css
* This code is released under the GNU General Public License.
*/
.gantt_subjects div > span.expander {
[data-gantt-column="subjects"] .gantt-row > span.expander {
margin-inline-start: 0;
cursor: pointer;
}
.gantt_subjects .avatar {
[data-gantt-column="subjects"] .avatar {
margin-inline-end: 4px;
}
.gantt_subjects div.project-name a,
.gantt_subjects div.version-name a {
[data-gantt-column="subjects"] .gantt-row:is([data-gantt-row-type="project"], [data-gantt-row-type="version"]) a {
margin-inline-start: 4px;
}
......
display: none !important;
}
.gantt_subjects_column,
.gantt_selected_column {
.gantt-column {
position: relative;
flex: 0 0 var(--gantt-column-width);
inline-size: var(--gantt-column-width);
......
overflow: hidden;
}
.gantt_subjects_container {
[data-gantt-column="subjects"] .gantt-pane {
border-inline-start: 1px solid var(--oc-gray-4);
}
.gantt-pane-header {
.gantt-pane > header {
position: relative;
z-index: 2;
display: flex;
......
overflow: hidden;
}
.gantt-selected-column-header {
.gantt-selected-column .gantt-pane > header {
padding-inline: 3px;
text-overflow: ellipsis;
white-space: nowrap;
......
.gantt-pane-body {
position: relative;
block-size: var(--gantt-content-height);
font-size: 0.8em;
}
.gantt-timeline {
......
box-sizing: border-box;
}
.gantt-timeline-header {
.gantt-timeline-canvas > header {
position: relative;
z-index: 1;
block-size: var(--gantt-headers-height);
......
pointer-events: auto;
}
.gantt-period-day,
.gantt-period-day-number {
.gantt-header-row:is([data-gantt-period="day"], [data-gantt-period="day-number"]) .gantt-period {
font-size: 0.7em;
}
......
block-size: var(--gantt-content-height);
}
.gantt_subjects,
.gantt_selected_column_content {
position: relative;
block-size: 100%;
font-size: 0.8em;
}
.gantt_subjects form,
.gantt_selected_column_content,
.gantt-pane-body form,
.gantt-timeline-body form {
position: relative;
display: block;
......
box-sizing: border-box;
}
.gantt-subject-row {
[data-gantt-column="subjects"] .gantt-row {
inset-inline-start: var(--gantt-row-indent);
inline-size: var(--gantt-row-width);
inline-size: calc(100% - var(--gantt-row-indent));
line-height: 16px;
overflow: hidden;
white-space: nowrap;
}
.gantt-column-row {
.gantt-selected-column .gantt-row {
inset-inline-start: 0;
inline-size: 100%;
padding-inline-start: 3px;
......
white-space: nowrap;
}
.gantt_subjects div.issue-subject:hover {
[data-gantt-column="subjects"] .gantt-row[data-gantt-row-type="issue"]:hover {
background-color: var(--oc-yellow-0);
}
.gantt-timeline-row {
.gantt-timeline-body .gantt-row {
inset-inline-start: 0;
inline-size: var(--gantt-chart-width);
}
#today_line {
.gantt-today {
position: absolute;
inset-block-start: 1px;
inset-inline-start: var(--gantt-today-start);
......
pointer-events: none;
}
#gantt_draw_area {
.gantt-relations {
position: absolute;
inset-block-start: 1px;
inset-inline-start: 0;
......
pointer-events: none;
}
.gantt_watcher_users_column div.issue_watcher_users ul {
[data-gantt-column="watcher_users"] div.issue_watcher_users ul {
margin: 0;
padding: 0;
list-style: none;
}
.gantt_watcher_users_column div.issue_watcher_users ul li {
[data-gantt-column="watcher_users"] div.issue_watcher_users ul li {
display: inline;
}
.gantt_watcher_users_column div.issue_watcher_users ul li:not(:last-child)::after {
[data-gantt-column="watcher_users"] div.issue_watcher_users ul li:not(:last-child)::after {
content: ', ';
white-space: pre;
}
.task {
.gantt-task {
position: absolute;
inset-block-start: var(--gantt-row-top);
inset-block-start: 0;
inset-inline-start: var(--gantt-task-start);
inline-size: var(--gantt-task-width);
block-size: 8px;
......
.gantt-timeline-body .tooltip {
position: absolute;
inset-block-start: var(--gantt-row-top);
inset-block-start: 0;
inset-inline-start: var(--gantt-task-start);
inline-size: var(--gantt-task-width);
block-size: 12px;
}
.gantt-row > :is(.task, .tooltip) {
inset-block-start: 0;
}
.gantt-chart .toggle-selection {
display: none;
}
.task.label {
.gantt-task-label {
inline-size: var(--gantt-task-width);
}
.task.label.project,
.task.label.version {
.gantt-row:is([data-gantt-row-type="project"], [data-gantt-row-type="version"]) .gantt-task-label {
font-weight: bold;
}
.task_late {
.gantt-task-late {
background: var(--oc-red-5) url(/task_late.png);
border: 1px solid var(--oc-red-5);
}
.task_done {
.gantt-task-done {
background: var(--oc-green-7) url(/task_done.png);
border: 1px solid var(--oc-green-7);
}
.task_todo {
.gantt-task-todo {
background: var(--oc-gray-5) url(/task_todo.png);
border: 1px solid var(--oc-gray-5);
}
.task_todo.parent {
.gantt-task-todo.gantt-task-parent {
background: var(--oc-gray-6);
border: 1px solid var(--oc-gray-6);
block-size: 3px;
}
.task_late.parent,
.task_done.parent {
.gantt-task-late.gantt-task-parent,
.gantt-task-done.gantt-task-parent {
block-size: 3px;
}
.task.parent.marker.starting,
.task.parent.marker.ending {
.gantt-task.gantt-task-parent.gantt-task-marker {
position: absolute;
background: url(/task_parent_end.png) no-repeat 0 0;
inline-size: 8px;
......
margin-inline-start: -4px;
}
.version.task_late {
.gantt-row[data-gantt-row-type="version"] .gantt-task-late {
background: var(--oc-red-5) url(/milestone_late.png);
border: 1px solid var(--oc-red-5);
block-size: 2px;
margin-block-start: 3px;
}
.version.task_done {
.gantt-row[data-gantt-row-type="version"] .gantt-task-done {
background: var(--oc-green-7) url(/milestone_done.png);
border: 1px solid var(--oc-green-7);
block-size: 2px;
margin-block-start: 3px;
}
.version.task_todo {
.gantt-row[data-gantt-row-type="version"] .gantt-task-todo {
background: var(--oc-white) url(/milestone_todo.png);
border: 1px solid var(--oc-white);
block-size: 2px;
margin-block-start: 3px;
}
.version.marker {
.gantt-row[data-gantt-row-type="version"] .gantt-task-marker {
background-image: url(/version_marker.png);
background-repeat: no-repeat;
border: 0;
......
margin-block-start: 1px;
}
.project.task_late {
.gantt-row[data-gantt-row-type="project"] .gantt-task-late {
background: var(--oc-red-5) url(/milestone_late.png);
border: 1px solid var(--oc-red-5);
block-size: 2px;
margin-block-start: 3px;
}
.project.task_done {
.gantt-row[data-gantt-row-type="project"] .gantt-task-done {
background: var(--oc-green-7) url(/milestone_done.png);
border: 1px solid var(--oc-green-7);
block-size: 2px;
margin-block-start: 3px;
}
.project.task_todo {
.gantt-row[data-gantt-row-type="project"] .gantt-task-todo {
background: var(--oc-white) url(/milestone_todo.png);
border: 1px solid var(--oc-white);
block-size: 2px;
margin-block-start: 3px;
}
.project.marker {
.gantt-row[data-gantt-row-type="project"] .gantt-task-marker {
background-image: url(/project_marker.png);
background-repeat: no-repeat;
border: 0;
......
}
/* RTL adjustment (disabled while Gantt is forced LTR). Enable when RTL is supported.
[dir="rtl"] :is(.marker, .task.parent.marker) {
[dir="rtl"] .gantt-task-marker {
background-position: right;
}
*/
app/assets/stylesheets/responsive.css
}
/* Gantt charts */
.gantt_subjects_column {
.gantt-column[data-gantt-column="subjects"] {
--gantt-column-width: 60% !important;
}
.gantt_subjects_container {
[data-gantt-column="subjects"] .gantt-pane {
inline-size: 100% !important;
overflow: hidden;
}
app/helpers/gantt_helper.rb
end
def gantt_column_tag(column_name, min_width: nil, **options, &)
options[:data] = {
options[:data] = options.fetch(:data, {}).merge(
controller: 'gantt--column',
action: 'resize@window->gantt--column#handleWindowResize',
'gantt--column-min-width-value': min_width,
'gantt--column-column-value': column_name
}
options[:class] = ["gantt_#{column_name}_column", options[:class]]
'gantt-column': column_name
)
options[:class] = ['gantt-column', options[:class]]
options[:style] = gantt_css_variables('gantt-column-width': options.delete(:width)) if options[:width]
tag.div(**options, &)
end
def gantt_subjects_tag(&)
data_attributes = {
controller: 'gantt--subjects',
action: 'gantt--column:resize-column-subjects@document->gantt--subjects#handleResizeColumn'
}
tag.div(class: "gantt_subjects", data: data_attributes, &)
end
end
app/javascript/controllers/gantt/chart_controller.js
const SVG_NS = "http://www.w3.org/2000/svg"
export default class extends Controller {
static targets = ["ganttArea", "drawArea", "subjectsContainer"]
static targets = ["relations", "selectedColumn", "today"]
static values = {
issueRelationTypes: Object,
......
}
#setupDrawPaper() {
const width = Math.ceil(this.$(this.drawAreaTarget).width() || 0)
const height = Math.ceil(this.$(this.drawAreaTarget).height() || 0)
const width = Math.ceil(this.$(this.relationsTarget).width() || 0)
const height = Math.ceil(this.$(this.relationsTarget).height() || 0)
if (!this.#drawPaper) {
this.#drawPaper = document.createElementNS(SVG_NS, "svg")
......
this.#drawPaperGroup = document.createElementNS(SVG_NS, "g")
this.#drawPaper.appendChild(this.#drawPaperGroup)
this.drawAreaTarget.appendChild(this.#drawPaper)
this.relationsTarget.appendChild(this.#drawPaper)
}
const safeWidth = Math.max(width, 1)
......
}
#setupDrawArea() {
const $drawArea = this.$(this.drawAreaTarget)
const $drawArea = this.$(this.relationsTarget)
this.#drawTop = $drawArea.position().top
this.#drawRight = $drawArea.width()
}
#drawSelectedColumns() {
const selectedColumns = this.element.querySelectorAll(".gantt_selected_column")
const $subjectsContainer = this.$(".gantt_subjects_container")
const isMobileDevice = typeof window.isMobile === "function" && window.isMobile()
if (this.showSelectedColumnsValue) {
if (isMobileDevice) {
selectedColumns.forEach((element) => { element.hidden = true })
this.selectedColumnTargets.forEach((element) => { element.hidden = true })
} else {
$subjectsContainer.addClass("draw_selected_columns")
selectedColumns.forEach((element) => { element.hidden = false })
this.selectedColumnTargets.forEach((element) => { element.hidden = false })
}
} else {
selectedColumns.forEach((element) => { element.hidden = true })
$subjectsContainer.removeClass("draw_selected_columns")
this.selectedColumnTargets.forEach((element) => { element.hidden = true })
}
}
get #relationsArray() {
const relations = []
this.$("div.task_todo[data-rels]").each((_, element) => {
this.$(".gantt-task-todo[data-gantt-relations]").each((_, element) => {
const $element = this.$(element)
if (!$element.is(":visible")) return
const elementId = $element.attr("id")
if (!elementId) return
const issueId = elementId.replace("task-todo-issue-", "")
const dataRels = $element.data("rels") || {}
const issueId = element.dataset.ganttIssueId
const dataRels = JSON.parse(element.dataset.ganttRelations || "{}")
Object.keys(dataRels).forEach((relTypeKey) => {
this.$.each(dataRels[relTypeKey], (_, relatedIssue) => {
......
const relations = this.#relationsArray
relations.forEach((relation) => {
const issueFrom = this.$(`#task-todo-issue-${relation.issue_from}`)
const issueTo = this.$(`#task-todo-issue-${relation.issue_to}`)
const issueFrom = this.$(`.gantt-task-todo[data-gantt-issue-id='${relation.issue_from}']`)
const issueTo = this.$(`.gantt-task-todo[data-gantt-issue-id='${relation.issue_to}']`)
if (issueFrom.length === 0 || issueTo.length === 0) return
if (!issueTo.is(":visible")) return
......
get #progressLinesArray() {
const lines = []
const todayLeft = this.$("#today_line").position().left
const todayLeft = this.$(this.todayTarget).position().left
lines.push({ left: todayLeft, top: 0 })
this.$("div.issue-subject, div.version-name").each((_, element) => {
this.$("[data-gantt-column='subjects'] .gantt-row[data-gantt-row-type='issue'], [data-gantt-column='subjects'] .gantt-row[data-gantt-row-type='version']").each((_, element) => {
const $element = this.$(element)
if (!$element.is(":visible")) return true
......
if (issueClosed || versionClosed) {
lines.push({ left: todayLeft, top: elementTopCenter })
} else {
const issueDone = this.$(`#task-done-${$element.attr("id")}`)
const rowKey = element.dataset.ganttRowKey
const issueDone = this.$(`.gantt-row[data-gantt-row-key='${rowKey}'] .gantt-task-done`)
const isBehindStart = $element.children("span").hasClass("behind-start-date")
const isOverEnd = $element.children("span").hasClass("over-end-date")
......
})
} else {
let todoLeft = todayLeft
const issueTodo = this.$(`#task-todo-${$element.attr("id")}`)
const issueTodo = this.$(`.gantt-row[data-gantt-row-key='${rowKey}'] .gantt-task-todo`)
if (issueTodo.length > 0) {
todoLeft = issueTodo.first().position().left
}
......
}
#drawGanttProgressLines() {
if (this.$("#today_line").length === 0) return
if (!this.hasTodayTarget) return
const progressLines = this.#progressLinesArray
const color = this.$("#today_line").css("border-inline-start-color") || "#ff0000"
const color = this.$(this.todayTarget).css("border-inline-start-color") || "#ff0000"
for (let index = 1; index < progressLines.length; index += 1) {
const current = progressLines[index]
app/javascript/controllers/gantt/column_controller.js
export default class extends Controller {
static values = {
minWidth: Number,
column: String,
// Local value
mobileMode: { type: Boolean, default: false }
}
......
connect() {
this.#$element = this.$(this.element)
this.#setupResizable()
this.#dispatchResizeColumn()
}
disconnect() {
......
handleWindowResize(_event) {
this.mobileModeValue = this.#isMobile()
this.#dispatchResizeColumn()
}
mobileModeValueChanged(current, old) {
......
}
}
this.#$element
.resizable(options)
.on("resize", (event) => {
event.stopPropagation()
this.#dispatchResizeColumn()
})
}
#dispatchResizeColumn() {
if (!this.#$element) return
this.dispatch(`resize-column-${this.columnValue}`, { detail: { width: this.#$element.width() } })
this.#$element.resizable(options)
}
#isMobile() {
app/javascript/controllers/gantt/subjects_controller.js
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
initialize() {
this.$ = window.jQuery
}
handleResizeColumn(event) {
const columnWidth = event.detail.width;
this.$(".issue-subject, .project-name, .version-name").each((_, element) => {
const $element = this.$(element)
$element.width(columnWidth - $element.position().left)
})
}
static targets = ["row"]
handleEntryClick(event) {
const iconExpander = event.currentTarget
const $subject = this.$(iconExpander.parentElement)
const subjectInlineStart =
this.#readInlineStart($subject) + parseInt(iconExpander.offsetWidth, 10)
let targetShown = null
let targetTop = 0
let totalHeight = 0
let outOfHierarchy = false
const willOpen = !$subject.hasClass("open")
this.#setIconState($subject, willOpen)
$subject.nextAll("div").each((_, element) => {
const $element = this.$(element)
const json = $element.data("collapse-expand")
const numberOfRows = $element.data("number-of-rows")
const barsSelector = `#gantt_area .gantt-timeline-body form > div[data-collapse-expand='${json.obj_id}'][data-number-of-rows='${numberOfRows}']`
const selectedColumnsSelector = `.gantt_selected_column div[data-collapse-expand='${json.obj_id}'][data-number-of-rows='${numberOfRows}']`
if (outOfHierarchy || this.#readInlineStart($element) <= subjectInlineStart) {
outOfHierarchy = true
if (targetShown === null) return false
const newTopVal = this.#readBlockStart($element) + totalHeight * (targetShown ? -1 : 1)
this.#setBlockStart($element, newTopVal)
this.$([barsSelector, selectedColumnsSelector].join()).each((__, el) => {
this.#setBlockStart(this.$(el), newTopVal)
})
return true
}
const isShown = $element.is(":visible")
if (targetShown === null) {
targetShown = isShown
targetTop = this.#readBlockStart($element)
totalHeight = 0
}
if (isShown === targetShown) {
this.$(barsSelector).each((__, task) => {
const $task = this.$(task)
if (!isShown && willOpen) {
this.#setBlockStart($task, targetTop + totalHeight)
}
if (!$task.hasClass("tooltip")) {
$task.toggle(willOpen)
}
})
this.$(selectedColumnsSelector).each((__, attr) => {
const $attr = this.$(attr)
if (!isShown && willOpen) {
this.#setBlockStart($attr, targetTop + totalHeight)
}
$attr.toggle(willOpen)
})
if (!isShown && willOpen) {
this.#setBlockStart($element, targetTop + totalHeight)
}
const subject = event.currentTarget.closest(".gantt-row")
if (!subject) return
const chart = this.element.closest(".gantt-chart")
const subjectRows = this.rowTargets
const subjectKey = subject.dataset.ganttRowKey
const descendantKeys = new Set([subjectKey])
const descendants = []
const willOpen = !subject.classList.contains("is-expanded")
subjectRows.forEach((row) => {
if (row === subject) return
if (!descendantKeys.has(row.dataset.ganttParentRowKey)) return
descendantKeys.add(row.dataset.ganttRowKey)
descendants.push(row)
})
this.#setIconState($element, willOpen)
$element.toggle(willOpen)
totalHeight += parseInt(json.top_increment, 10)
}
this.#setIconState(subject, willOpen)
descendants.forEach((row) => {
this.#setIconState(row, willOpen)
chart.querySelectorAll(this.#rowSelector(row.dataset.ganttRowKey)).forEach((matchingRow) => {
matchingRow.hidden = !willOpen
})
})
this.#positionVisibleRows(chart, subjectRows)
this.dispatch("toggle-tree", { bubbles: true })
}
#readInlineStart(el) {
const node = el.jquery ? el[0] : el
return parseFloat(window.getComputedStyle(node).getPropertyValue("inset-inline-start"))
}
#positionVisibleRows(chart, subjectRows) {
const chartStyle = window.getComputedStyle(chart)
const contentTop = parseFloat(chartStyle.getPropertyValue("--gantt-content-top")) || 0
const rowHeight = parseFloat(window.getComputedStyle(subjectRows[0]).blockSize) || 20
let top = contentTop
#readBlockStart(el) {
const node = el.jquery ? el[0] : el
return parseFloat(window.getComputedStyle(node).getPropertyValue("inset-block-start"))
subjectRows.forEach((row) => {
if (row.hidden) return
chart.querySelectorAll(this.#rowSelector(row.dataset.ganttRowKey)).forEach((matchingRow) => {
matchingRow.style.setProperty("--gantt-row-top", `${top}px`)
})
top += rowHeight
})
}
#setBlockStart(el, value) {
const node = el.jquery ? el[0] : el
const px = typeof value === "number" ? `${value}px` : value
node.style.setProperty("--gantt-row-top", px)
#rowSelector(rowKey) {
return `.gantt-row[data-gantt-row-key="${CSS.escape(rowKey)}"]`
}
#setIconState(element, open) {
const $element = element.jquery ? element : this.$(element)
const expander = $element.find(".expander")
if (open) {
$element.addClass("open")
if (expander.length > 0) {
expander.removeClass("icon-collapsed").addClass("icon-expanded")
if (expander.find("svg").length === 1) {
window.updateSVGIcon(expander[0], "angle-down")
}
}
} else {
$element.removeClass("open")
if (expander.length > 0) {
expander.removeClass("icon-expanded").addClass("icon-collapsed")
if (expander.find("svg").length === 1) {
window.updateSVGIcon(expander[0], "angle-right")
}
}
const expander = element.querySelector(".expander")
if (!expander) return
element.classList.toggle("is-expanded", open)
expander.classList.toggle("icon-expanded", open)
expander.classList.toggle("icon-collapsed", !open)
if (expander.querySelectorAll("svg").length === 1) {
window.updateSVGIcon(expander, open ? "angle-down" : "angle-right")
}
}
}
app/views/gantts/_chart.html.erb
<%= gantt_chart_tag(@query, layout) do %>
<%= gantt_column_tag('subjects', min_width: 100, width: 'var(--gantt-subject-width)') do %>
<section class="gantt-pane gantt_subjects_container<%= ' draw_selected_columns' if query.draw_selected_columns %>"
data-gantt--chart-target="subjectsContainer">
<header class="gantt-pane-header" aria-hidden="true"></header>
<div class="gantt-pane-body">
<%= gantt_subjects_tag do %>
<%= form_tag({}, data: {cm_url: issues_context_menu_path}) do %>
<%= hidden_field_tag 'back_url', url_for(params: request.query_parameters), id: nil %>
<%= gantt.subjects.html_safe %>
<% end %>
<section class="gantt-pane">
<header aria-hidden="true"></header>
<div class="gantt-pane-body" data-controller="gantt--subjects">
<%= form_tag({}, data: {cm_url: issues_context_menu_path}) do %>
<%= hidden_field_tag 'back_url', url_for(params: request.query_parameters), id: nil %>
<%= gantt.subjects.html_safe %>
<% end %>
</div>
</section>
......
next if Redmine::Helpers::Gantt::UNAVAILABLE_COLUMNS.include?(column.name)
column_name = column.name.to_s.tr('.', '_')
%>
<%= gantt_column_tag(column_name, min_width: 20, width: '50px', id: column_name,
class: 'gantt_selected_column', hidden: !query.draw_selected_columns) do %>
<section class="gantt-pane gantt_selected_column_container gantt_<%= column_name %>_container">
<header class="gantt-pane-header gantt-selected-column-header"><%= column.caption %></header>
<div class="gantt-pane-body gantt_selected_column_content gantt_<%= column_name %>">
<%= gantt_column_tag(column_name, min_width: 20, width: '50px', class: 'gantt-selected-column',
hidden: !query.draw_selected_columns,
data: {'gantt--chart-target': 'selectedColumn'}) do %>
<section class="gantt-pane">
<header><%= column.caption %></header>
<div class="gantt-pane-body">
<%= gantt.selected_column_content(column: column, top: layout.content_top, zoom: layout.zoom, g_width: layout.chart_width).html_safe %>
</div>
</section>
<% end %>
<% end %>
<div id="gantt_area" class="gantt-timeline" data-gantt--chart-target="ganttArea">
<div class="gantt-timeline">
<div class="gantt-timeline-canvas">
<header class="gantt-timeline-header">
<div class="gantt-header-row gantt-header-months">
<header>
<div class="gantt-header-row" data-gantt-period="month">
<% layout.months.each do |period| %>
<div class="gantt-period gantt-period-month<%= ' gantt-period-spans-body' if period.spans_body %><%= ' gantt-period-last' if period.last %>"
<div class="gantt-period<%= ' gantt-period-spans-body' if period.spans_body %><%= ' gantt-period-last' if period.last %>"
style="<%= gantt_period_style(period) %>">
<%= link_to "#{period.date.year}-#{period.date.month}",
gantt.params.merge(year: period.date.year, month: period.date.month),
......
</div>
<% if layout.show_weeks? %>
<div class="gantt-header-row gantt-header-weeks">
<div class="gantt-header-row" data-gantt-period="week">
<% layout.weeks.each do |period| %>
<div class="gantt-period gantt-period-week<%= ' gantt-period-spans-body' if period.spans_body %><%= ' gantt-period-last' if period.last %>"
<div class="gantt-period<%= ' gantt-period-spans-body' if period.spans_body %><%= ' gantt-period-last' if period.last %>"
style="<%= gantt_period_style(period) %>">
<small><%= period.date.cweek if period.date && period.width >= 16 %></small>
</div>
......
<% end %>
<% if layout.show_day_numbers? %>
<div class="gantt-header-row gantt-header-day-numbers">
<div class="gantt-header-row" data-gantt-period="day-number">
<% layout.day_numbers.each do |period| %>
<div class="gantt-period gantt-period-day-number<%= ' gantt-period-non-working' if period.non_working %><%= ' gantt-period-last' if period.last %>"
<div class="gantt-period<%= ' gantt-period-non-working' if period.non_working %><%= ' gantt-period-last' if period.last %>"
style="<%= gantt_period_style(period) %>"><%= period.date.day %></div>
<% end %>
</div>
<% end %>
<% if layout.show_days? %>
<div class="gantt-header-row gantt-header-days">
<div class="gantt-header-row" data-gantt-period="day">
<% layout.days.each do |period| %>
<div class="gantt-period gantt-period-day gantt-period-spans-body<%= ' gantt-period-non-working' if period.non_working %><%= ' gantt-period-last' if period.last %>"
<div class="gantt-period gantt-period-spans-body<%= ' gantt-period-non-working' if period.non_working %><%= ' gantt-period-last' if period.last %>"
style="<%= gantt_period_style(period) %>"><%= day_letter(period.date.cwday) %></div>
<% end %>
</div>
......
<% end %>
<% if layout.today_start %>
<div id="today_line" style="<%= gantt_css_variables('gantt-today-start': "#{layout.today_start}px") %>" aria-hidden="true"></div>
<div class="gantt-today" data-gantt--chart-target="today" style="<%= gantt_css_variables('gantt-today-start': "#{layout.today_start}px") %>" aria-hidden="true"></div>
<% end %>
<div id="gantt_draw_area" data-gantt--chart-target="drawArea" aria-hidden="true"></div>
<div class="gantt-relations" data-gantt--chart-target="relations" aria-hidden="true"></div>
</div>
</div>
</div>
lib/redmine/helpers/gantt.rb
begin
Project.project_tree(projects) do |project, level|
options[:indent] = indent + level * options[:indent_increment]
render_project(project, options)
parent_row_key =
if level > 0 && project.parent
gantt_project_row_key(project.parent)
end
render_project(project, options, parent_row_key: parent_row_key)
end
rescue MaxLinesLimitReached
@truncated = true
......
render_end(options)
end
def render_project(project, options={})
render_object_row(project, options)
def render_project(project, options={}, parent_row_key: nil)
row = gantt_project_row(project, parent_row_key: parent_row_key)
render_object_row(project, options, row: row)
increment_indent(options) do
# render issue that are not assigned to a version
issues = project_issues(project).select {|i| i.fixed_version_id.nil?}
render_issues(issues, options)
render_issues(issues, options, parent_row_key: row[:gantt_row_key])
# then render project versions and their issues
versions = project_versions(project)
self.class.sort_versions!(versions)
......
end
def render_version(project, version, options={})
render_object_row(version, options)
row = gantt_version_row(version, project)
render_object_row(version, options, row: row)
increment_indent(options) do
issues = version_issues(project, version)
render_issues(issues, options)
render_issues(issues, options, parent_row_key: row[:gantt_row_key])
end
end
def render_issues(issues, options={})
def render_issues(issues, options={}, parent_row_key: nil)
self.class.sort_issues!(issues)
ancestors = []
issues.each do |issue|
......
ancestors.pop
decrement_indent(options)
end
render_object_row(issue, options)
issue_parent_row_key =
ancestors.any? ? gantt_issue_row_key(ancestors.last) : parent_row_key
row = gantt_issue_row(issue, parent_row_key: issue_parent_row_key)
render_object_row(issue, options, row: row)
unless issue.leaf?
ancestors << issue
increment_indent(options)
......
decrement_indent(options, ancestors.size)
end
def render_object_row(object, options)
def render_object_row(object, options, row:)
class_name = object.class.name.downcase
send(:"subject_for_#{class_name}", object, options) unless options[:only] == :lines || options[:only] == :selected_columns
subject_options =
if options[:format] == :html
options.merge(:gantt_row => row)
else
options
end
send(:"subject_for_#{class_name}", object, subject_options) unless options[:only] == :lines || options[:only] == :selected_columns
unless options[:only] == :subjects || options[:only] == :selected_columns
line = send(:"line_for_#{class_name}", object, options)
@lines << html_gantt_row(object, options, line) if options[:format] == :html
if options[:format] == :html
@lines << html_gantt_row(options, line, row: row)
end
end
if options[:only] == :selected_columns && options[:column].present?
column_content_for_object(object, options, row: row)
end
column_content_for_object(object, options) if options[:only] == :selected_columns && options[:column].present?
options[:top] += options[:top_increment]
@number_of_rows += 1
if @max_rows && @number_of_rows >= @max_rows
......
end
end
def gantt_project_row_key(project)
"project-#{project.id}"
end
def gantt_version_row_key(version, project)
"version-#{version.id}-project-#{project.id}"
end
def gantt_issue_row_key(issue)
"issue-#{issue.id}"
end
def gantt_project_row(project, parent_row_key: nil)
row = {
:gantt_row_key => gantt_project_row_key(project),
:gantt_row_type => 'project'
}
row[:gantt_parent_row_key] = parent_row_key if parent_row_key
row
end
def gantt_version_row(version, project)
{
:gantt_row_key => gantt_version_row_key(version, project),
:gantt_row_type => 'version',
:gantt_parent_row_key => gantt_project_row_key(project)
}
end
def gantt_issue_row(issue, parent_row_key: nil)
row = {
:gantt_row_key => gantt_issue_row_key(issue),
:gantt_row_type => 'issue'
}
row[:gantt_parent_row_key] = parent_row_key if parent_row_key
row
end
def increment_indent(options, factor=1)
options[:indent] += options[:indent_increment] * factor
if block_given?
......
end
end
def column_content_for_object(object, options)
def column_content_for_object(object, options, row:)
if options[:format] == :html
data_options = {
:collapse_expand => "#{object.class}-#{object.id}".downcase,
:number_of_rows => number_of_rows
}
value = object.is_a?(Issue) ? view.column_content(options[:column], object) : nil
content =
view.content_tag(
:div, value,
:style => css_variables('gantt-row-top': "#{options[:top] || 0}px"),
:class => [
"gantt-row",
"gantt-column-row",
("issue_#{options[:column].name}" if object.is_a?(Issue))
],
:id => ("#{options[:column].name}_issue_#{object.id}" if object.is_a?(Issue)),
:data => data_options
:class => 'gantt-row',
:data => row
)
@columns[options[:column].name] << content if @columns.has_key?(options[:column].name)
content
......
end
def column_content_for_issue(issue, options)
column_content_for_object(issue, options)
column_content_for_object(issue, options, row: gantt_issue_row(issue))
end
def subject(label, options, object=nil)
......
def html_subject(params, subject, object)
content = html_subject_content(object) || subject
tag_options = {}
tag_options = {:class => []}
case object
when Issue
tag_options[:id] = "issue-#{object.id}"
tag_options[:class] = "issue-subject hascontextmenu"
tag_options[:class] << 'hascontextmenu'
tag_options[:title] = object.subject
has_children =
if object.leaf?
......
children.any? {|child| child.fixed_version_id == fixed_version_id}
end
when Version
tag_options[:id] = "version-#{object.id}"
tag_options[:class] = "version-name"
has_children = object.fixed_issues.exists?
when Project
tag_options[:class] = "project-name"
has_children = object.issues.exists? || object.versions.exists?
end
if object
tag_options[:data] = {
:collapse_expand => {
:top_increment => params[:top_increment],
:obj_id => "#{object.class}-#{object.id}".downcase,
},
:number_of_rows => number_of_rows,
}
end
if has_children
content = view.content_tag(:span,
view.sprite_icon('angle-down', rtl: true).html_safe,
:class => 'icon icon-expanded expander',
:data => {:action => 'click->gantt--subjects#handleEntryClick'}) + content
tag_options[:class] += ' open'
tag_options[:class] << 'is-expanded'
else
if params[:indent]
params = params.dup
params[:indent] += 18
end
end
tag_options[:class] = [tag_options[:class], 'gantt-row', 'gantt-subject-row'].compact.join(' ')
tag_options[:class] << 'gantt-row'
tag_options[:class] = tag_options[:class].join(' ')
if object
tag_options[:data] = params[:gantt_row].to_h.merge(
'gantt--subjects-target': 'row'
)
end
row_variables = {
'gantt-row-top': "#{params[:top] || 0}px",
'gantt-row-indent': "#{params[:indent]}px"
}
if params[:subject_width]
row_variables['gantt-row-width'] = "#{params[:subject_width] - params[:indent]}px"
end
tag_options[:style] = css_variables(row_variables)
output = view.content_tag(:div, content, tag_options)
@subjects << output
......
def html_task(params, coords, markers, label, object)
output = +''
data_options = {}
if object
data_options[:collapse_expand] = "#{object.class}-#{object.id}".downcase
data_options[:number_of_rows] = number_of_rows
end
css = "task " +
case object
when Project
"project"
when Version
"version"
when Issue
object.leaf? ? 'leaf' : 'parent'
else
""
end
task_classes = ['gantt-task']
task_classes << 'gantt-task-parent' if object.is_a?(Issue) && !object.leaf?
# Renders the task bar, with progress and late
if coords[:bar_start] && coords[:bar_end]
width = coords[:bar_end] - coords[:bar_start] - 2
style = task_style(coords[:bar_start], width)
html_id = "task-todo-issue-#{object.id}" if object.is_a?(Issue)
html_id = "task-todo-version-#{object.id}" if object.is_a?(Version)
content_opt = {:style => style,
:class => "#{css} task_todo",
:id => html_id,
:data => {}}
todo_data = {}
if object.is_a?(Issue)
todo_data['gantt-issue-id'] = object.id
rels = issue_relations(object)
if rels.present?
content_opt[:data] = {"rels" => rels.to_json}
end
todo_data['gantt-relations'] = rels.to_json if rels.present?
end
content_opt[:data].merge!(data_options)
content_opt = {:style => style,
:class => (task_classes + ['gantt-task-todo']).join(' '),
:data => todo_data}
output << view.content_tag(:div, '&nbsp;'.html_safe, content_opt)
if coords[:bar_late_end]
width = coords[:bar_late_end] - coords[:bar_start] - 2
style = task_style(coords[:bar_start], width)
output << view.content_tag(:div, '&nbsp;'.html_safe,
:style => style,
:class => "#{css} task_late",
:data => data_options)
:class => (task_classes + ['gantt-task-late']).join(' '))
end
if coords[:bar_progress_end]
width = coords[:bar_progress_end] - coords[:bar_start] - 2
style = task_style(coords[:bar_start], width)
html_id = "task-done-issue-#{object.id}" if object.is_a?(Issue)
html_id = "task-done-version-#{object.id}" if object.is_a?(Version)
output << view.content_tag(:div, '&nbsp;'.html_safe,
:style => style,
:class => "#{css} task_done",
:id => html_id,
:data => data_options)
:class => (task_classes + ['gantt-task-done']).join(' '))
end
end
# Renders the markers
......
style = task_style(coords[:start], 15)
output << view.content_tag(:div, '&nbsp;'.html_safe,
:style => style,
:class => "#{css} marker starting",
:data => data_options)
:class => (task_classes + ['gantt-task-marker', 'gantt-task-start']).join(' '))
end
if coords[:end]
style = task_style(coords[:end], 15)
output << view.content_tag(:div, '&nbsp;'.html_safe,
:style => style,
:class => "#{css} marker ending",
:data => data_options)
:class => (task_classes + ['gantt-task-marker', 'gantt-task-end']).join(' '))
end
end
# Renders the label on the right
......
style = task_style((coords[:bar_end] || 0) + 8, 15)
output << view.content_tag(:div, label,
:style => style,
:class => "#{css} label",
:data => data_options)
:class => (task_classes + ['gantt-task-label']).join(' '))
end
# Renders the tooltip
if object.is_a?(Issue) && coords[:bar_start] && coords[:bar_end]
s = view.content_tag(:span,
view.render_issue_tooltip(object).html_safe,
:class => "tip")
:class => 'tip')
s += view.content_tag(:input, nil, :type => 'checkbox', :name => 'ids[]',
:value => object.id,
:class => 'toggle-selection')
style = task_style(coords[:bar_start], coords[:bar_end] - coords[:bar_start])
output << view.content_tag(:div, s.html_safe,
:style => style,
:class => "tooltip hascontextmenu",
:data => data_options)
:class => 'tooltip hascontextmenu')
end
output
end
def html_gantt_row(object, params, content)
data_options = {
:collapse_expand => "#{object.class}-#{object.id}".downcase,
:number_of_rows => number_of_rows
}
def html_gantt_row(params, content, row:)
style = css_variables('gantt-row-top': "#{params[:top] || 0}px")
view.content_tag(
:div,
content.to_s.html_safe,
:class => 'gantt-row gantt-timeline-row',
:class => 'gantt-row',
:style => style,
:data => data_options
:data => row
)
end
test/functional/gantts_controller_test.rb
end
# Assert context menu on issues subject and gantt bar
assert_select 'div.issue-subject.hascontextmenu'
assert_select 'div.gantt-column[data-gantt-column=subjects] div.gantt-row[data-gantt-row-type=issue].hascontextmenu'
assert_select 'div.tooltip.hascontextmenu' do
assert_select 'img[class="gravatar avatar"]'
end
......
get :show
assert_response :success
assert_select 'div.task_todo[id=?][data-rels*=?]', "task-todo-issue-#{issue1.id}", issue2.id.to_s
assert_select 'div.task_todo[id=?]:not([data-rels])', "task-todo-issue-#{issue2.id}"
assert_select 'div.gantt-task-todo[data-gantt-issue-id=?][data-gantt-relations*=?]', issue1.id.to_s, issue2.id.to_s
assert_select 'div.gantt-task-todo[data-gantt-issue-id=?]:not([data-gantt-relations])', issue2.id.to_s
end
def test_gantt_should_export_to_pdf
......
}
)
assert_response :success
assert_select 'div.gantt-period-month>a', :text => /^[\d-]+$/, :count => 40
assert_select 'div.gantt-header-row[data-gantt-period=month] .gantt-period>a', :text => /^[\d-]+$/, :count => 40
# Displays 6 months (the default value for `months`) if `months` exceeds
# gant_months_limit
......
}
)
assert_response :success
assert_select 'div.gantt-period-month>a', :text => /^[\d-]+$/, :count => 6
assert_select 'div.gantt-header-row[data-gantt-period=month] .gantt-period>a', :text => /^[\d-]+$/, :count => 6
end
end
......
assert_response :success
# eCookbook
assert_subject_row('div.project-name', row: '0', text: project.name)
assert_chart_row('div.task.project.task_todo', row: '0', style_substring: 'inset-inline-start:0px;width:138px')
assert_subject_row('project-1', row: '0', text: project.name)
assert_chart_row('div.gantt-task-todo', row: '0', style_substring: 'inset-inline-start:0px;width:138px')
assert_issue_row(3, 'Bug #3', row: '1')
assert_chart_row('div.task.leaf.task_todo', row: '1', style_substring: 'inset-inline-start:0px;width:38px')
assert_chart_row('div.gantt-task-todo', row: '1', style_substring: 'inset-inline-start:0px;width:38px')
assert_issue_row(7, 'Bug #7', row: '2')
assert_chart_row('div.task.leaf.task_todo', row: '2', style_substring: 'inset-inline-start:16px;width:42px')
assert_chart_row('div.gantt-task-todo', row: '2', style_substring: 'inset-inline-start:16px;width:42px')
assert_issue_row(1, 'Bug #1', row: '3')
assert_chart_row('div.task.leaf.task_todo', row: '3', style_substring: 'inset-inline-start:52px;width:46px')
assert_chart_row('div.gantt-task-todo', row: '3', style_substring: 'inset-inline-start:52px;width:46px')
# Version 1.0
assert_subject_row('div#version-2', row: '4', text: '1.0')
assert_chart_row('div.task.version', row: '4', style_substring: 'inset-inline-start:48px;width:90px')
assert_subject_row('version-2-project-1', row: '4', text: '1.0')
assert_chart_row('div.gantt-task-todo', row: '4', style_substring: 'inset-inline-start:48px;width:90px')
assert_issue_row(2, 'Feature request #2', row: '5')
assert_chart_row('div.task.leaf.task_todo', row: '5', style_substring: 'inset-inline-start:48px;width:90px')
assert_chart_row('div.gantt-task-todo', row: '5', style_substring: 'inset-inline-start:48px;width:90px')
# Private child of eCookbook
assert_subject_row(
'div.project-name[data-collapse-expand*="project-5"]',
'project-5',
row: '6',
text: projects(:projects_005).name
)
assert_chart_row('div.task.project.task_todo', row: '6', style_substring: 'inset-inline-start:56px;width:6px')
assert_chart_row('div.gantt-task-todo', row: '6', style_substring: 'inset-inline-start:56px;width:6px')
assert_issue_row(6, 'Bug #6', row: '7')
assert_chart_row('div.task.leaf.task_todo', row: '7', style_substring: 'inset-inline-start:56px;width:6px')
assert_chart_row('div.gantt-task-todo', row: '7', style_substring: 'inset-inline-start:56px;width:6px')
assert_issue_row(9, 'Bug #9', row: '8')
assert_chart_row('div.task.leaf.task_todo', row: '8', style_substring: 'inset-inline-start:56px;width:6px')
assert_chart_row('div.gantt-task-todo', row: '8', style_substring: 'inset-inline-start:56px;width:6px')
assert_issue_row(10, 'Bug #10', row: '9')
assert_chart_row('div.task.leaf.task_todo', row: '9', style_substring: 'inset-inline-start:56px;width:6px')
assert_select 'div.task[id=?][data-rels*=9]', 'task-todo-issue-10'
assert_chart_row('div.gantt-task-todo', row: '9', style_substring: 'inset-inline-start:56px;width:6px')
assert_select 'div.gantt-task-todo[data-gantt-issue-id=?][data-gantt-relations*=?]', '10', '9'
# eCookbook Subproject1
assert_subject_row(
'div.project-name[data-collapse-expand*="project-3"]',
'project-3',
row: '10',
text: projects(:projects_003).name
)
......
6.times do |offset|
m = selected_start.since(offset.month)
assert_select 'div.gantt-period-month > a', text: "#{m.year}-#{m.month}"
assert_select 'div.gantt-header-row[data-gantt-period=month] .gantt-period > a', text: "#{m.year}-#{m.month}"
end
# eCookbook
assert_subject_row('div.project-name', row: '0', text: projects(:projects_001).name)
assert_chart_row('div.task.project.task_todo', row: '0', style_substring: 'inset-inline-start:0px;width:258px')
assert_subject_row('project-1', row: '0', text: projects(:projects_001).name)
assert_chart_row('div.gantt-task-todo', row: '0', style_substring: 'inset-inline-start:0px;width:258px')
# Private child of eCookbook
assert_subject_row(
'div.project-name[data-collapse-expand*="project-5"]',
'project-5',
row: '1',
text: project.name
)
assert_chart_row('div.task.project.task_todo', row: '1', style_substring: 'inset-inline-start:176px;width:6px')
assert_chart_row('div.gantt-task-todo', row: '1', style_substring: 'inset-inline-start:176px;width:6px')
# Bug #6
assert_issue_row(6, 'Bug #6', row: '2')
assert_chart_row('div.task.leaf.task_todo', row: '2', style_substring: 'inset-inline-start:176px;width:6px')
assert_chart_row('div.gantt-task-todo', row: '2', style_substring: 'inset-inline-start:176px;width:6px')
# Bug #9
assert_issue_row(9, 'Bug #9', row: '3')
assert_chart_row('div.task.leaf.task_todo', row: '3', style_substring: 'inset-inline-start:176px;width:6px')
assert_chart_row('div.gantt-task-todo', row: '3', style_substring: 'inset-inline-start:176px;width:6px')
# Bug #10
assert_issue_row(10, 'Bug #10', row: '4')
assert_chart_row('div.task.leaf.task_todo', row: '4', style_substring: 'inset-inline-start:176px;width:6px')
assert_chart_row('div.gantt-task-todo', row: '4', style_substring: 'inset-inline-start:176px;width:6px')
assert_select 'div.task[id=?][data-rels*=9]', 'task-todo-issue-10'
assert_select 'div.gantt-task-todo[data-gantt-issue-id=?][data-gantt-relations*=?]', '10', '9'
end
test 'shows six months starting from current month' do
......
6.times do |offset|
m = start_of_month.since(offset.months)
assert_select 'div.gantt-period-month > a', text: "#{m.year}-#{m.month}"
assert_select 'div.gantt-header-row[data-gantt-period=month] .gantt-period > a', text: "#{m.year}-#{m.month}"
end
assert_select 'input#months[value=?]', '6'
......
private
def assert_subject_row(selector, row:, text:)
assert_select "div.gantt_subjects form #{selector}[data-number-of-rows=?]", row do
def assert_subject_row(row_key, row:, text:)
selector = "div.gantt-column[data-gantt-column=subjects] form > div.gantt-row:nth-of-type(#{row.to_i + 1})[data-gantt-row-key=?]"
assert_select selector, row_key do
assert_select 'a', text: text
end
end
def assert_issue_row(issue_id, link_text, row:)
selector = "div.gantt_subjects form div#issue-#{issue_id}[data-number-of-rows=\"#{row}\"]"
assert_select selector do
selector = "div.gantt-column[data-gantt-column=subjects] form > div.gantt-row:nth-of-type(#{row.to_i + 1})[data-gantt-row-key=?]"
assert_select selector, "issue-#{issue_id}" do
assert_select 'a.issue', text: link_text
end
end
def assert_chart_row(selector, row:, style_substring:)
style_substring = "--gantt-task-start:#{style_substring.delete_prefix('inset-inline-start:').sub(';width:', ';--gantt-task-width:')}"
matcher = "#gantt_area #{selector}[data-number-of-rows=?][style*=?]"
assert_select matcher, row, style_substring, minimum: 1
matcher = "div.gantt-timeline form > div.gantt-row:nth-of-type(#{row.to_i + 1}) #{selector}[style*=?]"
assert_select matcher, style_substring, minimum: 1
end
# Freezes today and resets the start and due dates of issues and versions in the eCookbook project and its descendants to fixed values
test/system/gantts_test.rb
visit_gantt
expand_options
assert_no_selector 'div#status'
assert_no_selector 'div#priority'
assert_no_selector 'div#assigned_to'
assert_no_selector 'div#updated_on'
assert_no_selector 'div.gantt-column[data-gantt-column=status]'
assert_no_selector 'div.gantt-column[data-gantt-column=priority]'
assert_no_selector 'div.gantt-column[data-gantt-column=assigned_to]'
assert_no_selector 'div.gantt-column[data-gantt-column=updated_on]'
find('#draw_selected_columns').check
assert_selector '.gantt_subjects_container.draw_selected_columns'
assert_selector 'div#status'
assert_selector 'div#priority'
assert_selector 'div#assigned_to'
assert_selector 'div#updated_on'
assert_selector 'div.gantt-column[data-gantt-column=subjects]'
assert_selector 'div.gantt-column[data-gantt-column=status]'
assert_selector 'div.gantt-column[data-gantt-column=priority]'
assert_selector 'div.gantt-column[data-gantt-column=assigned_to]'
assert_selector 'div.gantt-column[data-gantt-column=updated_on]'
end
test 'tree toggle updates the same logical rows across every pane' do
visit_gantt
expand_options
find('#draw_selected_columns').check
project_row = find('[data-gantt-column="subjects"] .gantt-row[data-gantt-row-key="project-1"]')
subject_issue = '[data-gantt-column="subjects"] .gantt-row[data-gantt-row-key="issue-3"]'
column_issue = '[data-gantt-column="status"] .gantt-row[data-gantt-row-key="issue-3"]'
timeline_issue = '.gantt-timeline-body .gantt-row[data-gantt-row-key="issue-3"]'
... This diff was truncated because it exceeds the maximum size that can be displayed.
(3-3/8)