Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
fix: Remove bootstrap styles from @rucken/core move it to @rucken/web
Browse files Browse the repository at this point in the history
  • Loading branch information
EndyKaufman committed Dec 9, 2018
1 parent 049f1bf commit 215f892
Show file tree
Hide file tree
Showing 17 changed files with 301 additions and 336 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ export class BaseEntityListModalComponent<TModel extends IModel> implements IBas
no = new EventEmitter<any>();
@Output()
yes = new EventEmitter<any>();

@Input()
yesClass: string;
@Input()
yesClass = 'btn btn-primary';
noClass: string;

@Input()
hideNo = false;
@Input()
Expand Down
10 changes: 5 additions & 5 deletions libs/rucken/core/src/lib/base/base-entity-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class BaseEntityListComponent<TModel extends IModel> implements IBaseEnti
const modalRef = await this.modalsService.createAsync<BasePromptFormModalComponent<TModel>>(
this.modalView.component || this.modalItem.component,
{
class: this.modalView.class || this.modalItem.class || 'modal-md',
class: this.modalView.class || this.modalItem.class,
initialState: {
title: title,
noTitle: translate('Close'),
Expand Down Expand Up @@ -208,7 +208,7 @@ export class BaseEntityListComponent<TModel extends IModel> implements IBaseEnti
const modalRef = await this.modalsService.createAsync<BasePromptFormModalComponent<TModel>>(
this.modalCreate.component || this.modalItem.component,
{
class: this.modalCreate.class || this.modalItem.class || 'modal-md',
class: this.modalCreate.class || this.modalItem.class,
initialState: {
title: title,
yesTitle: translate('Create'),
Expand Down Expand Up @@ -274,7 +274,7 @@ export class BaseEntityListComponent<TModel extends IModel> implements IBaseEnti
const modalRef = await this.modalsService.createAsync<BasePromptFormModalComponent<TModel>>(
this.modalUpdate.component || this.modalItem.component,
{
class: this.modalUpdate.class || this.modalItem.class || 'modal-md',
class: this.modalUpdate.class || this.modalItem.class,
initialState: {
title: title,
yesTitle: translate('Save'),
Expand Down Expand Up @@ -343,7 +343,7 @@ export class BaseEntityListComponent<TModel extends IModel> implements IBaseEnti
const modalRef = await this.modalsService.createAsync<BasePromptFormModalComponent<TModel>>(
this.modalDelete.component || this.modalItem.component,
{
class: this.modalDelete.class || this.modalItem.class || 'modal-md',
class: this.modalDelete.class || this.modalItem.class,
initialState: {
title: title,
message: message,
Expand Down Expand Up @@ -408,7 +408,7 @@ export class BaseEntityListComponent<TModel extends IModel> implements IBaseEnti
const modalRef = await this.modalsService.createAsync<BaseEntityListModalComponent<TModel>>(
this.modalAppendFromGrid.component,
{
class: this.modalAppendFromGrid.class || this.modalItem.class || 'modal-md',
class: this.modalAppendFromGrid.class || this.modalItem.class,
initialState: {
title: title,
yesTitle: translate('Append'),
Expand Down
1 change: 1 addition & 0 deletions libs/rucken/core/src/lib/base/base-form.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class IBaseForm {
yes: EventEmitter<any>;
disabled: boolean;
yesClass: string;
noClass: string;
hideNo: boolean;
hideYes: boolean;
readonly: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ export class BasePromptFormModalComponent<TModel extends IModel> implements IBas
no = new EventEmitter<any>();
@Output()
yes = new EventEmitter<any>();

@Input()
yesClass: string;
@Input()
yesClass = 'btn btn-primary';
noClass: string;

@Input()
hideNo = false;
@Input()
Expand Down
6 changes: 5 additions & 1 deletion libs/rucken/core/src/lib/base/base-prompt-modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ export class BasePromptModalComponent implements IBaseForm {
yes = new EventEmitter<any>();
@Input()
disabled: boolean;

@Input()
yesClass: string;
@Input()
yesClass = 'btn btn-primary';
noClass: string;

@Input()
hideNo = false;
@Input()
Expand Down
6 changes: 5 additions & 1 deletion libs/rucken/core/src/lib/base/base-prompt-panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ export class BasePromptPanelComponent<TModel extends IModel> implements ControlV
no = new EventEmitter<any>();
@Output()
yes = new EventEmitter<any>();

@Input()
yesClass: string;
@Input()
yesClass = 'btn btn-primary';
noClass: string;

@Input()
hideNo = false;
@Input()
Expand Down
6 changes: 5 additions & 1 deletion libs/rucken/core/src/lib/base/base-prompt.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ export class BasePromptComponent implements IBaseForm {
yes = new EventEmitter<any>();
@Input()
disabled: boolean;

@Input()
yesClass: string;
@Input()
yesClass = 'btn btn-primary';
noClass: string;

@Input()
hideNo = false;
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export class AuthModalService {
componentModal: string | TemplateRef<any> | any;
signInInfoMessage: string;
#InfoMessage: string;
signInModalClass: string;
signOutModalClass: string;

constructor(
public authService: AuthService,
Expand All @@ -29,7 +31,6 @@ export class AuthModalService {
this.modalsService
.errorAsync({
error: translate('Your session has expired, please re-login'),
class: 'modal-md',
onTop: true
})
.then(result => this.authService.signOut().subscribe(data => this.onSignOutSuccess(undefined)));
Expand All @@ -53,7 +54,7 @@ export class AuthModalService {
}
async onSignOutAsync() {
const modalRef = await this.modalsService.createAsync<AuthModalComponent>(this.componentModal, {
class: 'modal-md',
class: this.signOutModalClass,
initialState: {
type: AuthModalTypeEnum.SignOut,
noTitle: translate('No')
Expand All @@ -69,7 +70,7 @@ export class AuthModalService {
}
async onSignInAsync() {
const modalRef = await this.modalsService.createAsync<AuthModalComponent>(this.componentModal, {
class: 'modal-xs',
class: this.signInModalClass,
initialState: {
type: AuthModalTypeEnum.SignIn,
data: {},
Expand Down
3 changes: 3 additions & 0 deletions libs/rucken/core/src/lib/modules/modals/modals.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { IModalRef } from './modal-ref.interface';
export class ModalsService {
componentInfoModal: string | TemplateRef<any> | any;
componentErrorModal: string | TemplateRef<any> | any;
modalClass: string;
yesClass: string;
noClass: string;

createAsync<TComponent>(
component: string | TemplateRef<TComponent> | any,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
<form
[formGroup]="form"
*ngIf="form"
novalidate>
<prompt-form-modal
[title]="title"
[message]="message"
[infoMessage]="infoMessage"
[errorMessage]="errorMessage"
[noTitle]="noTitle"
[yesTitle]="yesTitle"
[readonly]="readonly"
(no)="onNoClick()"
(yes)="onYesClick()"
[data]="data"
[processing]="processing$ | async">
<span *ngFor="let key of keys; let i = index">
<form-group
[checkIsDirty]="checkIsDirty"
[form]="form"
[name]="key"
[title]="strings[key]">
<input
[formControlName]="key"
[readonly]="readonly"
[autofocus]="i===0">
</form-group>
</span>
</prompt-form-modal>
<form [formGroup]="form" *ngIf="form" novalidate>
<prompt-form-modal
[title]="title"
[message]="message"
[infoMessage]="infoMessage"
[errorMessage]="errorMessage"
[noTitle]="noTitle"
[yesTitle]="yesTitle"
[readonly]="readonly"
(no)="onNoClick()"
(yes)="onYesClick()"
[data]="data"
[processing]="processing$ | async"
[yesClass]="yesClass"
[noClass]="noClass"
>
<span *ngFor="let key of keys; let i = index">
<form-group [checkIsDirty]="checkIsDirty" [form]="form" [name]="key" [title]="strings[key]">
<input [formControlName]="key" [readonly]="readonly" [autofocus]="i === 0" />
</form-group>
</span>
</prompt-form-modal>
</form>
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
<form
[formGroup]="form"
novalidate>
<prompt-form-modal
[title]="title"
[message]="message"
[infoMessage]="infoMessage"
[errorMessage]="errorMessage"
[noTitle]="noTitle"
[yesTitle]="yesTitle"
[readonly]="readonly"
(no)="onNoClick()"
(yes)="onYesClick()"
[data]="data"
[processing]="processing$ | async">
<form-group
[checkIsDirty]="checkIsDirty"
[form]="form"
name="name"
[title]="strings.name">
<input
formControlName="name"
[readonly]="readonly"
focused>
</form-group>
<form-group
[checkIsDirty]="checkIsDirty"
[form]="form"
name="title"
[title]="strings.title">
<input
formControlName="title"
[readonly]="readonly">
</form-group>
</prompt-form-modal>
<form [formGroup]="form" novalidate>
<prompt-form-modal
[title]="title"
[message]="message"
[infoMessage]="infoMessage"
[errorMessage]="errorMessage"
[noTitle]="noTitle"
[yesTitle]="yesTitle"
[readonly]="readonly"
(no)="onNoClick()"
(yes)="onYesClick()"
[data]="data"
[processing]="processing$ | async"
[yesClass]="yesClass"
[noClass]="noClass"
>
<form-group [checkIsDirty]="checkIsDirty" [form]="form" name="name" [title]="strings.name">
<input formControlName="name" [readonly]="readonly" focused />
</form-group>
<form-group [checkIsDirty]="checkIsDirty" [form]="form" name="title" [title]="strings.title">
<input formControlName="title" [readonly]="readonly" />
</form-group>
</prompt-form-modal>
</form>
Original file line number Diff line number Diff line change
@@ -1,42 +1,31 @@
<form
[formGroup]="form"
novalidate>
<prompt-form-modal
[title]="title"
[message]="message"
[infoMessage]="infoMessage"
[errorMessage]="errorMessage"
[noTitle]="noTitle"
[yesTitle]="yesTitle"
[readonly]="readonly"
(no)="onNoClick()"
(yes)="onYesClick()"
[data]="data"
[processing]="processing$ | async">
<form-group
[checkIsDirty]="checkIsDirty"
[form]="form"
name="name"
[title]="strings.name">
<input
formControlName="name"
[readonly]="readonly"
focused>
</form-group>
<form-group
[checkIsDirty]="checkIsDirty"
[form]="form"
name="title"
[title]="strings.title">
<input
formControlName="title"
[readonly]="readonly">
</form-group>
<group-permissions-grid
[mockedItems]="data.permissions"
(mockedItemsChange)="onPermissionsChange($event)"
[readonly]="readonly"
[title]="strings.permissions"
[apiUrl]="apiUrl"></group-permissions-grid>
</prompt-form-modal>
<form [formGroup]="form" novalidate>
<prompt-form-modal
[title]="title"
[message]="message"
[infoMessage]="infoMessage"
[errorMessage]="errorMessage"
[noTitle]="noTitle"
[yesTitle]="yesTitle"
[readonly]="readonly"
(no)="onNoClick()"
(yes)="onYesClick()"
[data]="data"
[processing]="processing$ | async"
[yesClass]="yesClass"
[noClass]="noClass"
>
<form-group [checkIsDirty]="checkIsDirty" [form]="form" name="name" [title]="strings.name">
<input formControlName="name" [readonly]="readonly" focused />
</form-group>
<form-group [checkIsDirty]="checkIsDirty" [form]="form" name="title" [title]="strings.title">
<input formControlName="title" [readonly]="readonly" />
</form-group>
<group-permissions-grid
[mockedItems]="data.permissions"
(mockedItemsChange)="onPermissionsChange($event)"
[readonly]="readonly"
[title]="strings.permissions"
[apiUrl]="apiUrl"
></group-permissions-grid>
</prompt-form-modal>
</form>
Loading

0 comments on commit 215f892

Please # to comment.