Giter Site home page Giter Site logo

teamapps-org / teamapps Goto Github PK

View Code? Open in Web Editor NEW
19.0 5.0 9.0 18.32 MB

TeamApps is a Java web application framework

License: Apache License 2.0

JavaScript 15.31% HTML 0.15% Java 48.91% Batchfile 0.01% Shell 0.02% TypeScript 28.82% ANTLR 0.16% Less 6.61%
java web-application-framework

teamapps's People

Contributors

bumbeishvili avatar dependabot[bot] avatar janvojt avatar joellinn avatar lemhannes avatar matthias-bernstein avatar mdindoffer avatar pgassmann avatar rainertsi avatar yamass avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

teamapps's Issues

Add a feature to automatically pre-size table columns based on the Header length

Table::addColumn has an int defaultWidth parameter, that can be used to set the default width of the column. If the client does not guess correctly the length of the header of the column, it might either waste screen space in the better case, or just cut off important text in the worse case.:
image

This is especially problematic when using localizable strings. There is no way to predict the length of the header for all languages.

It would be great to have a mechanism (i.e. TableColumn::enableDefaultAutoWidth()), that would calculate the required width based on the length of the supplied column title and pre-size the column to wrap the header.

Add a single-file variant of FileField and get rid of ternary logic for value presence in multi-file variant

The FileField is actually a Field for a list of files.

This is first of all confusing, since there's no indication of the plurality in the name.
Second, consumers always have to wrap values in a single-valued list when setting the value.

However, when trying to work with this field in a single-file mode, it gets even worse due to a ternary value state instead of simple null/notnull:

  1. Either the value is null, so calling field.getValue() will return a null pointer
  2. Or there is a file present (uploaded, or just loaded), and the field.getValue() will return a single-valued List, so you always have to call field.getValue().get(0) to get to the actual contents.
  3. Or there's sort of a grey zone, when client uploads a file to the FileField, but then removes it. This leads to a situation where the field.getValue() will return a List, not null, but the List is empty. In turn, one must always check both for nullity of the value and the emptyness of the List.

It would be great if we had two variants of the FileField:

  1. One for singular files, so not inheriting from AbstractFileField<List<RECORD>>
  2. One keeping the multi-file behaviour, but sticking to a two state logic (null, notnull) in all interaction scenarios.

view.focus() does not bring Tab to foreground

If two views share the same layout position, one cannot control which view should be in the foreground.

Perspective perspective = Perspective.createPerspective();
View alarmTableView = View.createView(StandardLayout.CENTER, MaterialIcon.REPORT_PROBLEM, "Alarm List", null);
perspective.addView(alarmTableView);

View eventTableView = View.createView(StandardLayout.CENTER, MaterialIcon.REPORT_PROBLEM, "Alarm Event Table", null);
perspective.addView(eventTableView);
eventTableView.focus(true);

Add capabillity to hijack standard browser keyboard shorcuts

Summary

It would be useful in some scenarios to be able to override browsers' keyboard shortcuts. For example for an "on save" shortcut [CTRL+S] instead of opening native save dialog an action could be performed in TeamApps.

Current State

SessionContext.onGlobalKeyEventOccurred can already listen for keyboard events, but apparently it will still propagate them to the browser, so hijacking is not possible.

Improve TreeChart

TreeChart:

  • Set default template
  • make propertyExtractor changeable

TreeGraphNode:

  • node should have convenience constructors
  • default width and height

Add an onClose event to Window

org.teamapps.ux.component.window.Window can be closed with either the ESC key, via the close button, or simply by clicking outside the window.

Unfortunately, there is no way to intercept this and perform additional actions when closing the window.

Please add an onClose event hook for this action.

Add a utility method to AbstractForm for checking whether the state was changed

Summary

Please add a utility method (e.g. boolean isTainted() or isChanged()) on the AbstractForm so that clients can quickly check whether any user input mutated the fields held in the logical Form.

Why

A method like this can be used to implement logic that handles unsaved changes in a Form in various cases (i.e. a user left the page without saving).

Current state

This can be worked around by implementing the check in client userspace code, but should be a part of the standard toolkit.
E.g.:

public boolean isTainted() {
	return form.getFields().stream().anyMatch(AbstractField::isValueChangedByClient);
}

Extend Table's onSingleRowSelected Event type with previously selected record

Summary

Please extend the API of the onSingleRowSelected Event so that the event payload includes both the new selection and the previously selected one.

Why

This would simplify the "revert" or "undo" scenarios where users may want to go back to their previously selected row in a table. A more specific example of this is when a user is reminded there are unsaved pending changes and selecting a different row would lose them for good. This can be worked around by client code in userspace, but should be a part of the standard toolkit.

Bring back SessionContext's lifecycle hook methods to facilitate testing with mocks

What

Some time ago the lifecycle methods (e.g. SessionContext#onDestroyed()) were replaced with public final Event<> fields.
This breaking API change broke unit tests, that were using mocked SessionContext.

Why

Since the methods were replaced with a field, mocking the behaviour on lifecycle changes is no longer possible:
when(mockSessionContext.onDestroyed()).thenReturn(new Event<>());

Solution

Please add the methods back, or at least allow injecting the final Event fields by test code.

text input field does only update value on focus in/out

text input fields do not update their value when something pastes into them that doesn't trigger focus events (some password managers like pass-ff do this).
At least when the according submit button is pressed the current field values shall be used and not their "shadow copies" as this behaviour is unexpected and breaks some things.

ResponsiveFormSection#setVisible has no effect

Calling ResponsiveFormSection.setVisible(false); has no effect - the form section is still rendered.

However, the ResponsiveFormSection.setHideWhenNoVisibleFields(true); works just fine - if there are no fields visible, the section is hidden.

Reproduced on:
0.9.96 & 0.9.101

Add a RangeSlider Field

Summary

Please add a Range Slider mode to the NumberField, or create a separate RangeSlider Field, that allows for selecting a range of numeric values.
Teamapps already has support for basic sliders via NumberField, but it's not really possible to compose two NumberFields to produce the desired unified range line with two control sliders.

This is useful in a couple of situations, e.g.:

  • Selecting a temporal range of years (1992 - 2007) or months (March - November)
  • Placing bounds on a numeric value (5˚C - 41˚C, 100 km - 200 km)

Currently, whenever an input like this is needed from users, it has to be collected via two separate (Number) fields.

Example

A simplistic example of this can be seen here:
image

With a live demo available at https://www.cssscript.com/demo/animated-customizable-range-slider-pure-javascript-rslider-js/

Additional requirements

A well designed range slider should handle zero-length ranges (e.g. 150 km - 150 km) intuitively, for example by overlaying one slider over another, like in the interactive example. There should also be support in place for open ended intervals (e.g. 15˚C - +∞˚C).

Add an event hook for closing the browser window

Summary

Please expose either an Event hook or a similar API, that can be synchronously invoked when users close the browser tab or window.

Why

These events can be used to prompt the user to save any pending changes before closing the tab and losing the state for good.

How

Maybe the beforeunload window event listener is enough, but care must be taken to make sure the event is propagated to the browser only if confirmed by user interaction.

Alternatively, if this is not feasible, just add a toggle to enable the native browser unsaved changes reminders.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.