From cd81c42abb9ec01b9a332de4d88ac817436380b5 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 30 Jun 2017 10:46:19 -0700 Subject: [PATCH] Link PRs in changelog --- app/package.json | 2 +- app/ui/components/modals/changelog-modal.js | 24 ++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/app/package.json b/app/package.json index 230c68f2357..22c9ee095a5 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "insomnia", - "version": "5.4.0", + "version": "5.5.2", "productName": "Insomnia", "longName": "Insomnia REST Client", "description": "Debug APIs like a human, not a robot", diff --git a/app/ui/components/modals/changelog-modal.js b/app/ui/components/modals/changelog-modal.js index 2a56e845d5d..1412caff00d 100644 --- a/app/ui/components/modals/changelog-modal.js +++ b/app/ui/components/modals/changelog-modal.js @@ -97,12 +97,30 @@ class ChangelogModal extends PureComponent { ]; } + const printThing = (text, key) => { + const match = text.match(/\(PR:(\d+)(:([^)]+))?\)/); + let link = null; + if (match) { + const prNumber = match[1]; + const user = match[3] || ''; + text = text.replace(match[0], ''); + link = ( + + #{prNumber} + {user ? ` by ${user}` : null} + + ); + } + + return
  • {text}{link && '('}{link}{link && ')'}
  • ; + }; + if (change.major && change.major.length) { html = [ ...html,

    Major

    , ]; } @@ -112,7 +130,7 @@ class ChangelogModal extends PureComponent { ...html,

    Bug Fixes

    , ]; } @@ -122,7 +140,7 @@ class ChangelogModal extends PureComponent { ...html,

    Minor

    , ]; }