Skip to content

Commit

Permalink
feat(issueProvider): add ani to issue list
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Dec 12, 2024
1 parent f058b6b commit 6b98083
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
@for (day of agendaItems(); track day.dayStr) {
<div class="agenda-day">
<h4>{{ day.dayStr|date:'shortDate' }}</h4>
<div class="item-list">
<div
class="item-list"
[@standardList]="day.itemsForDay.length"
>
@for (item of day.itemsForDay; track item.issueData.id) {
<issue-preview-item
[issueProviderId]="issueProvider().id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { ICalIssueReduced } from '../../issue/providers/calendar/calendar.model'
import { getErrorTxt } from 'src/app/util/get-error-text';
import { getWorklogStr } from '../../../util/get-work-log-str';
import { DatePipe } from '@angular/common';
import { standardListAnimation } from '../../../ui/animations/standard-list.ani';

@Component({
selector: 'issue-panel-calendar-agenda',
Expand All @@ -27,6 +28,7 @@ import { DatePipe } from '@angular/common';
templateUrl: './issue-panel-calendar-agenda.component.html',
styleUrl: './issue-panel-calendar-agenda.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [standardListAnimation],
})
export class IssuePanelCalendarAgendaComponent implements OnInit {
readonly T: typeof T = T;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@
} @else if (!issueItems()?.length && searchText()?.length > 0) {
<div class="empty">No items found (already added are not shown)</div>
} @else {
<div class="item-list">
<div
class="item-list"
[@standardList]="issueItems()?.length"
>
<!-- (cdkDropListDropped)="drop($event)"-->

@for (item of issueItems(); track $index) {
@for (item of issueItems(); track item.issueData.id) {
<!-- <div style="display: flex; align-items: center">-->
<!-- <button-->
<!-- mat-icon-button-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { IS_MOUSE_PRIMARY } from '../../../util/is-mouse-primary';
import { getIssueProviderHelpLink } from '../../issue/mapping-helper/get-issue-provider-help-link';
import { ISSUE_PROVIDER_HUMANIZED } from '../../issue/issue.const';
import { IssuePanelCalendarAgendaComponent } from '../issue-panel-calendar-agenda/issue-panel-calendar-agenda.component';
import { standardListAnimation } from '../../../ui/animations/standard-list.ani';

@Component({
selector: 'issue-provider-tab',
Expand All @@ -63,6 +64,7 @@ import { IssuePanelCalendarAgendaComponent } from '../issue-panel-calendar-agend
templateUrl: './issue-provider-tab.component.html',
styleUrl: './issue-provider-tab.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
animations: [standardListAnimation],
})
export class IssueProviderTabComponent implements OnDestroy, AfterViewInit {
readonly HelperClasses = HelperClasses;
Expand Down
44 changes: 4 additions & 40 deletions src/app/features/tasks/task-list/task-list-ani.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,8 @@
import {
animate,
keyframes,
query,
stagger,
style,
transition,
trigger,
} from '@angular/animations';
import { ANI_FAST_TIMING } from '../../../ui/animations/animation.const';

const ANI = [
query(':enter', style({ opacity: 0, height: 0 }), { optional: true }),

query(
':enter',
stagger('40ms', [
animate(
ANI_FAST_TIMING,
keyframes([
style({ opacity: 0, height: 0, transform: 'scale(0)', offset: 0 }),
style({ opacity: 1, height: '*', transform: 'scale(1)', offset: 0.99 }),
style({ height: 'auto', offset: 1.0 }),
]),
),
]),
{ optional: true },
),

query(
':leave',
stagger('-40ms', [
style({ transform: 'scale(1)', opacity: 1, height: '*' }),
animate(ANI_FAST_TIMING, style({ transform: 'scale(0)', height: 0 })),
]),
{ optional: true },
),
];
import { transition, trigger } from '@angular/animations';
import { STANDARD_LIST_ANI } from '../../../ui/animations/standard-list.ani';

export const taskListAnimation = trigger('taskList', [
transition(':increment, :decrement', ANI),
transition('* <=> ALWAYS', ANI),
transition(':increment, :decrement', STANDARD_LIST_ANI),
transition('* <=> ALWAYS', STANDARD_LIST_ANI),
transition('* <=> BLOCK', []),
]);
4 changes: 2 additions & 2 deletions src/app/ui/animations/standard-list.ani.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@angular/animations';
import { ANI_FAST_TIMING } from './animation.const';

const ANI = [
export const STANDARD_LIST_ANI = [
query(':enter', style({ opacity: 0, height: 0 }), { optional: true }),

query(
Expand Down Expand Up @@ -38,5 +38,5 @@ const ANI = [
];

export const standardListAnimation = trigger('standardList', [
transition(':increment, :decrement', ANI),
transition(':increment, :decrement', STANDARD_LIST_ANI),
]);

0 comments on commit 6b98083

Please sign in to comment.