Skip to content

Commit

Permalink
chore: jira meta data
Browse files Browse the repository at this point in the history
  • Loading branch information
lazerblasters committed Sep 22, 2021
1 parent 00cbd4f commit 3ee2b49
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export default function App() {
JIRAComponents.JIRAIssueTypes,
JIRAComponents.JIRAAccountLinking,
],
meta: {
labels: ['test', 'this'],
},
}}
extraSource="react-native-image-crop-picker"
devNotes={async () => {
Expand Down
2 changes: 2 additions & 0 deletions src/integrations/JIRA/JIRA.types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { IPostJiraMeta } from './mutations/postJIRAIssue';
interface IOptional {
defaultValue?: string;
}
Expand All @@ -9,6 +10,7 @@ export interface JIRAIntegrationProps {
projectField?: IOptional;
issueTypeField?: IOptional;
order?: JIRAComponents[];
meta?: IPostJiraMeta;
}

export interface JIRAIntegrationValues {
Expand Down
1 change: 1 addition & 0 deletions src/integrations/JIRA/hooks/useJIRASubmission.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const useJIRASubmission = () => {
projectId,
issueTypeId,
description,
meta: jira.meta,
});
};

Expand Down
9 changes: 8 additions & 1 deletion src/integrations/JIRA/mutations/postJIRAIssue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,24 @@ export interface IPostJIRAIssueResponse {
self: string;
}

export interface IPostJiraMeta {
labels?: string[];
}

interface IPostJIRAIssueProps {
title: string;
projectId: string;
issueTypeId: string;
description: string;
meta?: IPostJiraMeta;
}

export const postJIRAIssue = ({
projectId,
issueTypeId,
description,
title,
meta,
}: IPostJIRAIssueProps) => {
const content = [];
content.push({
Expand All @@ -41,7 +47,8 @@ export const postJIRAIssue = ({
version: 1,
content,
},
labels: ['feedback-reporter'],
...meta,
labels: ['rnfr', ...(meta?.labels || [])],
},
});
};

0 comments on commit 3ee2b49

Please sign in to comment.