Socket
Book a DemoInstallSign in
Socket

@arriva/angular-ui-lib

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arriva/angular-ui-lib

Install latest version

latest
npmnpm
Version
0.9.0
Version published
Maintainers
2
Created
Source

ArrivaUiSampleApp

Installation (NPM)

Install latest version

npm install @arriva/angular-ui-lib --save

Install specific version

npm install @arriva/angular-ui-lib@1.0.0 --save

Installation (file)

Commands:

To build a libary: ng build arriva-ui-lib

To pack it to tgz file: npm run npm_pack

To install it in your project npm install pathToLibrary.tgz

Introduce lib in project:

  • Remove files - sso-login, sso-callback, sso-external, from shared folder: const/authSesssionData, http-method, sso-configuration, models/authentication/, models/http/, models/customBody, services/authentication/*, services/http-service.ts, services/offline.service.ts, services/requestStorage.service.ts
  • Install library
  • Change all imports connected to mentioned files to ‚arriva-ui-lib’

This project was generated with Angular CLI version 6.0.8.

Changelog

Version 0.0.30

ExampleComponent

  • Page Name (toolbar) setup with translation
  • Getting user accesses
  • Date format parser

AppComponent

  • Login to app
  • Navigation menu items setup

DropdownShowcase

  • Custom dropdown used in TaxiApp

Version 0.0.31

Version 0.0.32

  • Added formatWithMoment() Date extension, usage: var date = new Date(); date.formatWithMoment(moment.HTML5_FMT.DATE); // "2017-12-14" more: https://momentjs.com/docs/

  • Added MessageboxDialogComponent to show messages to the users.

AppModule

  • Global L10nService configuration

Version 0.0.33

Login Service

  • Fixed problem with logging in on SAFARI browser

Version 0.0.34

  • Fixed UI issues in nav-menu component.

Version 0.0.35

  • Added YesNoDialogComponent to confirm user's actions.

Version 0.0.36

  • Fixed ERROR TypeError: Cannot read property 'defaultdistrictid' of undefined when user is not logged in and app tries to check access level.

Version 0.0.37

  • Introduced manual login with predefined callback url
  • Fixed ERROR TypeError: Cannot read property 'access' of undefined

Version 0.0.38

  • Added loader spinner.

Version 0.0.39

  • fix nav state when no user.
  • fix display national characters in username

Version 0.0.40

  • Extended l10nService for changing languages dynamically.

Version 0.0.41

  • Fixed possibility that translationService is using unsupported lang
  • Added possibility to easily check current translation name from app

Version 0.0.42

  • Changes in header and navigation components

    a. Components "nav" and "nav-menu" are obsolete and replaced by "nav-header", "nav-bar" and "nav-hamburger":

    		<div class="app-container" scroll="no">
    			<mat-drawer-container class="menu-container">
    				<mat-drawer #menuDrawer mode="Over">
    					<lib-nav-hamburger [drawer]="menuDrawer" [menuItems]="menuItems"></lib-nav-hamburger>
    				</mat-drawer>
    				<mat-drawer-content>
    					<lib-nav-header class="nav-container" [name]="name" [drawer]="menuDrawer"></lib-nav-header>
    					<lib-nav-bar [menuItems]="menuItems"></lib-nav-bar>
    					<mat-card class="card-container .mat-elevation-z0"> <router-outlet></router-outlet> </mat-card>
    				</mat-drawer-content>
    			</mat-drawer-container>
    			<ngx-spinner bdColor="rgba(51,51,51,0.8)" size="medium" color="#fff" type="ball-scale-multiple"> </ngx-spinner>
    		</div>
    

    b. Every menu element in the definition of the "click" event should call the "toggleMenuItemsSelection" methog from "MenuItemService":

    				const elementMenuItemSubject = new Subject<MenuItem>();
    				elementMenuItemSubject.subscribe(item => {
    					this.menuItemService.toggleMenuItemsSelection(this.menuItems, item);
    					...
    				});
    

    c. A section should be added to the translation files:

    		EN:
    
    			"USERINFO": {
    				"USERINFO": "Phonenumber",
    				"EMPLOYEEID": "Employee ID",
    				"DEFAULTDISTRICT": "Default district ID",
    				"ROLE": "Role"
    			}
    
    
    		SV:
    
    				"USERINFO": {
    					"USERINFO": "Telefonnummer",
    					"EMPLOYEEID": "Anställnings-ID",
    					"DEFAULTDISTRICT": "Standarddistrikts-ID",
    					"ROLE": "Roll"
    				}
    

Version 0.0.43

  • Added null possibility for drawer in nav and nav-header component
  • Added tabIndex property to make tab feature works well for custom dropdown component

Version 0.0.44

  • Resolved bug - TypeError: Cannot read property 'toLowerCase' of null in CustomDropdownComponent
  • Resolved bug - no margin between app name and user info on toolbar

Version 0.0.45

  • Added three state checkbox to handle indeterminate state easly without changing all mat-checkbox providers on view

Version 0.0.46

???

Version 0.0.47

???

Version 0.0.48

  • Enabling the possibility of returning to the application after logging out of it: - added "id_token" response type, - added "openid" scope,
  • Change aplication clientId to "testapp_spa",

Version 0.0.49

  • Fix hamburger icon
  • Fix a way of showing roles in system

Version 0.0.50

  • Enable posibility to use HashLocationStrategy

Version 0.0.51

  • Change to asynchronous data and user rights loading

Version 0.0.52

  • Quick fix remove blur from app-dropdown

Version 0.0.53

  • Resolve looping for external login

Version 0.0.54

  • Better selecting active routes in nav menu

Version 0.0.55

  • Added Google Analytics util functions

Version 0.0.56

  • Add User Id to Common Library

Version 0.0.57

  • Removed visibility of translate service from outside the class - you should use translate method instead of implementing it manually.

Version 0.0.58

  • Components "nav-header" and "nav-user" are obsolete and replaced by nav-header-v2 and nav-user-v2.
  • Added HeaderService with object header, which must be filled (you can find an example in app.component.ts and example.ts).
  • Added dropdown control in header.
  • Styles for desktop and mobile version (nav-header-v2 and nav-user-v2).

Version 0.0.59

Components "nav-bar" and "nav-hamburger" are obsolete and replaced by "nav-bar-v2" and "nav-hamburger-v2":

To create navigation bar buttons fill navigation object in headerService:

this.headerService.navigation = new Navigation( [new MenuItem('', 'NAV.BUTTON', buttonSubject, undefined)], // list of buttons (currently only one item is supported) [new MenuItem('', 'NAV.ITEM1', undefined, '/example')] // list of navigation items );

If navigation item changes only route Subject is not nessessary - just pass route in fourth parameter.

Version 0.0.60

  • Changes in HeaderService (segregation header properties).
  • Adjusting the header for navigation.
  • Added new logo.
  • Change px to em in nav-header-v2 and nav-user-v2.
  • Support setting the name of the header button.

Version 0.0.61

  • Changes in HeaderService. To create nav-header-v2 fill header object: this.headerService.header = new Header('TestApka', false, true, true);
  • Header looks like the following:
  • Implemented header in light theme.
  • Changes in logout panel.

Version 0.0.62

  • Added Printer service Usage: Printer.generatePDF(data, 'documentName'); , where data parameter is a HTML element we want to print.

Version 0.0.63

  • Light theme for mobile version. Added icons to nav-buttons.

Version 0.0.64

  • Hiding back button in mobile version.

Version 0.0.65

  • Fixing header height.

Version 0.0.66

  • Minor styles changes in header.

Version 0.0.67

  • Hide dropItems if list is empty.

Version 0.0.68

  • Added property 'visible' to MenuItem which hide element in navigation bar.
  • Added property 'disabled' to MenuItem which set element to disabled (user cannot click).
  • Added possibility to sorting elements. To enable sorting pass false to 'defaultOrder' in Navigation and set orderNo in MenuItem.
  • Id of selected dropdown item is saved in localStorage. Use getSelectedDropdownId function in HeaderService to get selected dropdown item id.

Version 0.0.69

  • Added 'listsUserDistricts(["ACCESS_NAME"])' method on UserService - it lists the districts available to the user on the basis of available access and app defined access.

Version 0.0.70

  • Added possibility to choose multi districts in main header.
  • To create a new header object: private initializeMultiDistrictHeader() { this.headerService.header = new MultipleDistrictHeader('TestApka', true, true, true); const list = new Array( new HeaderDropdownItem(1, '', 'Pagatagen'), new HeaderDropdownItem(2, '', 'Östgötapendeln'), new HeaderDropdownItem(3, '', 'Custom district') ); this.headerService.header.setDropdownItems.next(list); (this.headerService.header).setMultiSelectedDropdownItems.next(list); }
  • Header HTML looks like: <lib-nav-hamburger-v2 [isMultiDistrict]="true"> <lib-nav-header-v2 [isMultiDistrict]="true">

Take note of flag isMultiDistrict in both components.

Version 1.0.0

  • Defined only one header object for multiple / single district selection : this.headerService.header = new Header('TestApka', true, true, true, true, true); Last parameter is isMultiDistrict flag (boolean) by default set to false. Currently we don't need to set any parameters on HTML templates like before. Example from app.component.ts:

    private initializeDistrictHeader() {
    	this.headerService.header = new Header('TestApka', true, true, true, true, true);
    	const list = new Array<HeaderDropdownItem>(
    		new HeaderDropdownItem(1, '', 'Pagatagen'),
    		new HeaderDropdownItem(2, '', 'Östgötapendeln'),
    		new HeaderDropdownItem(3, '', 'Custom district')
    	);
    	this.headerService.header.setDropdownItems.next(list);
    	const selectedItem = list.find(x => x.id === 1);
    	if (selectedItem) {
    		this.headerService.header.setSelectedDropdownItems.next([selectedItem]);
    	}
    }
    

    Please remember that now districts operates on arrays of selected items ids, not on id value.

Version 1.0.1

  • Added error handling in POST request.
  • Fix for isOnline (start value was false).

Version 1.0.2

  • Added blocking of possibility to deselect all districts on multiple district header mode.

Version 1.0.3

  • New initialization of districts regarding to loading districts from local storage: private initializeDistrictHeader() { this.headerService.header = new Header('TestApka', true, true, true, true, false); const list = new Array( new HeaderDropdownItem(1, '', 'Pagatagen'), new HeaderDropdownItem(2, '', 'Östgötapendeln'), new HeaderDropdownItem(3, '', 'Custom district') );

    this.headerService.header.setDropdownItems.next(list);
    const selectedDistrictsFromLocalStorage = this.headerService.getSelectedDropdownsIds();
    if (!selectedDistrictsFromLocalStorage) {
    	this.headerService.header.setSelectedDropdownItems.next([list[0]]);
    } else {
    	this.headerService.header.setSelectedDropdownItems.next(selectedDistrictsFromLocalStorage);
    }
    

    }

Version 1.0.4

  • Added possibility to login by pin. To change method of login change: { path: 'login', component: SsoLoginComponent }, to { path: 'login', component: PinLoginComponent }, in app-routes.ts

Version 1.0.5

  • Added loader to login page.

Version 1.0.6

  • Fix for error message property.
  • Custom error message subject for pin login.

Version 1.0.7

  • Added yes-no-dialog-v2

Version 1.0.8

  • Added helper "convertEnumToDropdownDatasource".

Version 1.0.9

  • Change Subject to BehaviorSubject for district change event

Version 1.0.10

  • Change a way for emit district changing event, now it occures only when closing select control

Version 1.0.11

  • Fixed bug with no selected district when reloading / moving to other page.

Version 1.0.12

  • Moved Custom Paginator to arriva-ui-lib.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

FAQs

Package last updated on 02 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.