Skip to content

Commit

Permalink
Attempt to get description while create task
Browse files Browse the repository at this point in the history
  • Loading branch information
hardo committed May 20, 2020
1 parent 7b26710 commit 000fdfd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/content-scripts/@task-data-getters/@default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ import {CreateTaskData} from '../../types';
export function getDefaultTaskData(): CreateTaskData {
return {
brief: document.title.trim(),
outputs: [
{
name: 'metadata_source',
outputs: {
metadata_source: {
type: 'raw',
value: {
type: 'raw',
value: {
type: 'unknown',
url: location.href,
},
type: 'unknown',
url: location.href,
},
},
],
},
};
}
3 changes: 3 additions & 0 deletions src/content-scripts/@task-data-getters/@github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ export function getGitHubTaskData(): CreateTaskData | undefined {

let issueTitle = issueTitleElement?.textContent ?? document.title;

let issueDescription = document.querySelector<HTMLTextAreaElement>('textarea[name="issue[body]"]')?.value;

return {
brief: issueTitle.trim(),
description: issueDescription?.trim(),
outputs: {
'metadata_source': {
type: 'raw',
Expand Down
1 change: 1 addition & 0 deletions src/types/create-task-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export interface ValueDescriptor {

export interface CreateTaskData {
brief?: string;
description?: string;
outputs?: Dict<ValueDescriptor>;
}

0 comments on commit 000fdfd

Please sign in to comment.