Commit Graph

2417 Commits

Author SHA1 Message Date
Dawa Ometto 5dd31e32c6 Update gollum.gemspec 2022-09-27 10:24:51 +02:00
Dawa Ometto 869292ed1e Expect error related to mathjax.conf 2022-09-22 11:40:10 +02:00
Dawa Ometto 5ed777834d Fix locale location 2022-09-22 11:40:10 +02:00
Dawa Ometto 0098e9187a Only require uglifier when precompiling 2022-09-22 11:40:10 +02:00
Dawa Ometto e7b324f9ff Make gollum executable 2022-09-22 11:40:10 +02:00
Dawa Ometto c48c7dab0b Run capybara tests against dockerized instance 2022-09-22 11:40:10 +02:00
benjamin wil aac6c9da70 Remove dead link from Markdown help pane
In the editor, the help text for "Emoji" included a dead link. This
changes the link to a non-dead link.

After changing the JS, assets needed to be recompiled.

Resolves #1775.
2022-09-21 19:19:07 -07:00
benjamin wil af570a97e3 Test the help panel's "Emoji" section
This test is passing. I wrote it so I can safely change this panel in a
subsequent commit.
2022-09-21 19:19:07 -07:00
benjamin wil 193f449058 Make help button more accessible
Using an `aria-label` for buttons without text is a good practice.

This lets users who use screenreaders better understand what this button
is for.
2022-09-21 19:19:07 -07:00
Dawa Ometto 5b02a864e6 Add support for Mermaid. Resolves #1118. (#1834)
* Add Mermaid node package
* Add mermaid wiki setting and load mermaid conditionally
* Perform js error checks with mermaid active
* Precompile static assets
2022-09-13 12:00:49 +02:00
Dawa Ometto 22edcf7174 Remove --static option, rename --no-static to --development-assets (#1848) 2022-09-12 16:57:28 +02:00
Josh Soref 681c687ad9 spelling: version
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 3743346633 spelling: switching
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 0d5753f075 spelling: specifying
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref e7de92a6de spelling: simplistically
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 8bab196380 spelling: sensitive
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref eb08eb490d spelling: rendering
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 6d8e89b5fe spelling: overridden
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref c51562b738 spelling: nonexistent
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 5934697aa3 spelling: insensitively
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 83055d03f7 spelling: highlighter
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 231b1d108f spelling: differently
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 2a132bce16 spelling: compatible
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 734909229d spelling: committed
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref d50255c50d spelling: changes
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref ed16078c2d spelling: changelog
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref c983895870 spelling: boromir
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 590199ffb4 spelling: add
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref 6995e609f0 spelling: actually
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
Josh Soref e727098650 spelling: accepts
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-09-06 21:47:02 -06:00
benjamin wil f5766c81e7 Refactor keybinding tests
There was an order-dependent test failure that plagued a couple of my
recent pull requests:

    Failure:
    Default_keybindings#test_keybinding_unset
      [/home/runner/work/gollum/gollum/test/test_app.rb:1098]
    Minitest::Assertion: Expected: true
      Actual: false

This commit ensures that `default_keybinding` is set to `nil` before
each test, and that the first line of each test changes the
configuration to the setting under test explicitly.

I also refactored the teardown to `nil` out all instance values so
they'll all certainly be reset when the next set of tests is run.
2022-09-04 14:40:06 -07:00
benjamin wil 6814dfe997 Test localization for some views
In #1853, it was reported that some views are errorring out due to
missing translations. These tests exercise the translations for the
reported views.
2022-09-04 14:40:06 -07:00
benjamin wil ed9ef140ba Don't call nonexistent view method from I18n
The search view doesn't have a `#count` method, meaning this YAML
variable can't be filled properly.
2022-09-04 14:40:06 -07:00
benjamin wil 93c47caa4a Provide ENV to set a custom Chrome binary path
On my system, Chrome is not in the location that the
`Selenium::WebDriver` expects it to be by default. This configuration
setting lets a developer set the path to the Chrome binary explicitly if
necessary.
2022-09-04 14:40:06 -07:00
benjamin wil f15a72ce05 Extract Capybara setup to a helper file
Any Capybara-related test setup has been moved to `capybara_helper.rb`.
Now we just must require this file in order to run tests with Capybara.

I also moved the `#console_log` helper to this file to showcase how
other global helper methods could be defined in this file.
2022-09-04 14:40:06 -07:00
benjamin wil ce85301e70 Remove link to SauceLabs (#1846) 2022-08-15 11:05:38 +02:00
benjamin wil b0a1f8a004 Refactor test teardown
I saw a random (??) failure on the test on line 1098. This trivial chang
e just ensures that the configuration under test (the default
keybinding) is explicitly being set to `nil` after test runs.
2022-08-02 15:06:02 -07:00
benjamin wil 10ae969139 Refactor RSS view renderer
In issue #1815, it was reported that Gollum RSS feeds attempt to put
entire commit messages into a feed item's `<title>` element.

Given that commit messages can be many paragraphs long, this is not an
acceptable way to render a feed item title.

If a commit has many lines or paragraphs, we now put those inside the
`<description>` element as of this commit.

While I was editing this view, I decided it would be a good time to
increase test coverage, as this view renderer was not under test at
all. I also fixed a typo ("Commited" should say "Committed"). There are
implicit dependencies on other gems that provide the
`Gollum::Git::Commit`, `Gollum::Git::Actor`, and `Rugged::Commit`
classes here, so mocking out simple versions of their interfaces seemed
like the path of least resistance to setting up controllable tests.

I also removed some now-duplicated assertions from `test/test_app.rb`.
2022-08-02 15:06:02 -07:00
benjamin wil 738d6f6ec4 Start localizing the views (#1797)
* Internationalize `Views::Compare` templates

* Internationalize `Views::Error` templates

* Internationalize `Views::History` templates

* Internationalize `Views::LatestChanges` templates

* Internationalize `Views::Layout` templates

* Internationalize `Views::Overview` templates

* Internationalize `Views::Search` templates

* Reset I18n load path after I18n helper tests

* Create locale helper for global translations

There are some translation strings we should use across multiple views.
Instead of duplicating the translations, we can use a different locale
helper method, `#tt`, to get a hash of all available translations.

Then, in a partial view like `pagination.mustache`, we can render
translations regardless of what the current view class is.

This commit adds the necessary helper, tests, and uses the new method to
render translations on the `pagination.mustache` template, which is used
by many other view classes (latest changes, history, and search).
2022-07-30 17:01:05 -07:00
Dawa Ometto 98cb39347d Add integration tests with capybara (#1707)
* Add integration tests with capybara
* Add Rake task for running integration tests
* Don't include integration in default test task
2022-06-19 00:51:58 +02:00
Dawa Ometto a1406da44a Update test.yaml
Fix invalid `run` statement
2022-06-19 00:08:19 +02:00
Dawa Ometto 0d71655aa3 Update test.yaml
Add Selenium tests
2022-06-18 23:58:09 +02:00
Dawa Ometto ee512bdad5 Refactor logic for determining per page upload location. Resolves #1830 (#1831)
* Refactor logic for determining per page upload location. Add tests.

* Add per page upload test for  context
2022-06-18 22:31:26 +02:00
benjamin wil 738f8ed462 Start using Yarn to manage JavaScript dependencies (#1824)
* Start using `yarn` for vendor assets

Until this commit, Gollum has included JavaScript assets by committing
the source code to the `lib/gollum/public/gollum/javascript/` directory
and including them for compilation in the Sprockets asset manifest file
at `lib/gollum/public/gollum/javascript/app.js`. This has been a
reasonable way to deal with third-party JavaScript, but there are a few
downsides:

  - It's a burden to find out if JavaScript dependencies have been
    updated and require updating in Gollum.
  - It doesn't give us good visibility into the JavaScript dependencies
    required by our dependencies.
  - It forces us to commit external code to our repository, which can
    make our developer tools more difficult to configure or use. For
    example: when I search for key words in the repository using
    Ripgrep, I often get "garbage" results from minified JavaScript.

Managing JavaScript dependencies via a JS package manager can resolve
all of these issues.

This commit allows us to manage JavaScript dependencies using the Yarn
package manager for Node JS modules[1]. I chose Yarn over NPM for one
reason: Yarn is the JavaScript package manager that Rails uses by
default. So many Ruby developers will already be familiar with Yarn.

To demonstrate how this can change how we manage JS assets in Gollum,
I've configured Yarn and started to manage the `mousetrap` dependency
with it. I chose `mousetrap` to start because it's a smaller, mostly
uncomplicated dependency. I was easily able to manually test that
`mousetrap` is still working after re-compiling the assets.

Hopefully this gives anyone reading enough context to jump in and start
moving our third-party JS assets out of the codebase.

[1]: https://yarnpkg.com/

* Recompile assets

* Add dev environment setup info to CONTRIBUTING

Now that we require additional tooling to manage JavaScript
dependencies, it seemed reasonable to add more documentation around
setting up one's development environment.

* Don't compile assets without `yarn`-managed ones

If a developer compiled assets without first running `yarn install`, we
would get incomplete collection of up-to-date assets.

Let's ensure that the developer has all the required assets by enforcing
this in the precompile task they should be using to compile production
assets to begin with.
2022-06-06 15:52:26 +02:00
Dawa Ometto c52ad667da Merge branch 'fuzzylemma-configure-default-keybinding' 2022-05-26 13:16:55 +02:00
kyle tibbetts 9e722c5033 Add default keybinding flag. Resolves #1691 2022-05-26 13:16:09 +02:00
Dawa Ometto 9c2f8dfeba Release 5.3.0 v5.3.0 2022-05-25 11:24:19 +02:00
Dawa Ometto 8e35688b17 Release preparation: update readme, rakefile and changelog (#1788)
* Update README.md
* Add LATEST_CHANGES.md and release helpers
2022-05-24 16:27:39 +02:00
Paul Westcott 860e8b2ebd Restore the normalize check that appears to be inadvertantly removed (#1802)
* Add test for normalize on upload

Co-authored-by: Dawa Ometto <d.ometto@gmail.com>
2022-05-24 16:13:35 +02:00
benjamin wil 0d2ab11604 Include rdoc as a dependency (#1823)
We've had some reports (#1342, #1809) of `rdoc` not being installed
in some environments, causing Gollum to error in unpleasant ways.

This isn't an issue that's unique to Gollum, and I don't think `rdoc`
should actually be a hard dependency of this project.  But since we can
side-step the issue by requiring `rdoc`, something that most users who
install Gollum via RubyGems would already have installed, I don't think
this is a horrible solution.
2022-05-04 18:25:48 -07:00