mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
feat: merge issue header stuff into single component
This commit is contained in:
parent
1a401cc605
commit
e0583dddfa
28 changed files with 15 additions and 377 deletions
1
android/.idea/gradle.xml
generated
1
android/.idea/gradle.xml
generated
|
|
@ -15,7 +15,6 @@
|
|||
<option value="$PROJECT_DIR$/../node_modules/@capacitor/app/android" />
|
||||
<option value="$PROJECT_DIR$/../node_modules/@capacitor/filesystem/android" />
|
||||
<option value="$PROJECT_DIR$/../node_modules/@capacitor/local-notifications/android" />
|
||||
<option value="$PROJECT_DIR$/../node_modules/@capacitor/preferences/android" />
|
||||
<option value="$PROJECT_DIR$/../node_modules/@capawesome/capacitor-android-dark-mode-support/android" />
|
||||
<option value="$PROJECT_DIR$/../node_modules/@capawesome/capacitor-background-task/android" />
|
||||
</set>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,7 @@
|
|||
@if (task?.issueType === JIRA_TYPE) {
|
||||
<jira-issue-header [task]="task"></jira-issue-header>
|
||||
}
|
||||
@if (task?.issueType === GITHUB_TYPE) {
|
||||
<github-issue-header [task]="task"></github-issue-header>
|
||||
}
|
||||
@if (task?.issueType === REDMINE_TYPE) {
|
||||
<redmine-issue-header [task]="task"></redmine-issue-header>
|
||||
}
|
||||
@if (task?.issueType === GITLAB_TYPE) {
|
||||
<gitlab-issue-header [task]="task"></gitlab-issue-header>
|
||||
}
|
||||
@if (task?.issueType === CALDAV_TYPE) {
|
||||
<caldav-issue-header [task]="task"></caldav-issue-header>
|
||||
}
|
||||
@if (task?.issueType === OPEN_PROJECT_TYPE) {
|
||||
<open-project-issue-header [task]="task"></open-project-issue-header>
|
||||
}
|
||||
@if (task?.issueType === GITEA_TYPE) {
|
||||
<gitea-issue-header [task]="task"></gitea-issue-header>
|
||||
@if (task().issueWasUpdated) {
|
||||
<mat-icon>update</mat-icon>
|
||||
} @else {
|
||||
<mat-icon [svgIcon]="ISSUE_PROVIDER_ICON_MAP[task().issueType!]"></mat-icon>
|
||||
}
|
||||
|
||||
<span>{{ ISSUE_PROVIDER_HUMANIZED[task().issueType!] }}</span>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
:host {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,50 +1,19 @@
|
|||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { TaskWithSubTasks } from '../../tasks/task.model';
|
||||
import {
|
||||
CALDAV_TYPE,
|
||||
GITEA_TYPE,
|
||||
GITHUB_TYPE,
|
||||
GITLAB_TYPE,
|
||||
REDMINE_TYPE,
|
||||
JIRA_TYPE,
|
||||
OPEN_PROJECT_TYPE,
|
||||
} from '../issue.const';
|
||||
import { JiraIssueHeaderComponent } from '../providers/jira/jira-issue/jira-issue-header/jira-issue-header.component';
|
||||
import { GithubIssueHeaderComponent } from '../providers/github/github-issue/github-issue-header/github-issue-header.component';
|
||||
import { RedmineIssueHeaderComponent } from '../providers/redmine/redmine-issue/redmine-issue-header/redmine-issue-header.component';
|
||||
import { GitlabIssueHeaderComponent } from '../providers/gitlab/gitlab-issue/gitlab-issue-header/gitlab-issue-header.component';
|
||||
import { CaldavIssueHeaderComponent } from '../providers/caldav/caldav-issue/caldav-issue-header/caldav-issue-header.component';
|
||||
import { OpenProjectIssueHeaderComponent } from '../providers/open-project/open-project-issue/open-project-issue-header/open-project-issue-header.component';
|
||||
import { GiteaIssueHeaderComponent } from '../providers/gitea/gitea-issue/gitea-issue-header/gitea-issue-header.component';
|
||||
import { ISSUE_PROVIDER_HUMANIZED, ISSUE_PROVIDER_ICON_MAP } from '../issue.const';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'issue-header',
|
||||
templateUrl: './issue-header.component.html',
|
||||
styleUrls: ['./issue-header.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [
|
||||
JiraIssueHeaderComponent,
|
||||
GithubIssueHeaderComponent,
|
||||
RedmineIssueHeaderComponent,
|
||||
GitlabIssueHeaderComponent,
|
||||
CaldavIssueHeaderComponent,
|
||||
OpenProjectIssueHeaderComponent,
|
||||
GiteaIssueHeaderComponent,
|
||||
],
|
||||
imports: [CommonModule, MatIcon],
|
||||
})
|
||||
export class IssueHeaderComponent {
|
||||
// TODO: Skipped for migration because:
|
||||
// This input is used in a control flow expression (e.g. `@if` or `*ngIf`)
|
||||
// and migrating would break narrowing currently.
|
||||
@Input() task?: TaskWithSubTasks;
|
||||
task = input.required<TaskWithSubTasks>();
|
||||
|
||||
readonly GITLAB_TYPE: string = GITLAB_TYPE;
|
||||
readonly GITHUB_TYPE: string = GITHUB_TYPE;
|
||||
readonly REDMINE_TYPE: string = REDMINE_TYPE;
|
||||
readonly JIRA_TYPE: string = JIRA_TYPE;
|
||||
readonly CALDAV_TYPE: string = CALDAV_TYPE;
|
||||
readonly OPEN_PROJECT_TYPE: string = OPEN_PROJECT_TYPE;
|
||||
readonly GITEA_TYPE: string = GITEA_TYPE;
|
||||
|
||||
constructor() {}
|
||||
readonly ISSUE_PROVIDER_ICON_MAP = ISSUE_PROVIDER_ICON_MAP;
|
||||
readonly ISSUE_PROVIDER_HUMANIZED = ISSUE_PROVIDER_HUMANIZED;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
@if (task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
color="accent"
|
||||
style="margin-right: 8px"
|
||||
>update
|
||||
</mat-icon>
|
||||
}
|
||||
@if (!task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
style="margin-right: 8px"
|
||||
svgIcon="caldav"
|
||||
>
|
||||
</mat-icon>
|
||||
}
|
||||
<span class="tab-label-text">Caldav</span>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { T } from 'src/app/t.const';
|
||||
import { TaskWithSubTasks } from 'src/app/features/tasks/task.model';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'caldav-issue-header',
|
||||
templateUrl: './caldav-issue-header.component.html',
|
||||
styleUrls: ['./caldav-issue-header.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [MatIcon],
|
||||
})
|
||||
export class CaldavIssueHeaderComponent {
|
||||
T: typeof T = T;
|
||||
public readonly task = input<TaskWithSubTasks>();
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
@if (task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
color="accent"
|
||||
style="margin-right: 8px"
|
||||
>update
|
||||
</mat-icon>
|
||||
}
|
||||
@if (!task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
style="margin-right: 8px"
|
||||
svgIcon="gitea"
|
||||
>
|
||||
</mat-icon>
|
||||
}
|
||||
<span class="tab-label-text">Gitea</span>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { TaskWithSubTasks } from '../../../../../tasks/task.model';
|
||||
import { T } from '../../../../../../t.const';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'gitea-issue-header',
|
||||
templateUrl: './gitea-issue-header.component.html',
|
||||
styleUrls: ['./gitea-issue-header.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [MatIcon],
|
||||
})
|
||||
export class GiteaIssueHeaderComponent {
|
||||
T: typeof T = T;
|
||||
readonly task = input<TaskWithSubTasks>();
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
@if (task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
color="accent"
|
||||
style="margin-right: 8px"
|
||||
>update
|
||||
</mat-icon>
|
||||
}
|
||||
@if (!task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
style="margin-right: 8px"
|
||||
svgIcon="github"
|
||||
>
|
||||
</mat-icon>
|
||||
}
|
||||
<span class="tab-label-text">Github</span>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
//
|
||||
// import { GithubIssueHeaderComponent } from './github-issue-header.component';
|
||||
//
|
||||
// describe('GithubIssueHeaderComponent', () => {
|
||||
// let component: GithubIssueHeaderComponent;
|
||||
// let fixture: ComponentFixture<GithubIssueHeaderComponent>;
|
||||
//
|
||||
// beforeEach(async(() => {
|
||||
// TestBed.configureTestingModule({
|
||||
// declarations: [GithubIssueHeaderComponent]
|
||||
// })
|
||||
// .compileComponents();
|
||||
// }));
|
||||
//
|
||||
// beforeEach(() => {
|
||||
// fixture = TestBed.createComponent(GithubIssueHeaderComponent);
|
||||
// component = fixture.componentInstance;
|
||||
// fixture.detectChanges();
|
||||
// });
|
||||
//
|
||||
// it('should create', () => {
|
||||
// expect(component).toBeTruthy();
|
||||
// });
|
||||
// });
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { TaskWithSubTasks } from '../../../../../tasks/task.model';
|
||||
import { T } from '../../../../../../t.const';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'github-issue-header',
|
||||
templateUrl: './github-issue-header.component.html',
|
||||
styleUrls: ['./github-issue-header.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [MatIcon],
|
||||
})
|
||||
export class GithubIssueHeaderComponent {
|
||||
T: typeof T = T;
|
||||
readonly task = input<TaskWithSubTasks>();
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
@if (task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
color="accent"
|
||||
style="margin-right: 8px"
|
||||
>update
|
||||
</mat-icon>
|
||||
}
|
||||
@if (!task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
style="margin-right: 8px"
|
||||
svgIcon="gitlab"
|
||||
>
|
||||
</mat-icon>
|
||||
}
|
||||
<span class="tab-label-text">Gitlab</span>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { T } from 'src/app/t.const';
|
||||
import { TaskWithSubTasks } from 'src/app/features/tasks/task.model';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'gitlab-issue-header',
|
||||
templateUrl: './gitlab-issue-header.component.html',
|
||||
styleUrls: ['./gitlab-issue-header.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [MatIcon],
|
||||
})
|
||||
export class GitlabIssueHeaderComponent {
|
||||
T: typeof T = T;
|
||||
public readonly task = input<TaskWithSubTasks>();
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
@if (isOnline$ | async) {
|
||||
@if (task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
color="accent"
|
||||
style="margin-right: 8px"
|
||||
>update
|
||||
</mat-icon>
|
||||
}
|
||||
@if (!task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
style="margin-right: 8px"
|
||||
svgIcon="jira"
|
||||
>
|
||||
</mat-icon>
|
||||
}
|
||||
} @else {
|
||||
<mat-icon
|
||||
[matTooltip]="'No internet!'"
|
||||
style="margin-right: 8px"
|
||||
>cloud_off
|
||||
</mat-icon>
|
||||
}
|
||||
<span class="tab-label-text">Jira</span>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
//
|
||||
// import { JiraIssueHeaderComponent } from './jira-issue-header.component';
|
||||
//
|
||||
// describe('JiraIssueHeaderComponent', () => {
|
||||
// let component: JiraIssueHeaderComponent;
|
||||
// let fixture: ComponentFixture<JiraIssueHeaderComponent>;
|
||||
//
|
||||
// beforeEach(async(() => {
|
||||
// TestBed.configureTestingModule({
|
||||
// declarations: [JiraIssueHeaderComponent]
|
||||
// })
|
||||
// .compileComponents();
|
||||
// }));
|
||||
//
|
||||
// beforeEach(() => {
|
||||
// fixture = TestBed.createComponent(JiraIssueHeaderComponent);
|
||||
// component = fixture.componentInstance;
|
||||
// fixture.detectChanges();
|
||||
// });
|
||||
//
|
||||
// it('should create', () => {
|
||||
// expect(component).toBeTruthy();
|
||||
// });
|
||||
// });
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { TaskWithSubTasks } from '../../../../../tasks/task.model';
|
||||
import { isOnline$ } from 'src/app/util/is-online';
|
||||
import { Observable } from 'rxjs';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
import { MatTooltip } from '@angular/material/tooltip';
|
||||
import { AsyncPipe } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'jira-issue-header',
|
||||
templateUrl: './jira-issue-header.component.html',
|
||||
styleUrls: ['./jira-issue-header.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [MatIcon, MatTooltip, AsyncPipe],
|
||||
})
|
||||
export class JiraIssueHeaderComponent {
|
||||
readonly task = input<TaskWithSubTasks>();
|
||||
isOnline$: Observable<boolean> = isOnline$;
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
@if (task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
color="accent"
|
||||
style="margin-right: 8px"
|
||||
>update
|
||||
</mat-icon>
|
||||
}
|
||||
@if (!task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
style="margin-right: 8px"
|
||||
svgIcon="open_project"
|
||||
>
|
||||
</mat-icon>
|
||||
}
|
||||
<span class="tab-label-text">OpenProject</span>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
//
|
||||
// import { OpenProjectIssueHeaderComponent } from './open-project-issue-header.component';
|
||||
//
|
||||
// describe('OpenProjectIssueHeaderComponent', () => {
|
||||
// let component: OpenProjectIssueHeaderComponent;
|
||||
// let fixture: ComponentFixture<OpenProjectIssueHeaderComponent>;
|
||||
//
|
||||
// beforeEach(async(() => {
|
||||
// TestBed.configureTestingModule({
|
||||
// declarations: [OpenProjectIssueHeaderComponent]
|
||||
// })
|
||||
// .compileComponents();
|
||||
// }));
|
||||
//
|
||||
// beforeEach(() => {
|
||||
// fixture = TestBed.createComponent(OpenProjectIssueHeaderComponent);
|
||||
// component = fixture.componentInstance;
|
||||
// fixture.detectChanges();
|
||||
// });
|
||||
//
|
||||
// it('should create', () => {
|
||||
// expect(component).toBeTruthy();
|
||||
// });
|
||||
// });
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { TaskWithSubTasks } from '../../../../../tasks/task.model';
|
||||
import { T } from '../../../../../../t.const';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'open-project-issue-header',
|
||||
templateUrl: './open-project-issue-header.component.html',
|
||||
styleUrls: ['./open-project-issue-header.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [MatIcon],
|
||||
})
|
||||
export class OpenProjectIssueHeaderComponent {
|
||||
T: typeof T = T;
|
||||
readonly task = input<TaskWithSubTasks>();
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
@if (task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
color="accent"
|
||||
style="margin-right: 8px"
|
||||
>update
|
||||
</mat-icon>
|
||||
}
|
||||
@if (!task()?.issueWasUpdated) {
|
||||
<mat-icon
|
||||
style="margin-right: 8px"
|
||||
svgIcon="redmine"
|
||||
>
|
||||
</mat-icon>
|
||||
}
|
||||
<span class="tab-label-text">Redmine</span>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { TaskWithSubTasks } from '../../../../../tasks/task.model';
|
||||
import { T } from '../../../../../../t.const';
|
||||
import { MatIcon } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'redmine-issue-header',
|
||||
templateUrl: './redmine-issue-header.component.html',
|
||||
styleUrls: ['./redmine-issue-header.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [MatIcon],
|
||||
})
|
||||
export class RedmineIssueHeaderComponent {
|
||||
T: typeof T = T;
|
||||
readonly task = input<TaskWithSubTasks>();
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue