0.1.18-beta.54 • Published 14 days ago

ngx-monitorias-uniandes-lib v0.1.18-beta.54

Weekly downloads
233
License
MIT
Repository
github
Last release
14 days ago

Ngx Monitorias Uniandes Library

This library is used for Monitorias-Uniandes system.

Install

Use npm package manager and execute following command:

npm i ngx-monitorias-uniandes-lib --save

Then import any avaliable ngx-monitorias-uniandes module in your main module. The following example imports SearchComboBoxModule module.

    import { AppComponent } from './app.component';
    import { SearchComboBoxModule } from 'ngx-monitorias-uniandes';



    @NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        SearchComboBoxModule
    ],
    providers: [],
    bootstrap: [AppComponent]
    })
    export class AppModule { }

Use

Once ngx-academia uniandes modules were imported, you can add the components in your main app.

Search Combo Box

  1. Define a component model object in component.ts like this :
    this.componentModel = {
        "urlService" : "http://myapi/items",
        "queryParams" : [{"name": "start", "value": 0}],
        "body": {"userName": "juanx", "age": 11}, 
        "collectionName": "records",
        "optionField" : "fullName", //Optional
        "placeholder" : "Search items", //Optional
        "optionsLimit" : 5, //Optional
        "findBy": "UserName",//Optional
    }

where urlService is an API service URL, queryParams is an array with queryParams for API requests, body is an object search params for searchs with POST method, collectioName is attribute name where are located array data (if response object is paginated), optionField is attribute name that contains the options value to show, placeholder is a string for setting the placeholder to component (Default "search"), optionsLimit you can configure number of options to display and with findBy you can set up which attribute in the body must be used for searching (Only works when body* is configured).

Finally, add component selector in html template like this:

<form [formGroup]="formGroup">
<div class="form-group">
  <app-search-combo-box-generic [preSelectedValue]="model.name" [componentModel]="componentModel" [itemControl]="formGroup.controls.searchItemDepCtrl" (itemSelected)="itemSelected=$event"></app-search-combo-box-generic>
</div>

Where preSelectedValue can set a previous value componentModel is previous object defined, itemControl is a formControl object of reactive angular forms and itemSelected is an event when someone selects an option.

Search Person Combo Box (Only for Academia System)

Define a person model for Search Generic Combo Box. This component allows a fast and easy configuration.

  1. Add component selector in html template like this:
<form [formGroup]="formGroup">
<div class="form-group">
  <search-person-combo-box [debugFlag]=true [placeHolder]="'Búsqueda en Academia'"  
  [itemControl]="formGroup.controls.searchPersonItemCtrl" (itemSelected)="verifyEvent($event)">
  </search-person-combo-box>
</div>

where debugFlag can configure component url to 'http://localhost:8080' for debug purposes if this property is set up with true.

  1. Finally, remember to add the function that will respond when selectedEvent will be fired. In this case, we add verifyEvent function on component.
verifyEvent(event: any){
    //TO DO SMTH WITH event 
}

As you can see, search person combo box component already has all configuration for work well inside Academia.

Search Product Combo Box (Only for Academia System)

Define a product model for Search Generic Combo Box. This component allows a fast and easy configuration.

  1. Add component selector in html template like this:
<form [formGroup]="formGroup">
<div class="form-group">
  <search-product-combo-box [debugFlag]=true [placeHolder]="'Búsqueda de Productos'"  
  [itemControl]="formGroup.controls.searchProductItemCtrl" (itemSelected)="verifyEvent($event)">
  </search-product-combo-box>
</div>

where debugFlag can configure component url to 'http://localhost:8080' for debug purposes if this property is set up with true.

  1. Finally, remember to add the function that will respond when selectedEvent will be fired. In this case, we add verifyEvent function on component.
verifyEvent(event: any){
    //TO DO SMTH WITH event 
}

Search Dependency Combo Box (Only for Academia System)

Define a dependency search model for Search Generic Combo Box. This component allows a fast and easy configuration.

  1. Add component selector in html template like this:
<form [formGroup]="formGroup">
<div class="form-group">
  <search-dependency-combo-box [debugFlag]=true [placeHolder]="'Búsqueda de Dependencias'"  
  [itemControl]="formGroup.controls.searchDependencyItemCtrl" (itemSelected)="verifyEvent($event)">
  </search-dependency-combo-box>
</div>

where debugFlag can configure component url to 'http://localhost:8080' for debug purposes if this property is set up with true. itemControl property is optional if you have a reactive form.

  1. Finally, remember to add the function that will respond when selectedEvent will be fired. In this case, we add verifyEvent function on component.
verifyEvent(event: any){
    //TO DO SMTH WITH event 
}

Search Users (Only for Academia System)

Define an user search model for Search Generic Combo Box. This component allows a fast and easy configuration. This component works for users with ADMINISTRATOR role inside Academia.

<search-user-combo-box [debugFlag]=true [itemControl]="formGroup.controls.searchUsersCtrl" (itemSelected)="verifyUserEvent($event)"></search-user-combo-box>

Crud shared compact (Only for Academia System)

Define a crud compact component UI. This UI has a table where each record has a description, a delete button, an avatar, a pagination for more tha 6 records and a title. Besides this component validates if records are unique inside table and if true it shows an alert. Crud compact has an Academia Search Box which must be configured for developers (Person, Products, Users, Dependencies, etc) in select mode input parameter. The following table shows all Academia Search Box avaliable in crud compact component.

nameIdAcademia Search Combo BoxDescription
personSearch Person Combo BoxIt searches people (faculties, external people, students)
userSearch User Combo BoxIt searches Academia users
dependencySearch Dependency Combo BoxIt searches Academia dependencies
programSearch Program Combo BoxIt searches Academia programs

Input parameters in crud component:

ParameterDescriptionTypeExample
listWithAvatarIt defines if table has or not user AvatarbooleanlistWithAvatar=false
selectModeIt selects Academia Search Box and configure itObjectselectMode="{'nameId':'person', 'queryParams': {'name':'personType', 'value': 1}
showListAttributeIt defines which attribute will be shown in the tableStringshowListAttribute="'completeName'"
indexAttributeIt define what is the attributeStringindexAttribute="'idFaculty'"
inputItemsPrevious data which will be added in the tableArrayObjectinputItems="phdStudent.advisors"
updatedItemsUpdated data after handling crud compactArrayObject(updatedItems)="phdStudent.advisors=$event"
readOnlyit defines if crud compact is read onlybooleanreadOnly=true

Example:

<crud-compact [listWithAvatar]=true [selectMode]="{'nameId':'person', 'queryParams': [{'name':'personType', 'value': 1},{'name':'facultyState', 'value': true},{'name':'limit','value': 5}]}" [showListAttribute]="'completeName'" [indexAttribute]="'idFaculty'" [inputItems]="phdStudent.advisors" (updatedItems)="phdStudent.advisors=$event" [readOnly]="setReadOnly('PHD_CONSULT', 'PHD_STUDENT')"></crud-compact>

Explanation: Crud compact is configured: Records has an user avatar. Academia search box is search person and its queryparams are: personType equals to 1, facultyState is true and limit is equals to 5. The attribute shown in table is completeName, index attribute is idFaculty and inputItems are phdStudent.advisors. If there are a change in the table updatedItems will emit event and it will update phdStudent.advisors. Read Only parameter will be the result of setReadOnly function.

Information Dialog

TODO

Yes/No Dialog

TODO

File Upload

TODO

© 2019

   _____                     .___             .__        
  /  _  \   ____ _____     __| _/____   _____ |__|____   
 /  /_\  \_/ ___\\__  \   / __ |/ __ \ /     \|  \__  \  
/    |    \  \___ / __ \_/ /_/ \  ___/|  Y Y  \  |/ __ \_
\____|__  /\___  >____  /\____ |\___  >__|_|  /__(____  /
        \/     \/     \/      \/    \/      \/        \/ 

____ ___      .__                   .___             
|    |   \____ |__|____    ____    __| _/____   ______
|    |   /    \|  \__  \  /    \  / __ |/ __ \ /  ___/
|    |  /   |  \  |/ __ \|   |  \/ /_/ \  ___/ \___ \ 
|______/|___|  /__(____  /___|  /\____ |\___  >____  >
                \/        \/     \/      \/    \/     \/ 
0.1.18-beta.54

14 days ago

0.1.18-beta.52

7 months ago

0.1.18-beta.53

6 months ago

0.1.18-beta.49

10 months ago

0.1.18-beta.47

12 months ago

0.1.18-beta.48

10 months ago

0.1.18-beta.45

12 months ago

0.1.18-beta.46

12 months ago

0.1.18-beta.50

10 months ago

0.1.18-beta.51

10 months ago

0.1.18-beta.44

1 year ago

0.1.18-beta.43

1 year ago

0.1.18-beta.38

1 year ago

0.1.18-beta.39

1 year ago

0.1.18-beta.36

2 years ago

0.1.18-beta.37

2 years ago

0.1.18-beta.34

2 years ago

0.1.18-beta.35

2 years ago

0.1.18-beta.41

1 year ago

0.1.18-beta.42

1 year ago

0.1.18-beta.40

1 year ago

0.1.18-beta.32

2 years ago

0.1.18-beta.33

2 years ago

0.1.18-beta.30

2 years ago

0.1.18-beta.31

2 years ago

0.1.18-beta.29

3 years ago

0.1.18-beta.27

3 years ago

0.1.18-beta.26

3 years ago

0.1.18-beta.25

3 years ago

0.1.18-beta.24

3 years ago

0.1.18-beta.23

4 years ago

0.1.18-beta.22

4 years ago

0.1.18-beta.21

4 years ago

0.1.18-beta.20

4 years ago

0.1.18-beta.19

4 years ago

0.1.18-beta.18

4 years ago

0.1.18-beta.17

4 years ago

0.1.18-beta.16

4 years ago

0.1.18-beta.14

4 years ago

0.1.18-beta.15

4 years ago

0.1.18-beta.13

4 years ago

0.1.18-beta.12

4 years ago

0.1.18-beta.11

4 years ago

0.1.18-beta.10

4 years ago

0.1.18-beta.9

4 years ago

0.1.18-beta.8

4 years ago

0.1.18-beta.7

4 years ago

0.1.18-beta.6

4 years ago

0.1.18-beta.5

4 years ago

0.1.18-beta.4

4 years ago

0.1.18-beta.3

4 years ago

0.1.18-beta.2

4 years ago

0.1.17-beta.99

4 years ago

0.1.17-beta.98

4 years ago

0.1.17-beta.97

4 years ago

0.1.17-beta.96

4 years ago

0.1.17-beta.95

4 years ago

0.1.17-beta.94

4 years ago

0.1.17-beta.93

4 years ago

0.1.17-beta.92

4 years ago

0.1.17-beta.91

4 years ago

0.1.17-beta.90

4 years ago

0.1.17-beta.89

4 years ago

0.1.17-beta.88

4 years ago

0.1.17-beta.87

4 years ago

0.1.17-beta.86

4 years ago

0.1.17-beta.85

4 years ago

0.1.17-beta.84

4 years ago

0.1.17-beta.83

4 years ago

0.1.17-beta.81

4 years ago

0.1.17-beta.82

4 years ago

0.1.17-beta.80

4 years ago

0.1.17-beta.78

4 years ago

0.1.17-beta.79

4 years ago

0.1.17-beta.77

4 years ago

0.1.17-beta.76

4 years ago

0.1.17-beta.75

4 years ago

0.1.17-beta.74

4 years ago

0.1.17-beta.73

4 years ago

0.1.17-beta.72

4 years ago

0.1.17-beta.71

4 years ago

0.1.17-beta.70

4 years ago

0.1.17-beta.69

4 years ago

0.1.17-beta.68

4 years ago

0.1.17-beta.67

4 years ago

0.1.17-beta.66

4 years ago

0.1.17-beta.65

4 years ago

0.1.17-beta.64

4 years ago

0.1.17-beta.63

4 years ago

0.1.17-beta.62

4 years ago

0.1.17-beta.61

4 years ago

0.1.17-beta.60

4 years ago

0.1.17-beta.58

4 years ago

0.1.17-beta.57

4 years ago

0.1.17-beta.56

4 years ago

0.1.17-beta.55

4 years ago

0.1.17-beta.54

4 years ago

0.1.17-beta.53

4 years ago

0.1.17-beta.52

4 years ago

0.1.17-beta.51

4 years ago

0.1.17-beta.50

4 years ago

0.1.17-beta.49

4 years ago

0.1.17-beta.48

4 years ago

0.1.17-beta.47

4 years ago

0.1.17-beta.46

4 years ago

0.1.17-beta.45

4 years ago

0.1.17-beta.44

4 years ago

0.1.17-beta.43

4 years ago

0.1.17-beta.42

4 years ago

0.1.17-beta.41

5 years ago

0.1.17-beta.40

5 years ago

0.1.17-beta.39

5 years ago

0.1.17-beta.38

5 years ago

0.1.17-beta.37

5 years ago

0.1.17-beta.36

5 years ago

0.1.17-beta.35

5 years ago

0.1.17-beta.34

5 years ago

0.1.17-beta.33

5 years ago

0.1.17-beta.32

5 years ago

0.1.17-beta.31

5 years ago

0.1.17-beta.30

5 years ago

0.1.17-beta.29

5 years ago

0.1.17-beta.28

5 years ago

0.1.17-beta.27

5 years ago

0.1.17-beta.26

5 years ago

0.1.17-beta.24

5 years ago

0.1.17-beta.23

5 years ago

0.1.17-beta.22

5 years ago

0.1.17-beta.21

5 years ago

0.1.17-beta.20

5 years ago

0.1.17-beta.19

5 years ago

0.1.17-beta.18

5 years ago

0.1.17-beta.17

5 years ago

0.1.17-beta.16

5 years ago

0.1.17-beta.15

5 years ago

0.1.17-beta.14

5 years ago

0.1.17-beta.13

5 years ago

0.1.17-beta.12

5 years ago

0.1.17-beta.11

5 years ago

0.1.17-beta.10

5 years ago

0.1.17-beta.9

5 years ago

0.1.17-beta.8

5 years ago

0.1.17-beta.7

5 years ago

0.1.17-beta.6

5 years ago

0.1.17-beta.5

5 years ago

0.1.17-beta.4

5 years ago

0.1.17-beta.3

5 years ago

0.1.17-beta.2

5 years ago

0.1.17-beta.1

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago