Commit 13cd192c authored by Martti Toim's avatar Martti Toim
Browse files

Merge branch 'aug_lopp_seis' into 'develop'

Aug lopp seis

Closes SKAP-1416, SKAP-1284, SKAP-1422, SKAPM-217, SKAPM-315, SKAP-1400, SKAP-1424, SKAU-104, SKAU-103, SKAU-117, SKAP-1314, SKAP-1075, SKAP-964, SKAU-126, SKAU-122, SKAU-156, SKAU-157, SKAP-1223, SKAPM-261, SKAP-1442, SKAP-1443, SKAU-158, SKAP-1487, SKAP-1452, SKAP-1093, SKAP-967, SKAU-105, SKAU-100, SKAP-1286, SKAU-75, SKAP-1004, SKAPM-262, SKAU-95, SKAP-1014, SKAU-74, SKAPM-211, SKAU-69, SKAU-67, SKAP-940, SKAU-91, SKAU-88, SKAU-36, SKAP-941, SKAP-747, SKAPM-234, SKAU-72, SKAU-51, and SKAPM-20

See merge request RIA/angular-common-ui!1
parents 322bd079 66428bfc
Pipeline #23 failed with stages
......@@ -17,6 +17,7 @@
*.launch
.settings/
*.sublime-workspace
*.iml
# IDE - VSCode
.vscode/*
......
......@@ -476,6 +476,30 @@
"styleext": "scss"
}
}
},
"test-cypress": {
"root": "libs/test-cypress",
"sourceRoot": "libs/test-cypress/src",
"projectType": "library",
"prefix": "ska-angular",
"architect": {
"build": {
"builder": "@linnenschmidt/build-ng-packagr:build",
"options": {
"tsConfig": "libs/test-cypress/tsconfig.json",
"project": "libs/test-cypress/ng-package.json",
"assets": [{ "glob": "**/*", "input": "cypress/", "output": "/cypress/" }]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["libs/test-cypress/tsconfig.json"],
"exclude": ["**/node_modules/**"]
}
}
},
"schematics": {}
}
},
"cli": {
......
......@@ -2,7 +2,6 @@ import { AuthContext, MockAuthUtil } from '@ska-angular/auth';
import { DefaultAddressComponentConfig } from '@ska-angular/common';
import {
DefaultClassificatorConfig,
DefaultErrorHandler,
DefaultWfmConfig,
MessageContext,
SkaTranslateHttpLoader,
......@@ -16,15 +15,9 @@ export function authRefresh(authContext: AuthContext) {
return () => MockAuthUtil.mockLogin(authContext);
}
export class CommonErrorHandler extends DefaultErrorHandler {
constructor(messageContext: MessageContext, translate: TranslateService, wfmConfig: WfmConfig) {
super(messageContext, translate, wfmConfig);
}
}
export class CommonTranslateHttpLoader extends SkaTranslateHttpLoader {
public getFolderNames(): string[] {
return ['common', 'common-demo', 'countries', 'condition-check'];
return ['common', 'common-demo', 'countries', 'condition-check', 'menu-items'];
}
}
......
import { FeatureFlagService } from '@ska-angular/core';
export const FeatureFlagLoaderFactory = (
featureFlagService: FeatureFlagService
): (() => Promise<any>) => {
return () => featureFlagService.loadFeatureFlags('assets/feature-flags-mock.json');
};
import { APP_INITIALIZER, ErrorHandler, NgModule } from '@angular/core';
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { AuthContext, SkaAuthConfig, SkaAuthModule, SkaPortalAppConfig } from '@ska-angular/auth';
import { SkaChartsModule } from '@ska-angular/charts';
import { AddressComponentConfig, SkaCommonModule } from '@ska-angular/common';
......@@ -13,7 +13,6 @@ import { SkaConditionCheckModule } from '@ska-angular/condition-check';
import {
ClassificatorConfig,
ClassificatorContext,
MessageContext,
SettingsContext,
SkaCoreModule,
WfmConfig
......@@ -26,7 +25,6 @@ import {
authRefresh,
CommonAddressComponentConfig,
CommonClassificatorConfig,
CommonErrorHandler,
CommonHelpConfig,
CommonTranslateHttpLoader,
CommonWfmConfig
......@@ -43,7 +41,6 @@ import { OfficialDashboardContainerExampleComponent } from './containers/officia
import { PublicContainerExampleComponent } from './containers/public.container.example.component';
import { RepresentDashboardContainerExampleComponent } from './containers/represent.dashboard.container.example.component';
import { TestMenuResolver } from './containers/test.menu.resolver';
import { TransitionContainerExampleComponent } from './containers/transition.container.example.component';
import { SkaDemoContentSidebarComponent } from './content/ska-demo-content-sidebar.component';
import { SkaDemoContentComponent } from './content/ska-demo-content.component';
import { SkaDemoEmptyComponent } from './content/ska-demo-empty.component';
......@@ -55,6 +52,8 @@ import { SkaDemoRoleSelectComponent } from './reusable-examples/ska-demo-role-se
import { SkaStylebookContainerComponent } from './stylebook-container/ska-stylebook-container.component';
import { UigModule } from './stylebook/uig.module';
import { PopoverModule } from 'ngx-bootstrap';
import { FeatureFlagService } from 'libs/core/src/lib/feature-flag/feature-flag.service';
import { FeatureFlagLoaderFactory } from './app.feature-flag-loader';
@NgModule({
declarations: [
......@@ -69,7 +68,6 @@ import { PopoverModule } from 'ngx-bootstrap';
OfficialDashboardContainerExampleComponent,
GlobalDashboardContainerExampleComponent,
RepresentDashboardContainerExampleComponent,
TransitionContainerExampleComponent,
PublicContainerExampleComponent,
SkaIconsExampleComponent,
SkaDemoMessagesComponent,
......@@ -105,17 +103,18 @@ import { PopoverModule } from 'ngx-bootstrap';
providers: [
TestMenuResolver,
AuthGuard,
{
provide: ErrorHandler,
useClass: CommonErrorHandler,
deps: [MessageContext, TranslateService]
},
{
provide: APP_INITIALIZER,
useFactory: authRefresh,
deps: [AuthContext],
multi: true
},
{
provide: APP_INITIALIZER,
useFactory: FeatureFlagLoaderFactory,
deps: [FeatureFlagService],
multi: true
},
{ provide: SkaAuthConfig, useValue: skaAuthConfig },
{ provide: SkaPortalAppConfig, useValue: portalAppConfig },
......
import { Routes } from '@angular/router';
import { AuthRouteGuard } from '@ska-angular/auth';
import {
BookmarkSettingsComponent,
DashboardGlobalComponent,
DashboardOfficialComponent,
DashboardRepresentComponent,
GlobalMenuResolver,
MenuSearchResultListComponent,
NoauthDashboardContainerComponent,
OfficialMenuResolver,
PageMenuItemComponent,
RepresentMenuResolver,
TransitionContainerComponent
OfficialMenuContext
} from '@ska-angular/dashboard';
import { PublicContainerComponent } from '@ska-angular/public';
import { PublicContainerComponent, PortalLoginComponent } from '@ska-angular/public';
import { ErrorComponent, SessionEndComponent } from '@ska-angular/workflow';
import { AuthGuard } from './auth-guard';
import { SkaChartsContainerComponent } from './charts/charts-container/ska-charts-container.component';
import { CurvedLineChartExampleComponent } from './charts/curved-line-chart-example/curved-line-chart-example.component';
import { PieChartExampleComponent } from './charts/pie-chart-example/pie-chart-example.component';
import { SkaChartsExampleComponent } from './charts/ska-charts.example.component';
import { GlobalDashboardContainerExampleComponent } from './containers/global.dashboard.container.example.component';
import { OfficialDashboardContainerExampleComponent } from './containers/official.dashboard.container.example.component';
import { PublicContainerExampleComponent } from './containers/public.container.example.component';
import { RepresentDashboardContainerExampleComponent } from './containers/represent.dashboard.container.example.component';
import { TestMenuResolver } from './containers/test.menu.resolver';
import { TransitionContainerExampleComponent } from './containers/transition.container.example.component';
import { SkaDemoContentComponent } from './content/ska-demo-content.component';
import { SkaDemoEmptyComponent } from './content/ska-demo-empty.component';
import { SkaIconsExampleComponent } from './icons/ska-icons.example.component';
......@@ -65,8 +60,11 @@ import { UigMessagesThreadDetailViewComponent } from './stylebook/uig.22.message
import { UigErrorPageComponent } from './stylebook/uig.24.error.page.component';
import { UigBankAccountManagmentComponent } from './stylebook/uig.25.form.bank.account.managment.component';
import { UigMessagesListViewComponent } from './stylebook/uig.26.messages.list.view.component';
import { UigHomePageEmptyComponent } from './stylebook/uig.27.home.page.empty.component';
import { UigHomePageNoContentComponent } from './stylebook/uig.28.home.page.no.content.component';
import { UigComponent } from './stylebook/uig.component';
import { SkaDemoConditionCheckExampleComponent } from './reusable-examples/ska-demo-condition-check-example.component';
import { AppOfficialMenuResolver } from './official-menu.resolver';
const STYLEBOOK_COMPS = [
{ path: '', component: SkaDemoContentComponent },
......@@ -110,6 +108,8 @@ const STYLEBOOK_COMPS = [
},
{ path: 'stylebook-success_page_for_benefits', component: UigSuccessPageForBenefits },
{ path: 'stylebook-home-page', component: UigHomePageComponent },
{ path: 'stylebook-home-page-empty', component: UigHomePageEmptyComponent },
{ path: 'stylebook-home-page-no-content', component: UigHomePageNoContentComponent },
{ path: 'stylebook-error-page', component: UigErrorPageComponent },
{ path: 'stylebook-forms_bank_account-managment', component: UigBankAccountManagmentComponent },
{
......@@ -118,24 +118,15 @@ const STYLEBOOK_COMPS = [
}
];
const PUBLIC_COMPS = [
{ path: 'public', component: PublicContainerExampleComponent },
{ path: 'public', component: PortalLoginComponent },
{ path: 'public/empty', component: SkaDemoEmptyComponent },
{ path: 'public/messages', component: SkaDemoMessagesComponent },
{ path: 'stylebook/13', component: Uig13TooltipComponent }
];
const TRANSITION_COMPS = [
{ path: 'transition', component: TransitionContainerExampleComponent },
{ path: 'transition/empty', component: SkaDemoEmptyComponent }
];
const NOAUTH_COMPS = [
{ path: 'noauth', component: TransitionContainerExampleComponent },
{ path: 'noauth/empty', component: SkaDemoEmptyComponent }
];
const NOAUTH_COMPS = [{ path: 'noauth/empty', component: SkaDemoEmptyComponent }];
const GLOBAL_MENU_SEARCH_URL = 'global/menus';
const GLOBAL_BOOKMARKS_URL = 'global/bookmarks';
const GLOBAL_COMPS = [
{ path: GLOBAL_MENU_SEARCH_URL, component: MenuSearchResultListComponent },
{ path: GLOBAL_BOOKMARKS_URL, component: BookmarkSettingsComponent },
{
path: 'global',
component: GlobalDashboardContainerExampleComponent
......@@ -150,20 +141,18 @@ const GLOBAL_COMPS_ACTIVATE = [
{ path: 'secret', component: GlobalDashboardContainerExampleComponent }
];
const OFFICIAL_MENU_SEARCH_URL = 'official/menus';
const OFFICIAL_BOOKMARKS_URL = 'official/bookmarks';
const OFFICIAL_COMPS = [
{ path: OFFICIAL_MENU_SEARCH_URL, component: MenuSearchResultListComponent },
{ path: OFFICIAL_BOOKMARKS_URL, component: BookmarkSettingsComponent },
{ path: 'official', component: OfficialDashboardContainerExampleComponent },
{ path: 'official/tmp', component: BookmarkSettingsComponent },
{
path: 'official',
component: OfficialDashboardContainerExampleComponent
},
{ path: 'role', component: SkaDemoRoleSelectComponent },
{ path: 'official/page/:menuItemCode', component: PageMenuItemComponent }
];
const REPRESENT_MENU_SEARCH_URL = 'represent/menus';
const REPRESENT_BOOKMARKS_URL = 'represent/bookmarks';
const REPRESENT_COMPS = [
{ path: REPRESENT_MENU_SEARCH_URL, component: MenuSearchResultListComponent },
{ path: REPRESENT_BOOKMARKS_URL, component: BookmarkSettingsComponent },
{ path: 'represent', component: RepresentDashboardContainerExampleComponent }
];
const CHART_COMPS = [
......@@ -179,11 +168,6 @@ export const APP_ROUTES: Routes = [
children: STYLEBOOK_COMPS
},
{ path: '', component: PublicContainerComponent, children: PUBLIC_COMPS },
{
path: '',
component: TransitionContainerComponent,
children: TRANSITION_COMPS
},
{
path: '',
component: NoauthDashboardContainerComponent,
......@@ -212,18 +196,20 @@ export const APP_ROUTES: Routes = [
resolve: { menuItems: GlobalMenuResolver },
children: GLOBAL_COMPS,
data: {
menuSearchComponentUrl: GLOBAL_MENU_SEARCH_URL,
bookmarksComponentUrl: GLOBAL_BOOKMARKS_URL
menuSearchComponentUrl: GLOBAL_MENU_SEARCH_URL
}
},
{
path: '',
component: DashboardOfficialComponent,
resolve: { menuItems: OfficialMenuResolver },
resolve: {
menuItems: AppOfficialMenuResolver
},
children: OFFICIAL_COMPS,
data: {
menuSearchComponentUrl: OFFICIAL_MENU_SEARCH_URL,
bookmarksComponentUrl: OFFICIAL_BOOKMARKS_URL
menuContext: OfficialMenuContext.PERSON
}
},
{
......@@ -232,8 +218,7 @@ export const APP_ROUTES: Routes = [
resolve: { menuItems: RepresentMenuResolver },
children: REPRESENT_COMPS,
data: {
menuSearchComponentUrl: REPRESENT_MENU_SEARCH_URL,
bookmarksComponentUrl: REPRESENT_BOOKMARKS_URL
menuSearchComponentUrl: REPRESENT_MENU_SEARCH_URL
}
},
{
......
......@@ -13,7 +13,6 @@ export class AuthGuard implements CanActivate {
}
checkLogin(permissions?: string[]): boolean {
debugger;
if (this.authCtx.isLoggedIn && !permissions) {
return true;
}
......
<div class="workarea container-fluid">
<div class="workarea">
<h2>Title example</h2>
<p class="lead">Lead example.</p>
<div
......@@ -7,6 +7,21 @@
[focus-trap]="isFormFocused"
initialFocus="#numField"
>
<h3>Menüü kasutamisest</h3>
FeatureFlag: {{ isFeatureFlagOn }}
<div *showFeature="'SEND_CREATED_COMBINED_OFFERING_NOTIFICATION_TO_CUSTOMER'">
is this feature visible?
</div>
<code class="mb-4">
SKAIS iseteeninduses on kasutusel ühe tasandilne navigatsioon. Selleks, et lehe kõrgus sõltuks
menüü kõrgusest on loodud css class <strong>.static</strong> ,mis tuleb lisada elementidele
<strong>.header-and-content-wrapper</strong> ja <strong>ska-global-menu</strong> <br />
Kui süsteemis on kasutusel kahetasandiline menüü (nt EMTA) siis ära kasuta
<strong>.static</strong> classi
</code>
<h3>Erinevad süsteemi tegevused katsetamiseks</h3>
<div class="row">
<div class="col">
<button success (click)="mockLogin()">Mock login</button>
......
......@@ -4,6 +4,7 @@ import { SkaMultiSelectOptions, SkaSelectOptions, TimepickerTime } from '@ska-an
import { LangContext, MenuContext, PageHeaderContext } from '@ska-angular/core';
import { DashboardMenuService, SkaBackdropService } from '@ska-angular/dashboard';
import { BsModalService, BsModalRef } from 'ngx-bootstrap';
import { FeatureFlagService } from 'libs/core/src/lib/feature-flag/feature-flag.service';
export class ExampleSelectObject {
public name: string;
......@@ -17,7 +18,7 @@ export class ExampleSelectObject {
// tslint:disable-next-line:max-classes-per-file
@Component({
selector: 'global.dashboard.container.example.component',
selector: 'global',
templateUrl: './global.dashboard.container.example.component.html'
})
export class GlobalDashboardContainerExampleComponent implements OnInit {
......@@ -28,6 +29,8 @@ export class GlobalDashboardContainerExampleComponent implements OnInit {
skaTimeLocked = true;
isFormFocused = false;
public isFeatureFlagOn;
skaSelectOptions: SkaSelectOptions;
skaSelects: ExampleSelectObject[];
skaSelectSelection: ExampleSelectObject;
......@@ -44,7 +47,8 @@ export class GlobalDashboardContainerExampleComponent implements OnInit {
private pageHeaderCtx: PageHeaderContext,
private menuService: DashboardMenuService,
private backdropService: SkaBackdropService,
private modalService: BsModalService
private modalService: BsModalService,
private featureFlagService: FeatureFlagService
) {
// NB! add data in constructor not inside #ngOnInit!
this.toggleLinks();
......@@ -71,6 +75,7 @@ export class GlobalDashboardContainerExampleComponent implements OnInit {
this.backdropService.getVisibility().subscribe(isVisible => {
this.isFormFocused = isVisible;
});
this.isFeatureFlagOn = this.featureFlagService.isFeatureEnabled('WRONG_FLAG');
}
private createSkaSelectObjects(): ExampleSelectObject[] {
......
......@@ -19,7 +19,7 @@ export class OfficialDashboardContainerExampleComponent implements OnInit {
}
ngOnInit(): void {
this.dbrOfficialUserContext.setUser({ name: 'Jaanus', code: '123234124' });
this.dbrOfficialUserContext.setUser({ id: '1252', name: 'Jaanus', code: '123234124' });
}
public mockLogin() {
......
......@@ -71,19 +71,7 @@ export class RepresentDashboardContainerExampleComponent implements OnInit {
public mockNoRepresentatives() {}
public toggleLinks() {
// this.transitionContainerCtx.clearEvents();
// [0, 1, 3].forEach(() => {
// let num = this.toggleLinksCount;
// this.transitionContainerCtx.addEvent({
// urlMessage: 'test' + num,
// clickFn: () => {
// alert('clicked test' + num);
// }
// });
// this.toggleLinksCount++;
// });
}
public toggleLinks() {}
public setEnglish() {
this.langCtx.selectLang(LangContext.EN);
......
<h2>Some cool heading</h2>
<div class="section">
<div class="row">
<div class="col">
<button success (click)="mockLogin()">Mock login</button>
&nbsp;&nbsp;&nbsp;
<button danger (click)="mockLogout()">Mock logout</button>
<br /><br />
</div>
</div>
<div class="row">
<div class="col">
<button success (click)="mockRepresentatives()">Mock representatives</button>
&nbsp;&nbsp;&nbsp;
<button danger (click)="mockNoRepresentatives()">Mock no representatives</button>
<br /><br />
</div>
</div>
<div class="row">
<div class="col">
<button info (click)="setEnglish()">Set English from here</button>
&nbsp;&nbsp;&nbsp;
<button info (click)="setRussian()">Set Russian from here</button>
<br /><br />
</div>
</div>
<div class="row">
<div class="col"><button light (click)="toggleLinks()">Toogle links</button></div>
</div>
</div>
import { Component } from '@angular/core';
import { AuthContext } from '@ska-angular/auth';
import { LangContext, SupportInfoContext } from '@ska-angular/core';
import { MockAuthUtil } from '@ska-angular/auth';
@Component({
selector: 'transition.container.example.component',
templateUrl: './transition.container.example.component.html'
})
export class TransitionContainerExampleComponent {
private toggleLinksCount = 1;
public constructor(
private authCtx: AuthContext,
private langCtx: LangContext,
private supportInfoContext: SupportInfoContext
) {
// NB! add data in constructor not inside #ngOnInit!
this.toggleLinks();
}
public mockLogin() {
MockAuthUtil.mockLogin(this.authCtx);
}
public mockLogout() {
MockAuthUtil.mockLogout(this.authCtx);
}
public mockRepresentatives() {}
public mockNoRepresentatives() {}
public toggleLinks() {
this.supportInfoContext.clearQuickLinks();
[0, 1, 3].forEach(() => {
const num = this.toggleLinksCount;
this.supportInfoContext.addUrlEvent({
label: 'test' + num,
clickFn: () => {
alert('clicked test' + num);
}
});
this.toggleLinksCount++;
});
}
public setEnglish() {
this.langCtx.selectLang(LangContext.EN);
}
public setRussian() {
this.langCtx.selectLang(LangContext.RU);
}
}
......@@ -209,10 +209,26 @@
>
</li>
<li>
<a href="stylebook-home-page"
>2.1.21. {{ 'stylebook.home.page.components' | translate }}</a
>
<span>2.1.21. {{ 'stylebook.home.page.components' | translate }}</span>
<ul class="pl-3">
<li>
<a href="stylebook-home-page"
>2.1.21.1 {{ 'stylebook.home.page.with.data.components' | translate }}</a
>
</li>
<li>
<a href="stylebook-home-page-empty"
>2.1.21.2 {{ 'stylebook.home.page.empty.components' | translate }}</a
>
</li>
<li>
<a href="stylebook-home-page-no-content"
>2.1.21.3 {{ 'stylebook.home.page.no.content.components' | translate }}</a
>
</li>
</ul>
</li>
<li>
<span>2.1.22. {{ 'stylebook.group.name.messages' | translate }}</span>
<ul class="pl-3">
......
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { Observable, of } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
import { DashboardMenuService } from '@ska-angular/dashboard';
import { MessageContext } from '@ska-angular/core';
@Injectable({
providedIn: 'root'
})
export class AppOfficialMenuResolver implements Resolve<any> {
constructor(
private menuService: DashboardMenuService,
private translate: TranslateService,
private messageCtx: MessageContext
) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<any> {
return this.menuService.getOfficeMenu('assets/mock-ot-menu-items.json').pipe(
catchError(() => {
this.messageCtx.addError(this.translate.instant('error.menu.item-tree'));
return of([]);
})
);
}
}
......@@ -53,6 +53,57 @@
<strong>ainult ikooniga ja ümmargune</strong>, siis lisa nupule klass
<strong>.btn-round</strong>.
</p>
<h2>Nupud linkidena</h2>
<div class="mb-4">
<p>
Nupud töötavad ka a tagina. A tag-i kasutada ainult juhul, kui nupule vajutus viib kasutaja
teisele urlile
</p>
<a href-void class="btn btn-link mx-2">Tertsiaarne</a>
<a href-void class="btn btn-light mx-2">Sekundaarne</a>
<a href-void class="btn btn-info mx-2">Primaarne</a>
</div>
<h2>Nupud ja lingid teksti sees</h2>
<div class="mb-4">
<p>
Kui on vajadus kuvada teksti sisse nuppe või linke siis on olemas