~girishm/op-mattermost

69d36b95edcfd489ad6b8396ca7cf2182d8a42c2 — girishm 10 days ago 77e07da + df2b8e4
update gitignore
4 files changed, 32 insertions(+), 6 deletions(-)

M .gitignore
M .idea/workspace.xml
M README.md
M test/utilTest.js
M .gitignore => .gitignore +2 -1
@@ 1,4 1,5 @@
.env
node_modules
workspaceConfig.code-workspace
.vscode
\ No newline at end of file
.vscode
.idea
\ No newline at end of file

M .idea/workspace.xml => .idea/workspace.xml +26 -1
@@ 24,9 24,13 @@
    <select />
  </component>
  <component name="ChangeListManager">
<<<<<<< HEAD
    <list default="true" id="3ee663f2-6582-4cac-8db5-1e1d8f9afff2" name="Default Changelist" comment="changed to MATTERMOST_BOT_TOKEN">
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
    </list>
=======
    <list default="true" id="3ee663f2-6582-4cac-8db5-1e1d8f9afff2" name="Default Changelist" comment="1. changed one year to 365 days in unit test 2. added donate button in README.md" />
>>>>>>> df2b8e402e57d33e1f94cda97876e9f679ca210b
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />


@@ 51,6 55,7 @@
  <component name="PropertiesComponent">
    <property name="ASKED_SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
    <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
    <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
    <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="dart.analysis.tool.window.visible" value="false" />


@@ 96,12 101,20 @@
      <workItem from="1606453035303" duration="8503000" />
      <workItem from="1606716976582" duration="295000" />
      <workItem from="1606734354948" duration="9000" />
<<<<<<< HEAD
      <workItem from="1608202445678" duration="5218000" />
      <workItem from="1608528055991" duration="1429000" />
      <workItem from="1608541436113" duration="816000" />
      <workItem from="1608624999857" duration="6568000" />
      <workItem from="1609130382762" duration="8995000" />
      <workItem from="1609912427368" duration="111000" />
=======
      <workItem from="1608202445678" duration="2975000" />
      <workItem from="1608274505797" duration="138000" />
      <workItem from="1608274660159" duration="2556000" />
      <workItem from="1608547408924" duration="22000" />
      <workItem from="1609741736021" duration="649000" />
>>>>>>> df2b8e402e57d33e1f94cda97876e9f679ca210b
    </task>
    <task id="LOCAL-00001" summary="webstorm code inspection - suggested fixes">
      <created>1604156310894</created>


@@ 152,7 165,14 @@
      <option name="project" value="LOCAL" />
      <updated>1608205395500</updated>
    </task>
    <option name="localTasksCounter" value="8" />
    <task id="LOCAL-00008" summary="1. changed one year to 365 days in unit test 2. added donate button in README.md">
      <created>1609742189215</created>
      <option name="number" value="00008" />
      <option name="presentableId" value="LOCAL-00008" />
      <option name="project" value="LOCAL" />
      <updated>1609742189215</updated>
    </task>
    <option name="localTasksCounter" value="9" />
    <servers />
  </component>
  <component name="TypeScriptGeneratedFilesManager">


@@ 178,6 198,7 @@
    <MESSAGE value="spent hours default value setting" />
    <MESSAGE value="new line in comments removed from time logs" />
    <MESSAGE value="changed to MATTERMOST_BOT_TOKEN" />
<<<<<<< HEAD
    <option name="LAST_COMMIT_MESSAGE" value="changed to MATTERMOST_BOT_TOKEN" />
  </component>
  <component name="WindowStateProjectService">


@@ 369,6 390,10 @@
      <screen x="0" y="356" width="1920" height="1173" />
    </state>
    <state x="755" y="660" width="399" height="568" key="git4idea.branch.GitSmartOperationDialog/0.356.1920.1173/1920.0.1200.1920@0.356.1920.1173" timestamp="1604157059512" />
=======
    <MESSAGE value="1. changed one year to 365 days in unit test 2. added donate button in README.md" />
    <option name="LAST_COMMIT_MESSAGE" value="1. changed one year to 365 days in unit test 2. added donate button in README.md" />
>>>>>>> df2b8e402e57d33e1f94cda97876e9f679ca210b
  </component>
  <component name="XSLT-Support.FileAssociations.UIState">
    <expand />

M README.md => README.md +2 -2
@@ 1,4 1,4 @@
# op-mattermost      ![Node.js CI](https://github.com/girish17/op-mattermost/workflows/Node.js%20CI/badge.svg)                                       
# op-mattermost      ![Node.js CI](https://github.com/girish17/op-mattermost/workflows/Node.js%20CI/badge.svg)  [![Donation](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/GirishModiletappa)                                     

[OpenProject](https://www.openproject.org/) integration for [Mattermost](https://mattermost.com/). Currently, supports following operations using a slash command -
- Create time entry for a work package


@@ 45,7 45,7 @@
    - `MATTERMOST_ACCESS_TOKEN=<personal access token>        #https://docs.mattermost.com/developer/personal-access-tokens.html`
    - `MATTERMOST_SLASH_TOKEN=<use the mattermost slash command token for logtime>  #needed for slash command validation`
    - `OP_ACCESS_TOKEN=<openproject access token (a.k.a apikey) obtained from user account page>`
- In the project root directory do `npm init` to generate (or update existing) package.json file
- In the project root directory do `npm init` to generate (or update existing) `package.json` file
- Then run `npm install` to download and install the node modules from npm
- Run op-mattermost in the console using `npm start` (usually launches on port 3000)
- Create a custom Mattermost slash command `/op` as described [here](https://docs.mattermost.com/developer/slash-commands.html) and provide localhost or IP address (with port 3000) as the request URL

M test/utilTest.js => test/utilTest.js +2 -2
@@ 53,8 53,8 @@ describe('Tests for util class', () => {

        let moment = require('moment');

        it('true when date within last one year', () => {
            let dateWithinOneYear = moment().subtract(1, 'year').format('YYYY-MM-DD').toString();
        it('true when date within last one year i.e. 365 days', () => {
            let dateWithinOneYear = moment().subtract(365, 'day').format('YYYY-MM-DD').toString();
            assert.equal(util.checkDate(moment, dateWithinOneYear), true);
        });