Skip to content

Commit

Permalink
fix(calendar): hide today date when view type is not day #INFR-1241 (#82
Browse files Browse the repository at this point in the history
)
  • Loading branch information
HandsomeButterball authored Nov 16, 2020
1 parent c3334cb commit 2610f22
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="gantt-calendar-today-overlay" [style.width.px]="view.width">
<span class="today-rect"> </span>
<span class="today-rect" [hidden]="ganttUpper.viewType !== viewTypes.day"> </span>
<span class="today-line" *ngIf="ganttUpper.showTodayLine"> </span>
</div>

Expand All @@ -9,12 +9,7 @@
{{ point.text }}
</text>
<ng-container *ngFor="let point of view.secondaryDatePoints; trackBy: trackBy">
<text
class="secondary-text"
[class.secondary-text-weekend]="point.additions?.isWeekend"
[attr.x]="point.x"
[attr.y]="point.y"
>
<text class="secondary-text" [class.secondary-text-weekend]="point.additions?.isWeekend" [attr.x]="point.x" [attr.y]="point.y">
{{ point.text }}
</text>
</ng-container>
Expand Down
3 changes: 3 additions & 0 deletions packages/gantt/src/components/calendar/calendar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { headerHeight, todayHeight, todayWidth, todayBorderRadius } from '../../
import { isNumber } from '../../utils/helpers';
import { GanttDate } from '../../utils/date';
import { GANTT_UPPER_TOKEN, GanttUpper } from '../../gantt-upper';
import { GanttViewType } from './../../class/view-type';

const mainHeight = 5000;

Expand All @@ -41,6 +42,8 @@ export class GanttCalendarComponent implements OnInit, AfterViewInit, OnChanges,

todayBorderRadius = todayBorderRadius;

viewTypes = GanttViewType;

@HostBinding('class.gantt-calendar-overlay') className = true;

constructor(
Expand Down
10 changes: 7 additions & 3 deletions packages/gantt/src/components/table/gantt-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
</div>

<ng-container *ngIf="group.expanded">
<ng-template [ngTemplateOutlet]="ganttItems" [ngTemplateOutletContext]="{ items: group.items, level: 0 }"></ng-template>
<ng-template
[ngTemplateOutlet]="ganttItems"
[ngTemplateOutletContext]="{ group: group, items: group.items, level: 0 }"
></ng-template>
</ng-container>
</ng-container>
</ng-container>
Expand All @@ -35,11 +38,12 @@
<ng-template [ngTemplateOutlet]="ganttItems" [ngTemplateOutletContext]="{ items: items, level: 0 }"></ng-template>
</ng-template>

<ng-template #ganttItems let-items="items" let-level="level">
<ng-template #ganttItems let-group="group" let-items="items" let-level="level">
<ng-container *ngFor="let item of items">
<div
class="gantt-table-item gantt-table-row"
[class.gantt-table-item-first-level-group]="level === 0 && (item.type | isGanttRangeItem)"
[class.gantt-table-item-with-group]="group"
[style.height.px]="gantt.styles.lineHeight"
[style.lineHeight.px]="gantt.styles.lineHeight"
>
Expand All @@ -66,7 +70,7 @@
<ng-template
*ngIf="item.children && item.expanded"
[ngTemplateOutlet]="ganttItems"
[ngTemplateOutletContext]="{ items: item.children, level: level + 1 }"
[ngTemplateOutletContext]="{ items: item.children, level: level + 1, group: group }"
></ng-template>
</ng-container>
</ng-template>
14 changes: 11 additions & 3 deletions packages/gantt/src/components/table/gantt-table.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,21 @@
background: $gantt-group-background-color;
}

&-with-group {
.gantt-table-column {
&:first-child {
padding: 0 15px 0 32px;
}
}
}

.gantt-table-column {
display: flex;
padding: $gantt-table-td-padding;

&:first-child {
padding: 0 15px 0 32px;
}
// &:first-child {
// padding: 0 15px 0 32px;
// }

&:last-child {
border-right: none;
Expand Down

0 comments on commit 2610f22

Please sign in to comment.