Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Integrate with Azure Devops #2388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/core/theme/global-theme.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class GlobalThemeService {
['sp', 'assets/icons/sp.svg'],
['play', 'assets/icons/play.svg'],
['github', 'assets/icons/github.svg'],
['azuredevops', 'assets/icons/azuredevops.svg'],
['gitlab', 'assets/icons/gitlab.svg'],
['jira', 'assets/icons/jira.svg'],
['caldav', 'assets/icons/caldav.svg'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
></github-issue-content>
</ng-container>

<ng-container *ngIf="task?.issueType===AZUREDEVOPS_TYPE">
<azuredevops-issue-content
[issue]="issueData"
[task]="task"
></azuredevops-issue-content>
</ng-container>

<ng-container *ngIf="task?.issueType===REDMINE_TYPE">
<redmine-issue-content
[issue]="issueData"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
GITHUB_TYPE,
REDMINE_TYPE,
GITLAB_TYPE,
AZUREDEVOPS_TYPE,
JIRA_TYPE,
OPEN_PROJECT_TYPE,
} from '../issue.const';
Expand All @@ -22,6 +23,7 @@ export class IssueContentComponent {
@Input() issueData?: IssueData;
readonly GITLAB_TYPE: string = GITLAB_TYPE;
readonly GITHUB_TYPE: string = GITHUB_TYPE;
readonly AZUREDEVOPS_TYPE: string = AZUREDEVOPS_TYPE;
readonly REDMINE_TYPE: string = REDMINE_TYPE;
readonly JIRA_TYPE: string = JIRA_TYPE;
readonly CALDAV_TYPE: string = CALDAV_TYPE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<gitlab-issue-header [task]="task"></gitlab-issue-header>
</ng-container>

<ng-container *ngIf="task?.issueType===AZUREDEVOPS_TYPE">
<azuredevops-issue-header [task]="task"></azuredevops-issue-header>
</ng-container>

<ng-container *ngIf="task?.issueType===CALDAV_TYPE">
<caldav-issue-header [task]="task"></caldav-issue-header>
</ng-container>
Expand Down
2 changes: 2 additions & 0 deletions src/app/features/issue/issue-header/issue-header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
GITEA_TYPE,
GITHUB_TYPE,
GITLAB_TYPE,
AZUREDEVOPS_TYPE,
REDMINE_TYPE,
JIRA_TYPE,
OPEN_PROJECT_TYPE,
Expand All @@ -21,6 +22,7 @@ export class IssueHeaderComponent {

readonly GITLAB_TYPE: string = GITLAB_TYPE;
readonly GITHUB_TYPE: string = GITHUB_TYPE;
readonly AZUREDEVOPS_TYPE: string = AZUREDEVOPS_TYPE;
readonly REDMINE_TYPE: string = REDMINE_TYPE;
readonly JIRA_TYPE: string = JIRA_TYPE;
readonly CALDAV_TYPE: string = CALDAV_TYPE;
Expand Down
11 changes: 11 additions & 0 deletions src/app/features/issue/issue.const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import {
JIRA_ISSUE_TYPE,
} from './providers/jira/jira.const';
import { IssueProviderKey } from './issue.model';
import {
DEFAULT_AZUREDEVOPS_CFG,
AZUREDEVOPS_CONFIG_FORM_SECTION,
} from './providers/azuredevops/azuredevops.const';
import {
DEFAULT_GITHUB_CFG,
GITHUB_CONFIG_FORM_SECTION,
Expand Down Expand Up @@ -36,6 +40,7 @@ import {

export const GITLAB_TYPE: IssueProviderKey = 'GITLAB';
export const GITHUB_TYPE: IssueProviderKey = 'GITHUB';
export const AZUREDEVOPS_TYPE: IssueProviderKey = 'AZUREDEVOPS';
export const JIRA_TYPE: IssueProviderKey = 'JIRA';
export const CALDAV_TYPE: IssueProviderKey = 'CALDAV';
export const OPEN_PROJECT_TYPE: IssueProviderKey = 'OPEN_PROJECT';
Expand All @@ -45,6 +50,7 @@ export const REDMINE_TYPE: IssueProviderKey = 'REDMINE';
export const ISSUE_PROVIDER_TYPES: IssueProviderKey[] = [
GITLAB_TYPE,
GITHUB_TYPE,
AZUREDEVOPS_TYPE,
JIRA_TYPE,
CALDAV_TYPE,
OPEN_PROJECT_TYPE,
Expand All @@ -56,6 +62,7 @@ export const ISSUE_PROVIDER_ICON_MAP = {
[JIRA_TYPE]: 'jira',
[GITHUB_TYPE]: 'github',
[GITLAB_TYPE]: 'gitlab',
[AZUREDEVOPS_TYPE]: 'azuredevops',
[CALDAV_TYPE]: 'caldav',
[OPEN_PROJECT_TYPE]: 'open_project',
[GITEA_TYPE]: 'gitea',
Expand All @@ -66,6 +73,7 @@ export const ISSUE_PROVIDER_HUMANIZED = {
[JIRA_TYPE]: 'Jira',
[GITHUB_TYPE]: 'GitHub',
[GITLAB_TYPE]: 'GitLab',
[AZUREDEVOPS_TYPE]: 'Azure DevOps',
[CALDAV_TYPE]: 'CalDAV',
[OPEN_PROJECT_TYPE]: 'OpenProject',
[GITEA_TYPE]: 'Gitea',
Expand All @@ -76,6 +84,7 @@ export const DEFAULT_ISSUE_PROVIDER_CFGS = {
[JIRA_TYPE]: DEFAULT_JIRA_CFG,
[GITHUB_TYPE]: DEFAULT_GITHUB_CFG,
[GITLAB_TYPE]: DEFAULT_GITLAB_CFG,
[AZUREDEVOPS_TYPE]: DEFAULT_AZUREDEVOPS_CFG,
[CALDAV_TYPE]: DEFAULT_CALDAV_CFG,
[OPEN_PROJECT_TYPE]: DEFAULT_OPEN_PROJECT_CFG,
[GITEA_TYPE]: DEFAULT_GITEA_CFG,
Expand All @@ -87,6 +96,7 @@ export const ISSUE_PROVIDER_WITH_CUSTOM_COMP = [JIRA_ISSUE_TYPE, OPEN_PROJECT_TY
export const ISSUE_PROVIDER_FORM_CFGS: ConfigFormConfig = [
GITLAB_CONFIG_FORM_SECTION as GenericConfigFormSection,
GITHUB_CONFIG_FORM_SECTION as GenericConfigFormSection,
AZUREDEVOPS_CONFIG_FORM_SECTION as GenericConfigFormSection,
REDMINE_CONFIG_FORM_SECTION as GenericConfigFormSection,
JIRA_CONFIG_FORM_SECTION as GenericConfigFormSection,
CALDAV_CONFIG_FORM_SECTION as GenericConfigFormSection,
Expand Down Expand Up @@ -121,6 +131,7 @@ export const ISSUE_STR_MAP: { [key: string]: { ISSUE_STR: string; ISSUES_STR: st
[JIRA_TYPE]: DEFAULT_ISSUE_STRS,
[GITHUB_TYPE]: DEFAULT_ISSUE_STRS,
[GITLAB_TYPE]: DEFAULT_ISSUE_STRS,
[AZUREDEVOPS_TYPE]: DEFAULT_ISSUE_STRS,
[CALDAV_TYPE]: DEFAULT_ISSUE_STRS,
[OPEN_PROJECT_TYPE]: {
ISSUE_STR: T.F.OPEN_PROJECT.ISSUE_STRINGS.ISSUE_STR,
Expand Down
10 changes: 10 additions & 0 deletions src/app/features/issue/issue.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ import { GiteaCfg } from './providers/gitea/gitea.model';
import { GiteaIssue } from './providers/gitea/gitea-issue/gitea-issue.model';
import { RedmineCfg } from './providers/redmine/redmine.model';
import { RedmineIssue } from './providers/redmine/redmine-issue/redmine-issue.model';
import { AzuredevopsCfg } from './providers/azuredevops/azuredevops.model';
import {
AzuredevopsIssue,
AzuredevopsIssueReduced,
} from './providers/azuredevops/azuredevops-issue/azuredevops-issue.model';

export interface BaseIssueProviderCfg {
isEnabled: boolean;
}

export type IssueProviderKey =
| 'JIRA'
| 'AZUREDEVOPS'
| 'GITHUB'
| 'GITLAB'
| 'CALDAV'
Expand All @@ -42,6 +48,7 @@ export type IssueIntegrationCfg =
| JiraCfg
| GithubCfg
| GitlabCfg
| AzuredevopsCfg
| CaldavCfg
| OpenProjectCfg
| GiteaCfg
Expand All @@ -58,6 +65,7 @@ export interface IssueIntegrationCfgs {
JIRA?: JiraCfg;
GITHUB?: GithubCfg;
GITLAB?: GitlabCfg;
AZUREDEVOPS?: AzuredevopsCfg;
CALDAV?: CaldavCfg;
OPEN_PROJECT?: OpenProjectCfg;
GITEA?: GiteaCfg;
Expand All @@ -68,6 +76,7 @@ export type IssueData =
| JiraIssue
| GithubIssue
| GitlabIssue
| AzuredevopsIssue
| CaldavIssue
| OpenProjectWorkPackage
| GiteaIssue
Expand All @@ -77,6 +86,7 @@ export type IssueDataReduced =
| GithubIssueReduced
| JiraIssueReduced
| GitlabIssue
| AzuredevopsIssueReduced
| OpenProjectWorkPackageReduced
| CaldavIssueReduced
| GiteaIssue
Expand Down
2 changes: 2 additions & 0 deletions src/app/features/issue/issue.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { GithubIssueModule } from './providers/github/github-issue/github-issue.
import { RedmineIssueModule } from './providers/redmine/redmine-issue/redmine-issue.module';
import { IssueIconPipe } from './issue-icon/issue-icon.pipe';
import { GitlabIssueModule } from './providers/gitlab/gitlab-issue/gitlab-issue.module';
import { AzuredevopsIssueModule } from './providers/azuredevops/azuredevops-issue/azuredevops-issue.module';
import { CaldavIssueModule } from './providers/caldav/caldav-issue/caldav-issue.module';
import { OpenProjectIssueModule } from './providers/open-project/open-project-issue/open-project-issue.module';
import { GiteaIssueModule } from './providers/gitea/gitea-issue/gitea-issue.module';
Expand All @@ -21,6 +22,7 @@ import { PollIssueUpdatesEffects } from './store/poll-issue-updates.effects';
GithubIssueModule,
RedmineIssueModule,
GitlabIssueModule,
AzuredevopsIssueModule,
CaldavIssueModule,
OpenProjectIssueModule,
GiteaIssueModule,
Expand Down
5 changes: 5 additions & 0 deletions src/app/features/issue/issue.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
REDMINE_TYPE,
GITHUB_TYPE,
GITLAB_TYPE,
AZUREDEVOPS_TYPE,
ISSUE_PROVIDER_HUMANIZED,
ISSUE_PROVIDER_ICON_MAP,
ISSUE_STR_MAP,
Expand All @@ -24,6 +25,7 @@ import { Task } from '../tasks/task.model';
import { IssueServiceInterface } from './issue-service-interface';
import { JiraCommonInterfacesService } from './providers/jira/jira-common-interfaces.service';
import { GithubCommonInterfacesService } from './providers/github/github-common-interfaces.service';
import { AzuredevopsCommonInterfacesService } from './providers/azuredevops/azuredevops-common-interfaces.service';
import { switchMap } from 'rxjs/operators';
import { GitlabCommonInterfacesService } from './providers/gitlab/gitlab-common-interfaces.service';
import { CaldavCommonInterfacesService } from './providers/caldav/caldav-common-interfaces.service';
Expand All @@ -41,6 +43,7 @@ export class IssueService {
ISSUE_SERVICE_MAP: { [key: string]: IssueServiceInterface } = {
[GITLAB_TYPE]: this._gitlabCommonInterfacesService,
[GITHUB_TYPE]: this._githubCommonInterfacesService,
[AZUREDEVOPS_TYPE]: this._azuredevopsCommonInterfacesService,
[JIRA_TYPE]: this._jiraCommonInterfacesService,
[CALDAV_TYPE]: this._caldavCommonInterfaceService,
[OPEN_PROJECT_TYPE]: this._openProjectInterfaceService,
Expand All @@ -52,6 +55,7 @@ export class IssueService {
ISSUE_REFRESH_MAP: { [key: string]: { [key: string]: Subject<IssueData> } } = {
[GITLAB_TYPE]: {},
[GITHUB_TYPE]: {},
[AZUREDEVOPS_TYPE]: {},
[REDMINE_TYPE]: {},
[JIRA_TYPE]: {},
[CALDAV_TYPE]: {},
Expand All @@ -64,6 +68,7 @@ export class IssueService {
private _taskService: TaskService,
private _jiraCommonInterfacesService: JiraCommonInterfacesService,
private _githubCommonInterfacesService: GithubCommonInterfacesService,
private _azuredevopsCommonInterfacesService: AzuredevopsCommonInterfacesService,
private _gitlabCommonInterfacesService: GitlabCommonInterfacesService,
private _caldavCommonInterfaceService: CaldavCommonInterfacesService,
private _openProjectInterfaceService: OpenProjectCommonInterfacesService,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
export type AzuredevopsQueryType = 'flat' | 'oneHop' | 'tree';

export type AzuredevopsCommentVersionRef = Readonly<{
commentId: number;
version: string;
url: string;
}>;

export type AzuredevopsWorkItemFields = Readonly<{
'System.WorkItemType': string;
'System.State': string;
'System.CreatedDate': string;
'System.ChangedDate': string;
'System.Title': string;
'System.Description': string;
}>;

export type AzuredevopsWorkItem = Readonly<{
id: number;
rev: number;
fields: AzuredevopsWorkItemFields;
url: string;
}>;

export type AzuredevopsGetWorkItemsResponse = Readonly<{
count: number;
value: AzuredevopsWorkItem[];
}>;

export type AzuredevopsWorkItemFieldReference = Readonly<{
referenceName: string;
name: string;
url: string;
}>;

export type AzuredevopsWorkItemQuerySortColumn = Readonly<{
field: AzuredevopsWorkItemFieldReference;
descending: boolean;
}>;

export type AzuredevopsWorkItemReference = Readonly<{
id: number;
url: string;
}>;

export type AzuredevopsWIQLSearchResult = Readonly<{
queryType: AzuredevopsQueryType;
asOf: string;
columns: AzuredevopsWorkItemFieldReference[];
sortColumns: AzuredevopsWorkItemQuerySortColumn[];
workItems: AzuredevopsWorkItemReference[];
}>;
Loading