36 Commits

Author SHA1 Message Date
Fioddor Superconcentrado
4b2162f3fd
setup: Show and remove conflicts before installation
Warn of installed conflicting packages before installing apps.

[sunil: Rename 'advice' to 'action']
[sunil: Action will be string constant, for better API and i18n]
[sunil: Don't show conflict warning if action is 'ignore']
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-10-10 19:22:19 -07:00
Veiko Aasa
34f74a285f
plinth: Show running spinner when app installation is in progress
Add running spinner before every app installation step text, this
makes the fact that installation is in progress visually more noticeable.

Tested when installing the mediawiki app, the running spinner is shown
on every installation step.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Horizontally align the text and spinner by the spinner inline]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-02-04 17:35:31 -08:00
Sunil Mohan Adapa
83c0adf6cf
ui: Avoid inline styling for setting progress bar width
- attr() CSS function can't used practically on anything but the content
property.

- Introduce a hack for setting any arbitrary percentage width on an element
similar to w-25, w-50, w-75 and w-100 bootstrap utilities. This hack should not
be used widely.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 16:26:54 +02:00
Fioddor Superconcentrado
d1f9f4bfcc
package: i18n: Mark progress status strings for translation
Help: #1938.

- package.py: ugettext_lazy applied to 'installing', 'downloading' and other
statuses.
- setup.html: trans function applied to "Check again" in template.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Mark remaining to status strings also]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2020-10-20 11:56:57 -07:00
Sunil Mohan Adapa
3efff2fa42
js: Simplify auto-refresh page logic
- Implement ability to refresh page at the framework level so that every page
does not need to handle it.

- Refresh after number of seconds specified in context of the view.

Tests performed:

- Trigger the following functions and ensure that page reload after 3 seconds
during the running operation while it does refresh before and after the
operation.
  - Diagnostics tests from the module.
  - Gitweb repository cloning.
  - Monkeysphere publish key to server.
  - OpenVPN setup.
  - Tor configuration update.
  - Manual software update.
  - App installation.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-06-29 10:09:04 +03:00
Sunil Mohan Adapa
176dc69fc5
tests: functional: Remove implicit and explicit wait times
- Splinter/selenium have implicit and explicit waiting time. Implicit wait time
will make every negative lookup wait for about 3 seconds before it actually
fails. Because we ensure missing elements in quite a few places, this introduces
many 3 seconds wait periods during testing. Remove it instead rely on explicit
waiting whenever needed.

- Explicit wait time is only used during explicitly requests waiting conditions.
In a loop the API waits for a maximum of timeout period until a given condition
is satisfied. Each time the condition is checked, it goes into sleep for
explicit wait period amount of time. This is typically a second or so. Since we
are impatient, make it 0.1 instead.

- Also make sure that whenever a page is visit()ed, we automatically wait until
the page is fully loaded by overriding the splinter wait condition. Otherwise,
we will need to introduce waiting code in a lot of places.

- Using document.readyState == complete is a better check to ensure that a page
is fully loaded. If we proceed with the page 'loading' or 'interactive' state,
we will have to change a lot of code to make it wait.

- Handle Apache restarts when waiting for page load. The error page apparently
is never reaches document.readyState == 'complete'. So, if an error page is
encountered, always reload.

- While waiting for installation, ensure that we atomically check that page has
loaded fully and the installation progress is not being shown. Otherwise, there
would be race condition due to installation page refreshing itself.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-06-20 10:43:01 -04:00
James Valleroy
746f7b07fc
templates: Fix setup state check
Closes: #1728.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2020-05-29 13:03:06 -07:00
Sunil Mohan Adapa
90d3736431
app: cosmetic: Rename header.html to app-header.html
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-23 08:31:29 -05:00
Sunil Mohan Adapa
e89e2b4a2a
*.html: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:39:19 +02:00
Sunil Mohan Adapa
b576a77c3d
app: Refactor all apps to use the Info component
- Remove the need to pass all the individual information elements to the AppView
  separately. This eliminates many issues with elements that were mistakenly not
  sent to AppView. Also reduces a lot of code duplication.

- Create App classes for power and sso for consistency.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-02-16 18:22:01 -05:00
Alice Kile
52a9673f69
fix: implement requested changes
- pass short_description to header.html include statement in templates/setup.html
- pass description to header.html include statement in
  modules/sharing/templates/sharing.html
- use `[]` instead of `None` for the initial value of description
  property in SetupView (plinth/views.py)
- add license info to header.html

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:53 -05:00
Alice Kile
ec6013b5bb
properly implement header in app and setup pages
- move header section to it's own file so that it can be imported across
  the app (app.html, simple_app.html, setup.html)

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:41 -05:00
Alice Kile
45b6aa6a1c
fix formatting and template-related issues
- remove unwanted spaces and line breaks
- use just an image instead of using figure and figure caption to
  display the icon in installation page
- eliminate unnecessary code duplication due to if condition

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:39 -05:00
Alice Kile
fa74a26042
use single variable for referencing icon filename
- add and use "icon_filename" property to almost all of the modules
  being displayed in the apps page
- sharing and tor modules do not seem to be using setup.html template
  file and so the variable is not added to their __init__.py files,
  therefore the icon will not be displayed on these app pages.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:33 -05:00
Alice Kile
f004939f50
show app icons in apps page
- restructure the template markup so as to show the icon towards the
  left of the app heading and description.
- if condition to provide backwards compatiblity to system apps using
  setup.html.
- deluge and matrixsynapse modules have a new property that will be used
  for accessing the icon file name. (to be replicated across all other
  modules *weew*)

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:25 -05:00
Alice Kile
52f6da2a41
templates: Add toolbar for apps in app.html
Changes to the app.html layout, mainly:

- A new panel is created to hold action buttons. Closes #1698.

- Launch button is now shown in the panel alongside "Client Apps".

- Run Diagnostics button is moved into this panel as well. Closes #1690.

- Disable 'Launch web client' button when app is disabled. Closes #1718.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-01 16:40:13 -05:00
Joseph Nuthalapati
eb91938963
help: Respect language preference when showing user manual
Retrieve the manual page or download PDF manual in user's preferred language.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil@medhas.org Merge URL format since view is the same]
[sunil@medhas.org Refactor language extraction]
[sunil@medhas.org Minor refactorings]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-30 19:25:06 -04:00
Sunil Mohan Adapa
b96d901071
Introduce component architecture and menu component
- Introduce base class for all apps that will contain components. With
  unittests.

- Introduce base classes for components. With unittests.

- Turn Menu class into an app component.

  - Further cleanup Menu class.

  - Update tests.

  - Maintain a global list of menu items and look them up easily. Generalize
    such that subsubmenus can later be merged into Menu class.

  - Cleanup scope of main menu initialization.

  - Use None instead of empty strings for various values. Ensure that
    printing short_description does not show 'None' in output.

  - Use enable/disable instead of promote/demote.

- Use menu component in all apps.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-06-07 11:48:04 -07:00
Prachi Srivastava
f43e185a8c
security: Moves inline javascript to files
Signed-off-by: Prachi Srivastava <prachi.chs.2009@gmail.com>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-01-28 17:39:12 -08:00
Prachi Srivastava
5d68f6bf52
Replace glyphicons with forkawesome icons
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-01-14 17:37:58 -08:00
James Valleroy
64036e2066
setup: Fix spelling error
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 17:43:02 -05:00
Sunil Mohan Adapa
915b8013d9
setup: Reduce refresh time when application is already installed
In the event setup page is being shown after the application installation is
already completed. Immediately reload instead of waiting for 3 seconds are
usual.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 17:40:26 -05:00
Sunil Mohan Adapa
de82f5002d
setup: Handle showing setup page after app completes installation
- During the rendering of the view, the state of installation may keep changing.
  This may lead to inconsistencies in the page. Avoid that by collecting the
  state once and then reusing that throughout the rendering process.

- During the time that setup middleware's checked of setup state of an app and
  rendering of app's setup view, if the setup process could get completed. This
  will lead to setup page being shown even after the application is installed.
  Handle this case and show a proper page instead of 'Submit Query' button on
  the page. Fixes #1360. This can be easily replicated by introducing a 10
  second sleep after setup middle checks of the application is 'up-to-date'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-01-14 17:40:02 -05:00
Joseph Nuthalapati
36774c9f41
turbolinks: Reload page using JavaScript
Using the existing meta tag for refresh as a noscript fallback.

Fixes #1350

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-08-12 08:43:11 -04:00
Joseph Nuthalapati
45138fcdf0
packages: Button to refresh package lists
- This is a fallback solution to manually refresh package lists on AWS images
  since they come with no apt package lists.
- This can also be occasionally useful for people running the testing
  distribution where packages might be frequently added and removed.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-07-02 19:30:13 -04:00
Joseph Nuthalapati
70b568d579
setup: Remove unavailable as a state in setup_helper
- Unavailable being a state can cause issues in several places in the where
  there are currently only checks for 'needs-setup'
- Since it's only used in the UI, a method to check whether a module is
  unavailable should be sufficient.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-05-19 08:06:44 -04:00
Johannes Keyser
3a9c4128ff
setup: disable install button for currently unavailable apps
- Fixes #1229.

Signed-off-by: Johannes Keyser <johanneskeyser@posteo.de>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-04-20 20:12:46 -04:00
Joseph Nuthalapati
41641491bb
UI: Fix progress bar not appearing
- Fixed a wrong CSS class name

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2018-04-09 21:09:34 +05:30
Joseph Nuthalapati
e99b7c942b
tests: Improve waiting for installation and configuration
- Use Selenium's built-in waiting constructs to wait for page loads to complete
- Make tests independent of language (tested in Chinese)

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-04-08 12:35:47 -04:00
Joseph Nuthalapati
4064d6e231
manual: Link to manual from each service
Closes #930

- Make targets to download wiki pages of each service

- Add post-processor script for DocBook file processing

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-03-22 19:49:14 -04:00
Sunil Mohan Adapa
dea4af17fb
Rename Plinth to FreedomBox in license headers
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:09 -05:00
Joseph Nuthalapati
efa575b204
Add clients to ServiceView
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2017-12-04 12:15:12 -05:00
Prachi Srivastava
83430f4031
Add mobile, web and desktop client for modules
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2017-10-24 17:13:13 +05:30
Prachi
c8eb714562
Separate out the short description and app name
Signed-off-by: Prachi <prachi@swecha.net>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2017-08-21 11:17:08 +05:30
Johannes Keyser
76a63d102b
setup: Disable install/upgrade when dpkg/apt is running
Show a warning message that a package manager is running. This prevents users
from getting an installation error just because another installation/upgrade is
running.

Closes: #625.
2017-04-19 16:50:00 +05:30
Sunil Mohan Adapa
7a4a8fbc99
views: New view to show setup need and progress 2016-02-13 13:50:12 +05:30