Skip to content

Commit

Permalink
Merge pull request #19 from Whiterzi/main
Browse files Browse the repository at this point in the history
add missing constants, support link back to outlook
  • Loading branch information
jimmyshiau authored Jul 12, 2024
2 parents 0c74a14 + 57e4790 commit 3b7a7ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export const M_ERROR_NO_AUTH = "Failed to authenticate with Quire.";
export const M_ERROR_TOKEN_EXPIRED = "Token expired. Please log in again.";
export const M_ERROR_NO_AVAILABLE = "No available projects in current organization. Please create a project in Quire first.";

export const M_DESC_VIEW_IN_OUTLOOK = "View in Outlook";

// urls
export const CLIENT_ID = process.env.CLIENT_ID;
export const CLIENT_SECRET = process.env.CLIENT_SECRET;
Expand All @@ -36,11 +38,13 @@ export const REDIRECT_URI = `${HOST_URL}/callback.html`;
export const QUIRE_URL = process.env.QUIRE_URL;
export const AUTH_URL = `${QUIRE_URL}/oauth?client_id=${CLIENT_ID}&redirect_uri=${REDIRECT_URI}`;
export const HELP_URL = "https://quire.io/apps/outlook-add-in";
export const OUTLOOK_INBOX_URL = "https://outlook.live.com/mail/0/inbox/id/"

// keys
export const KEY_TOKEN = "token";
export const KEY_REFRESH = "refresh_token";
export const KEY_CURUSER = "current_user";
export const KEY_DEFAULT_PROJECT = "default_project";

//styles
export const COLOR_PRIMARY = "#05843E";
Expand Down
4 changes: 3 additions & 1 deletion src/taskpane/pages/createTaskView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,14 @@ const CreateView: React.FC<CreateTaskProps> = (prop: CreateTaskProps) => {
const desc = asPlainText.current ?
turndownService.turndown(description) : description;

const outlookUrl = m.OUTLOOK_INBOX_URL + encodeURIComponent(Office.context.mailbox.item.conversationId);

const task = new Task(
taskName as string,
dueDate.current,
getSplitValueList(assignees),
getSplitValueList(tags),
desc);
desc + `\n---\n[${m.M_DESC_VIEW_IN_OUTLOOK}](${outlookUrl})`);

await createTask(task, projectOid.current)
.then((taskUrl) => {
Expand Down

0 comments on commit 3b7a7ad

Please sign in to comment.