Skip to content

Commit

Permalink
MINOR: Added new dialog single input component and more changes
Browse files Browse the repository at this point in the history
Refactored setCurrentUrlURI() on browser service
Added new component dialog-single-input
Upgraded turbocommons library
Created turboapicaller service to interact with turboframework APIs
Removed outdated user service
Created validator plus class for extra form validators
  • Loading branch information
edertone committed Jul 9, 2024
1 parent 68a513a commit 8ab9aea
Show file tree
Hide file tree
Showing 15 changed files with 756 additions and 224 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# How to upgrade all the libraries and dependencies that this project uses


This project uses libraries and dependencies from a variety of sources. To make sure that all of them are up to date, follow this steps:

- Check if angular framework must be updated (follow the official guide)

- Copy the same version of the libraries that are updated at the root package.json file by angular updater to projects/turbogui-angular/package.json

- Open a cmd at the root of this project folder, and run:

npm outdated

Update the package.json versions based on the command result, by running:

npm install libraryname1@latest libraryname2@latest libraryname3@latest

# How to upgrade all the libraries and dependencies that this project uses


This project uses libraries and dependencies from a variety of sources. To make sure that all of them are up to date, follow this steps:

- Check if angular framework must be updated (follow the official guide)

- Copy the same version of the libraries that are updated at the root package.json file by angular updater to projects/turbogui-angular/package.json

- Open a cmd at the root of this project folder, and run:

npm outdated

Update the package.json versions based on the command result, by running:

npm install libraryname1@latest libraryname2@latest libraryname3@latest

- Copy the same version of the libraries that are updated at the root package.json file by npm install to projects/turbogui-angular/package.json
8 changes: 4 additions & 4 deletions TurboGUI-Angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions TurboGUI-Angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"core-js": "^2.5.4",
"rxjs": "~6.5.4",
"tslib": "^2.6.2",
"turbocommons-ts": "^3.9.0",
"turbocommons-ts": "^3.12.0",
"zone.js": "~0.14.2"
},
"devDependencies": {
Expand All @@ -47,4 +47,4 @@
"tslint": "~6.1.0",
"typescript": "~5.2.2"
}
}
}
2 changes: 1 addition & 1 deletion TurboGUI-Angular/projects/turbogui-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "turbogui-angular",
"version": "15.0.0",
"version": "15.1.0",
"description": "A library that tries to help with the most common user interface elements on several frameworks and platforms",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class BrowserService extends BrowserManager {
*
* @returns void
*/
setURI(path: string, query?: string | undefined){
setCurrentUrlURI(path: string, query?: string | undefined){

this.location.go(path, query);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export class DialogService extends SingletoneStrictClass {
* @param dialogComponentClass A class for a component that extends DialogBaseComponent, which will be the dialog that is shown to the user.
* @param properties An object containing the different visual and textual options that this dialog allows:
* - id: The html unique identifier that the dialog will have once created. If not specified, no id will be explicitly set
* - width: Specify the css value for the default dialog width. As the dialog is responsive, the value will be automatically
* - width: 50% by default. Specify the css value for the default dialog width. As the dialog is responsive, the value will be automatically
* reduced if the available screen is not enough, and will reach the desired value otherwise. We can set any css unit like pixels,
* %, vh, vw, or any other. For example: '400px', '50%', etc.
* - maxWidth: Defines the maximum width that the dialog will have regarding the viewport. We can specify it in % or vw, just like is done in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@ import { DialogErrorComponent } from '../view/components/dialog-error/dialog-err
export class HTTPService extends HTTPManager {


/**
* execute() method option that tells the service to avoid blocking the user interface with a modal busy state while the requests that are
* launched by the execute method are running.
*/
static readonly NO_MODAL_BUSY_STATE = 'NO_MODAL_BUSY_STATE';


/**
* execute() method option that tells the service to skip showing an error dialog when a request fails. We normally use this to handle the
* errors by ourselves or if we want to hide the error dialog for a specific request.
*/
static readonly DISABLE_ERROR_HANDLING = 'DISABLE_ERROR_HANDLING';


constructor(public dialogService: DialogService) {

super(true);
Expand All @@ -45,29 +31,34 @@ export class HTTPService extends HTTPManager {
/**
* The same method as HTTPManager.execute but with the ability to enable several options which are specific to this service:
*
* - HTTPService.NO_MODAL_BUSY_STATE To prevent the default behaviour of locking the UI while the request is running
* - HTTPService.DISABLE_ERROR_HANDLING To prevent the default behaviour of showing a detailed error dialog when a request fails
* - options:
* busyState: Set it to false to prevent the default behaviour of locking the UI while the request is running
* handleErrors: Set it to false to prevent the default behaviour of showing a detailed error dialog when a request fails
*
* @see HTTPManager.execute()
*/
execute(requests: string|string[]|HTTPManagerBaseRequest|HTTPManagerBaseRequest[],
finishedCallback: ((results: {url:string, response:any, isError:boolean, errorMsg:string, code:number}[], anyError:boolean) => void) | null = null,
progressCallback: null | ((completedUrl: string, totalRequests: number) => void) = null,
options: (typeof HTTPService.NO_MODAL_BUSY_STATE|typeof HTTPService.DISABLE_ERROR_HANDLING)[] = []){
options: {busyState?:boolean, handleErrors?:boolean} = {}){

if(options.indexOf(HTTPService.NO_MODAL_BUSY_STATE) < 0){
// Set the default values for non specified properties
options.busyState = options.busyState ?? true;
options.handleErrors = options.handleErrors ?? true;

if(options.busyState){

this.dialogService.addModalBusyState();
}

super.execute(requests, (results, anyError) => {

if(options.indexOf(HTTPService.NO_MODAL_BUSY_STATE) < 0){
if(options.busyState){

this.dialogService.removeModalBusyState();
}

if((options.indexOf(HTTPService.DISABLE_ERROR_HANDLING) < 0) && anyError){
if(options.handleErrors && anyError){

for(let result of results){

Expand Down
Loading

0 comments on commit 8ab9aea

Please sign in to comment.