Commit graph

2147 commits

Author SHA1 Message Date
Alberto Fernández Capel
dd2e9d7431 Remove unused var 2018-01-24 15:37:16 +00:00
Alberto Fernández Capel
f0777f996c Space editing sessions heartbeats with an increasing backoff
We send the first heartbeat as soon as the session start.
The next ones are sent (if there's any activity)
when the editing session is about 30 and 60 seconds.
Then at 2min, 3min, 4min, 5min and later on every 5min.

The backoff is not reset, so if due to inactivity the
session expires in the server the backoff will still be
the same.
2018-01-24 15:22:41 +00:00
Alberto Fernández Capel
8a1523cc03 Read project id from the global window var 2018-01-23 15:58:59 +00:00
Alberto Fernández Capel
b3b05d1af3 Disable the trailing throttle event in the editing session heartbeat
Throttle sends an event as soon as the function is called. Then
we wait X minutes, but we only want to send another event if
there's any activity *after* those X minutes.
2018-01-23 10:29:11 +00:00
Alberto Fernández Capel
0bef5531bb Rename editSession -> editingSession 2018-01-23 10:29:11 +00:00
Alberto Fernández Capel
868e32c1bc Send edit sessions heartbeat to the analytics service 2018-01-22 15:10:52 +00:00
Alberto Fernández Capel
1a1ccc9f46 Remove trailing whitespace 2018-01-22 15:00:56 +00:00
James Allen
6d04eeaa03 Merge pull request #256 from sharelatex/ja-display-v2-history-users
Inject v2 user details into project-history updates and diffs
2018-01-15 14:21:14 +00:00
James Allen
662122bb1c CI and local dev environment improvements
The need for this became very noticeable due to the slowness of filesystem access in docker-in-mac, with a full compile taking over a minute for me in docker. Using make to introduce incremental compile makes this near instantaneous outside of docker (if only a few files have changed), and quick enough inside docker.

With incremental compile via make, it compiles quickly enough that re-compiling and restarting the web service automatically when backend files change is quick enough now. This is how the service is run via docker-compose in https://github.com/sharelatex/sharelatex-dev-environment, so it shouldn't be necessary to manually restart the container each time a coffee file changes.

At the moment Jenkins pull web modules in via the GitSCM plugin, but I believe this is creating a dependency in Jenkins, where any commits to any of the modules causes all of the web branches to rebuild. By doing it via our own scripts we can hopefully avoid this. It also creates a build process which is reproducible locally.

**Note that at the moment in this PR all modules pull from `ja-dockerize-dev` branches, but these should be merged first, and this PR updated to point to the master branches before merging**. This is necessary for other changes to build process/docker-compose workflow.

As well as a Makefile for web, there is now a `Makefile.module`. This is copied into each module directory by the top-level Makefile, and is written in a way to be flexible and support unit tests, acceptance tests, front-end js for the ide and main, and the modules `app/coffee` directory, while allowing modules to have some of these missing (not all modules have e.g. acceptance tests, or front-end JS). This will allows us to refine the build process in future, without needing to update the Makefile in each module repo separately (I found this to be a painful part of this development).

This makes web compatible with the docker-compose workflow at https://github.com/sharelatex/sharelatex-dev-environment, where each service is running in its own docker container, with networking managed by docker.

Previously the Makefile was set up to run unit tests in docker with `make unit_tests`. This now just runs them natively. In the CI, they are run in docker anyway (all steps in Jenkins are), and locally, they run fine natively with `npm run test:unit`, or can be run in docker via https://github.com/sharelatex/sharelatex-dev-environment with `bin/run web_sl npm run test:unit`.

Previously we did a lot of juggling with only mounting source files (coffee, less, etc) into the docker container for acceptance tests. This was to avoid creating root owned files if the whole directory was mounted. Now instead the whole web directory is mounted read-only, with the compilation step done outside of the container before running the tests.

This allows the host and container to share the `node_modules` folder as well, which avoids needing to `npm install` twice on the CI box, and should speed up the build by a few minutes.

On macOS, this would cause a problem with compiled modules if you tried to use the same `node_modules` to run the app natively. However, if running via docker-compose in https://github.com/sharelatex/sharelatex-dev-environment, this is no longer a problem.
2018-01-15 09:36:41 +00:00
James Allen
17a5dfa5a5 Inject v2 user details into project-history updates and diffs 2018-01-11 11:32:16 +00:00
James Allen
0cf875bd0a Merge pull request #170 from sharelatex/pr-fix-link-rewriting
Enable HTML5 mode in Angular, to allow disabling link rewriting.
2018-01-11 08:42:29 +00:00
James Allen
79055d0e8d Merge pull request #243 from sharelatex/ja-dont-show-binary-diffs
Show apology message instead of raw binary files
2018-01-11 08:42:13 +00:00
Nate Stemen
c43aa54bee Merge branch 'ns-fix-package-command-meta' 2018-01-08 08:53:42 -05:00
Nate Stemen
7af615ff6c Merge branch 'ns-no-duplicate-packages' 2018-01-08 08:53:07 -05:00
Nate Stemen
cf4d6c1165 Merge branch 'master' into ns-no-duplicate-packages 2018-01-05 11:46:44 -05:00
James Allen
692182c784 Show apology message instead of raw binary files 2018-01-04 10:53:49 +00:00
James Allen
2dcc17ad09 Merge pull request #235 from sharelatex/ja-show-deleted-files-in-v2-history
Handle deleted and renamed files better in v2 history UI; Fixes #226
2018-01-03 11:29:59 +00:00
Nate Stemen
d2ee03d9b9 make commandNames object for fast lookups 2017-12-21 15:51:50 -05:00
James Allen
940b22ef95 Remove debug line 2017-12-20 16:42:09 +00:00
James Allen
d0fee7e76c Show a file tree of changed paths, so we can work with renamed and deleted files 2017-12-20 16:22:32 +00:00
Henry Oswald
ec41f984e6 Merge branch 'ho-remove-groove' 2017-12-20 13:37:15 +00:00
Paulo Reis
0a0c6c6c0c Merge branch 'master' into pr-style-v2-chatpane 2017-12-20 09:50:49 +00:00
James Allen
1d89a535a1 Merge pull request #208 from sharelatex/ja-front-end-history
Add in web front end that supports v2 history; Fixes #168
2017-12-19 15:00:34 +00:00
James Allen
b4a5e5a041 Tidy up HistoryV2Manager 2017-12-19 13:58:47 +00:00
James Allen
8a3fadbfc1 Style the edit/add/rename options 2017-12-19 13:58:47 +00:00
James Allen
50b12e88a2 Add HistoryV2Manager alongside existing HistoryManager 2017-12-19 13:58:47 +00:00
James Allen
8ea779af58 Add some front end tests for HistoryManager 2017-12-19 13:58:47 +00:00
James Allen
4691a6e85c Get diffs showing in client 2017-12-19 13:58:47 +00:00
James Allen
a1615e6d84 Prototype of requesting history information by doc path, while tracking renames 2017-12-19 13:58:47 +00:00
Brian Gough
388a052647 Merge pull request #213 from sharelatex/bg-allow-autocompile-without-code-check
allow autocompile without code check
2017-12-19 13:46:12 +00:00
Nate Stemen
685595ed0a remove comment 2017-12-19 08:44:19 -05:00
Shane Kilkelly
529d35936d Merge pull request #203 from sharelatex/sk-prevent-archived-deletion
Prevent user from trying to delete archived project they don't own
2017-12-19 13:36:26 +00:00
Paulo Reis
88d669cbb5 Remove debugging statements. 2017-12-19 10:52:17 +00:00
Alasdair Smith
f3342f327d Merge pull request #202 from sharelatex/as-v2-upgrade-redirect
Use V1 trial page on V2 instead of legacy SL
2017-12-19 10:07:08 +00:00
Nate Stemen
7d5c661b4e make command names local array 2017-12-15 11:10:44 -05:00
Alasdair Smith
da2c0b3fea Switch redirectToOLFreeTrialUrl to calculate trial url
Sending unnecessary query params to OL seems like a footgun, so switch to
compromise that is more explicit but doesn't send unnecessary query params
2017-12-14 17:09:11 +00:00
Alasdair Smith
7322522323 Use freeTrialBaseUrl instead of potentially fragile v1BaseUrl 2017-12-14 17:05:12 +00:00
Brian Gough
8d91cd2748 allow autocompile without code check 2017-12-14 16:19:43 +00:00
Shane Kilkelly
b6d6ac8304 Ignore select-all events for disabled check-boxes 2017-12-14 16:18:01 +00:00
Henry Oswald
cbf656518f remove versioned files from fingerprinting 2017-12-14 11:24:47 +00:00
Paulo Reis
c03ce6fdf7 Configure chat messages colors per brand. 2017-12-14 11:24:05 +00:00
Paulo Reis
ca68f01a9d Build chat message styles on the controller side (allowing for extra parameters). 2017-12-14 11:23:22 +00:00
Henry Oswald
490c56c692 libs -> libraries
don't use hash in non minjs version
2017-12-13 17:15:44 +00:00
Alasdair Smith
b7a43d95e0 Remove unused method, now handled by FreeTrialModalController 2017-12-13 15:55:32 +00:00
Alasdair Smith
e7992e65e4 Merge branch 'master' into as-v2-upgrade-redirect 2017-12-13 14:45:51 +00:00
Alasdair Smith
4c81cd874f Remove unnecessary method - handled by FreeTrialModalController 2017-12-13 11:09:46 +00:00
Nate Stemen
618f04ea7a allow package manager to have access to metadata 2017-12-12 15:14:24 -05:00
Nate Stemen
68b57f8d95 check current commands against package commands 2017-12-12 14:33:11 -05:00
Shane Kilkelly
603252f3b4 Prevent user from trying to delete archived project they don't own
This change disables the select-project checkbox if the user
is on the 'archived' project pane and they don't own the project.
The request to delete would fail anyway, but this prevents UI confusion
2017-12-12 16:23:24 +00:00
Alasdair Smith
f5c914ed6c When upgrading track changes on V2, redirect to V1 trial page 2017-12-11 18:03:09 +00:00