129 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
5a55b59939
diagnostics, help: Link to diagnostics page logs in 500 error page
Closes: #2414.

- Remove separate implementation for showing logs in help page.

- Add link to the page in diagnostics app so that FreedomBox logs can more
easily be discovered by users.

Tests:

- Raise an exception in the common error middleware to cause a 500 internal
server error. Run FreedomBox service with the --develop option and notice that
500 error page is served. There, the link to logs page works. It shows the logs
for Diagnostics app.

- Diagnostics page description is update. Link to logs page works.

- Diagnostics page shows logs for plinth.service and freedombox-develop.service.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2025-09-18 16:35:23 +03:00
Sunil Mohan Adapa
89bce7a344
app: Add tags to menu and frontpage components
- Add typing information for init methods Info, Shortcut, and Menu to easily
  identify problems.

- Update docstrings for these components.

- Updates test cases to deal with tags instead of short description.

- Update custom shortcuts code to read tags and ignore short description.

- Update API to send tags instead of custom shortcuts.

- OpenVPN special treatment of info.description in Shortcut

Tests:

- All unit tests pass and type checking succeeds.

- All apps show icons with tags in apps and system section.

- In help section cards don't show tags.

- In front page, enabled apps show shortcuts with tags.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2025-01-09 21:08:10 +05:30
Sunil Mohan Adapa
407fccba2f
ui: Handle and show most page load errors as alerts
- In addition to the OperationalError, also handle all generic exceptions during
page submit and page load. Redirect to the same page or parent using
breadcrumbs.

- Log exceptions handled by common error middleware so that they are also part
of the system logs.

- Update kiwix test as needed.

- Refactor some test code that is setting up the menu items.

Tests:

- When an error occurs during form POST, the same page is show but with an error
message.

- When an error occurs in an app page during GET, the browser is redirected to
the parent section.

- When an error occurs in apps page during GET, the browser is redirected to the
home page.

- When an error occurs in home page during GET, the error is not handled and
default 500 handle is triggered.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-29 17:16:06 +02:00
Sunil Mohan Adapa
4e900be128
ui: Show breadcrumbs on deeper pages
- Don't show them on section pages: home, apps, system and help pages.

- Tweak the appearance so that home icon is bigger, spacing between crumbs is
larger and to use '>' as separator.

- Change the name of the help menu item to show the value in breadcrumbs.

- Change the URLs for anchors in the help page so that they don't appear as part
of the breadcrumbs.

Tests:

- Section pages: home, apps, system and help pages don't have breadcrumbs.

- Visit various pages. Breadcrumbs are shown and all the links in the
breadcrumbs work as expected.

- Mobile view looks good.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-25 12:25:05 +02:00
Sunil Mohan Adapa
e523a83f1a
i2p: Drop app as it has not been available in Debian for a while
Closes: #1528.
Closes: #2041.
Closes: #2438.

- In Bullseye and Bookworm the app is not available.

- i2pd (written is C++) is available in Debian, but it is not a drop-in
replacement for i2p. First, it is only a client. Then has a differently
philosophy of not integrating apps inside it and let outside apps connect to it.
If i2pd is ever added to FreedomBox, it has to be added as a new app with no
possibility of migration from an unlikely old setups.

- Updated wiki pages to remove references to I2P.

Tests:

- Looked for all string references to 'i2p'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-12-16 21:09:40 -05:00
Sunil Mohan Adapa
95ecf36152
ui: Rename data- attributes to data-bs- for Bootstrap 5
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-12 12:48:54 +02:00
Sunil Mohan Adapa
62dad9336b
ui: Use Bootstrap 5 styling for all alerts
- Ensure that .sr-only is replaced with newer classes.

- Ensure that icons are present for all alerts.

- Use flex-box for display of icons on the left center of the alert.

- .close has been renamed to .btn-close.

- &times; is no longer required for close buttons.

Tests:

- Visually verify all the changes by triggering them with code changes.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-12 12:38:01 +02:00
Sunil Mohan Adapa
ce2f54cc77
help: Update the privacy notice on status log page
- We no longer print any passwords in the logs. Remove the wording in the notice
that indicates that we do.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2024-12-12 12:36:31 +02:00
Sunil Mohan Adapa
b346169312
help: Add a class to the help index page
- So that the page appearance can be easily customized in CSS.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-12-01 16:47:29 -05:00
Sunil Mohan Adapa
6084b95a65
help: Add all footer links to about page
Fixes: #2464.

- This page will act as replacement for the footer links in the home page.

- Remove link to FreedomBox Foundation and add link to Weblate project. We
already have a donate link to the foundation website.

Tests:

- About page is shown as expected. Old 'Learn more' button is no more. So is the
last paragraph.

- Styling is as expected. All the section have equal width.

- All links work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-11-02 21:20:13 -04:00
Sunil Mohan Adapa
62e67c6c99
help: Make about page available to unauthenticated users
- This page will replace the rather large footer in the front page.

Tests:

- Log out. Visit the help about page. It is available without redirection to
login page. Version related alert is not shown.

- Log in. Visit the help about page. It is available. Version related alert is
shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-11-02 21:20:10 -04:00
Sunil Mohan Adapa
f6fbb2f021
help: tests: Fix tests failing due to tags related changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-10-18 19:16:41 -07:00
Sunil Mohan Adapa
079b4324f6
help, system: Stop using submenu.sorted_items
- This fixes a regression in showing menu items on the help:index page.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2024-10-16 21:08:03 -07:00
Sunil Mohan Adapa
f9b186e14f
*: Add type hints for app init methods
- This is so that the methods will be checked by mypy. This should help identify
any incorrect initialization of components.

- Remove unused self.repos in GitwebApp.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-03-09 14:22:14 -05:00
Sunil Mohan Adapa
8202b734a6
help: tests: Run tests using doc in current dir instead of /usr
- This prevents the test from failing if install has not run yet.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2024-02-12 19:16:59 -05:00
Sunil Mohan Adapa
40eecb6446
*: Move modules-enabled files to /usr/share
- This will leave /etc/{plinth,freedombox} empty by default making service more
robust to run across various environments and situations. See systemd's
explanation for more details.

- Use Debian maintainer scripts remove all the existing files in
/etc/plinth/modules-enabled.

- Read from /usr/share/freedombox/modules-enabled then from
/etc/plinth/modules-enabled and finally from /etc/freedombox/modules-enabled.
Later read ones override previously read files. Any file pointing to /dev/null
will mean the module must be ignored.

Tests:

- Clean up /etc/plinth, /etc/freedombox and
/usr/share/freedombox/modules-enabled. Run service and notice that files are
getting loaded from development folder using a debug message.

- Run setup.py and notice that files get installed in
/usr/share/freedombox/modules-enabled/ and in the next run they get loaded from
there.

- Create a override file in /etc/plinth/modules-enabled/transmission and notice
that overriden file gets priority over the one in
/usr/share/freedombox/modules-enabled.

- Link the file /etc/plinth/modules-enabled/transmission to /dev/null and notice
that is not loaded.

- Create another file in /etc/freedombox/modules-enabled/transmission and notice
that it overrides the previous two files.

- All affected modules are loaded.

- Build a new Debian package and ensure that upgrading 23.8 to new version
removes are all configuration files.

- Build developer documentation and test that Tutorial -> Full Code and Tutorial
-> Skeleton sections have been updated with references to
-.../modules-enabled/... paths.

- Install quassel and notice that certificates were copied to /var/lib/quassel
directory. Change domain to another domain and notice that certificates were
copied again to that directory.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-05-13 07:08:43 -04:00
James Valleroy
119ab20c17
help: Add information on obtaining source code
Closes: #49.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Place the paragraph higher with the rest of them]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-05-08 12:19:54 -07:00
Sunil Mohan Adapa
1027b624aa
help: Use privileged decorator for actions
Tests:

- Functional tests work
- Accessing help/status-log/ works and last 100 logs lines are shown.
  - When there are no logs, '--no entries--' message is shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:52:05 -04:00
Sunil Mohan Adapa
900c0d30b9
*: Drop module level app property
module.app property usage is greatly reduced because setup() and force_upgrade()
method are now part of App class instead of at the module level. Remove the
remaining minor cases of usage and drop the property altogether.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-15 10:36:29 -04:00
Sunil Mohan Adapa
f6ef0135d2
*: Add setup method on all apps that don't have it
This is needed for the apps to get enabled soon after installation. In case of
'sharing' app, a shortcut will appear on the apps page. This also brings
uniformity to help later refactoring.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-15 10:36:19 -04:00
Sunil Mohan Adapa
6db1029d27
help: tests: Fix about page test by mocking version calls
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-08-01 16:01:20 -07:00
Sunil Mohan Adapa
9647b00278
help: Update test for contribute view
- Verify that issue data is sent in context properly.

- Ensure that an external request is not made during testing.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-08-01 15:44:10 -07:00
James Valleroy
e5a866dd64
help: Add "How can I help?" section to Contribute page
This doesn't use the how-can-i-help package, but it is a similar
implementation that fetches the same data from udd.debian.org.

There are sections for the following issues:
- Packages that will be removed from Debian testing
- Packages that are not in Debian testing
- Good first issues for beginners
- Issues for which the package maintainer has requested help

The overall "How can I help?" section is collapsed by default.

Test:
- View the page in stable and testing container.
- Run help functional tests.

Closes: #536

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Minor indentation fix]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-08-01 14:09:47 -07:00
Sunil Mohan Adapa
668da20a02
mldonkey: Drop app not available in Debian Bullseye and Bookworm
Closes: #2157.

Original author of the app J. Carlos Romero <juancarlos.romero@gmail.com> has
been contacted to see if there is interest in continuing to maintain the app.
There has been no response.

Since the app is not available even in the current stable (Bullseye), few users
are presumably using it on a supported FreedomBox distribution. Any users are
advised to maintain the manually instead of relying on FreedomBox for it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-01-22 11:55:34 -05:00
Sunil Mohan Adapa
2e2a9db195
help: tests: Fix functional test to check for status logs
Fixes: #2171.

Since systemd version 250, journalctl does not print the header line '-- Journal
begins... --'. To accommodate those changes, read the status log lines
accurately and check that they are not empty.

Tests:

- Run help functional tests on stable, testing and unstable.

- Modify code to not print status logs and notice that the functional test
fails.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-01-17 11:15:59 -05:00
Sunil Mohan Adapa
03a805888d
help: Fix failing setup when manual directory is not available
- It is reported on the mailing list that first setup operation on the help app
fails. The logs indicate that /usr/share/freedombox/manual directory is not
present on the system. Although this situation does not occur on a normal
installation, catch, log and ignore this error to be safe.

- Also ensure that this static files component is added in post_init so that
basic setup is not at all affected by it.

Tests:

- In the development directory, move doc/manual to doc/manual.bak. Observe that
the error message is printed during initialization but the process continues.

- With the manual directory properly restored, the full help manual is displayed
properly with images.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-01-11 17:52:25 -05:00
Joseph Nuthalapati
ce5274d9ee
monkeysphere: Drop app as it is not being used
Closes #2157.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Split diaspora and tahoe-lafs into separate commits]
[sunil: Remove monkeysphere from help/tests/test_views.py]
[sunil: Add to configuration file removal in Debian package and setup.py]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-12-20 15:09:50 -08:00
Sunil Mohan Adapa
a3d4d99b33
*: Drop use of module level version
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-04 16:38:08 -05:00
Sunil Mohan Adapa
cf36a9d385
*: Drop use of module level is_essential flag
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-12-04 16:37:59 -05:00
Fioddor Superconcentrado
aef0dcd381
test: help: Add help view tests
Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Yapf and isort, flak8 warnings, spelling]
[sunil: Drop debugging code]
[sunil: Use pytest parametrize, skip marks]
[sunil: Minor test improvements]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-09-27 15:10:07 -07:00
James Valleroy
19fb965237
help: Convert functional tests to non-BDD python format
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-09-26 14:37:05 -07:00
Sunil Mohan Adapa
cd2b2f5f2c
*: Use django.urls.re_path() instead of its alias url()
- In Django 2.2 django.conf.urls.url() is an alias to django.urls.re_path().

- In Django 4.0, url() function will be removed. On Django 3.2, it throws a
warning that this function will be removed in future.

Tests:

- Run unit tests with Django 3.2 and Django 2.2.

- With Django 3.2 there are no warnings when running unit tests and when running
FreedomBox Service.

- Visit a few affected apps with both Django versions.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-09-20 16:50:47 -04:00
Sunil Mohan Adapa
74214c18ae
*: Use Django gettext functions instead of ugettext
- ugettext functions will be removed in Django 4.0. Each use emits a warning
when running with Django 3.2. Since we have warnings enabled in developer mode,
we see quite a few messages because of this.

- ugettext is already a simple alias of gettext. So, no regressions are
expected.

Tests:

- Accessing an affected app in UI with Django 3.2 and Django 2.2 works fine.

- Using Django 3.2 there are no warnings related to removal of ugettext
functions.

- Ran regular unit tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-09-20 16:50:16 -04:00
James Valleroy
925903e72b
help: Update status log test
Check for either "Logs begin" (stable) or "Journal begins" (testing/unstable).

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-12-19 13:41:26 -08:00
Sunil Mohan Adapa
30aae90030
help: Show version information as an alert
- Move the message to the top as it is important and a likely reason to visit
the about page.

- Turn it into an alert so that it stands out from the rest of the text. Success
when up-to-date, warning otherwise.

- Remove custom inline styling.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:53 +02:00
Sunil Mohan Adapa
0e09d08d17
help: Split CSS styling into a separate file
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:51 +02:00
Sunil Mohan Adapa
858d005b87
help, power, index: ui: Drop remaining uses of &raquo;
- Mostly for consistency with the rest of the interface.

- Most of the usages got removed already.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:39 +02:00
Sunil Mohan Adapa
f2c40d8319
help: Make the button normal size in about page
- The regular buttons are slightly bigger in Bootstrap 4 and convenient enough
for mobile interfaces.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:38 +02:00
Sunil Mohan Adapa
f4a48f3e36
ui: css: Use rem as the primary unit
- When the base font size is changed, all the measure will scale appropriately.

- Bootstrap 4 has done the same.

- Keep using px for responsive lengths and some border widths that need not
scale.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:34 +02:00
Fioddor Superconcentrado
792c2cd00f
help: Link to updates page when new version is available
Closes: #1332.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Simplify the message for link to upgrade page]
[sunil: Use url method instead of hard-coded path]
[sunil: Cosmetic changes]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-19 16:57:34 -07:00
Fioddor Superconcentrado
f1f84a2509
upgrades: Add status section showing version and upgrade status
Closes: #1939.

- Force a delay before returning the upgrade result to allow upgrade to kick in.
Otherwise when the flow returns, get_context_data() creates the context too
early and finds the upgrade not yet busy, causing the refresh loop to miss it.
The page renders static and the user gets no clue to the upgrade executing in
the background.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Retain the styling for the remainder of the page]
[sunil: Re-style the status section as a simple web-page]
[sunil: Drop unused running-status CSS styles]
[sunil: Rename CSS variables, minor changes to color values]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-13 14:41:50 -07:00
Sunil Mohan Adapa
699266fdc1
help, networks: Clarify i18n different contexts for "Manual"
The word "Manual" means 'user guide' in case of help and 'not automatically' in
case of networking app.

After change, POT file is produced as follows:

msgctxt "User guide"
msgid "Manual"
msgstr ""

msgctxt "Not automatically"
msgid "Manual"
msgstr ""

Closes: #1922.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-08-22 10:52:32 +05:30
Joseph Nuthalapati
d92ca09e19
framework: Remove module init() functions
Fixes #1906

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-08-03 18:06:48 -04:00
James Valleroy
f41cc116a1
security: Move backports notice to security page
Move get_backports_in_use to upgrades.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-07-13 14:42:29 -07:00
Sunil Mohan Adapa
ac103d7132
*: Remove use of Turbolinks library
See #1841 for discussion on why Turbolinks needs to be removed.

Closes: #1841.
Closes: #1804.

Tests performed:

- There are no more references to 'turbolinks' in source code other than .po(t)
  files and the manual.

- When loading a page, turbolinks.js is no longer loaded.

- The following links don't have data-turbolinks attribute and work well when
  clicked.a
  - Gitweb repository links
  - Download manual links (en, es)
  - Ikiwiki wiki links
  - Sharing app web share links
  - TT-RSS mobile app link
  - 'Launch web client' button
  - 'Launch' button in web section of clients table
  - Active and regular front page shortcut

- Roundcube does not have a link to /roundcube in description.

- turblinks not present in /static/jslicense.html . LibreJs accepts all scripts.

Reported-by: Veiko Aasa <veiko17@disroot.org>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-03 10:29:19 +03:00
Sunil Mohan Adapa
80dff7bf9c
tests: functional: Re-organize step definitions and helper methods
- Move non-reusable app specific step definitions and helper methods into
<app>/tests/test_functional.py.

- Merge reusable helper methods into plinth.tests.functional

- Merge reusable step definitions into plinth.tests.functional.step_definitions

- avahi, datetime, ikiwiki: Reuse common methods to avoid repetition. Avoid
mapping from app nicknames to actual app names.

- deluge, transmission: Make a copy of sample.torrent for each app to avoid
clogging common place.

- Implement functional.visit() to simplify a lot of browser.visit() calls.

- Ensure that name of the mark on functional tests for an app is same as name of
the app. This will help with predicting the mark when running tests for a
particular app.

Tests performed:

- Run all functional tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-22 22:52:40 +05:30
Sunil Mohan Adapa
80d67c2054
tests: functional: Merge into main source hierarchy
- Add pytest hooks to ignore all functional tests if pytest_bdd is not
installed.

- Update pytest hooks to skip tests in file named 'test_functional.py' if
--include-functional argument is not provided.

- Move functional_tests/install.py into plinth/tests/functional and update
reference in Vagrantfile.

- Move scenario files into individual app folders. Rename them after the app
they are testing. Merge TODO items listed in todo.org into corresponding feature
files.

- Add test_functional.py in each app to build tests from the features file using
pytest_bdd.

- Move all step_definitions, support and data into plinth/tests/functional/.
Include all step_definitions from conftest.py. Update to relative imports
instead of absolute imports.

Tests performed:

- Run py.test-3 --collect-only shows all functional tests and lists 574 tests.
No errors show that name of feature files are correct. The number says that all
functional test features are included.

- Remove pytest_bdd (or modify the import name) and run py.test-3 --collect-only
skips collecting all functional tests and shows only 300+ tests.

- Run functional tests for a few apps with py.test-3 --include-functional -m
app. For storage, deluge.

- Run unit tests with py.test-3. Functional tests are listed by skipped.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-22 21:26:05 +05:30
Sunil Mohan Adapa
16202e6f3a
*: Update links to repository and project page
- The repository has been renamed from 'plinth' to 'freedombox'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2020-05-01 17:14:23 +05:30
Sunil Mohan Adapa
56250562d4
help: Move custom static file handling into app from central place
Tests performed:

- Print the calls to _mount_static_directory() before and after the changes.
They should print the same.

- With English as the preferred language, visit the user manual. Images should
be visible. Visit MediaWiki manual page with learn more link in MediaWiki.
Images should be visible.

- Repeat with Spanish as the preferred language.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-25 20:23:55 +02:00
Sunil Mohan Adapa
95d0923788
help: Rename views modules as 'views'
Tests performed:

- Visit help main view by visiting URL /plinth/help/.

- Visit pages: about, manual, get support, submit feedback, contribute.

- Download manual.

- Raise an exception in a view, visit the view in non-develop mode, see the
status log.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-06 13:08:08 +02:00