Skip to content

Commit

Permalink
feat(core/reports): add string identifier in report interface
Browse files Browse the repository at this point in the history
refactor: move common string identifier in core/common package
refactor: form string identifier extends common interface
  • Loading branch information
trik committed Dec 3, 2020
1 parent fd13fd9 commit 6e3abab
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/core/common/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ export * from './auto-focus.directive';
export * from './common-module';
export * from './dnd-directive';
export * from './format-if-number';
export * from './string-identifier';
export * from './translate-if-string';
export * from './video.directive';
26 changes: 26 additions & 0 deletions src/core/common/string-identifier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @license
* Copyright (C) Gnucoop soc. coop.
*
* This file is part of the Advanced JSON forms (ajf).
*
* Advanced JSON forms (ajf) is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
* General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Advanced JSON forms (ajf).
* If not, see http://www.gnu.org/licenses/.
*
*/

export interface AjfStringIdentifier {
label: string;
value: string[];
}
7 changes: 3 additions & 4 deletions src/core/forms/interface/forms/form-string-identifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*
*/

export interface AjfFormStringIdentifier {
label: string;
value: string[];
}
import {AjfStringIdentifier} from '@ajf/core/common';

export type AjfFormStringIdentifier = AjfStringIdentifier;
25 changes: 25 additions & 0 deletions src/core/reports/interface/reports/report-string-identifier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @license
* Copyright (C) Gnucoop soc. coop.
*
* This file is part of the Advanced JSON forms (ajf).
*
* Advanced JSON forms (ajf) is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
* General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Advanced JSON forms (ajf).
* If not, see http://www.gnu.org/licenses/.
*
*/

import {AjfStringIdentifier} from '@ajf/core/common';

export type AjfReportStringIdentifier = AjfStringIdentifier;
2 changes: 2 additions & 0 deletions src/core/reports/interface/reports/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import {AjfForm} from '@ajf/core/forms';
import {AjfStyles} from '../styles';
import {AjfReportContainer} from './report-container';
import {AjfReportStringIdentifier} from './report-string-identifier';
import {AjfReportVariable} from './report-variable';

export interface AjfReport {
Expand All @@ -32,4 +33,5 @@ export interface AjfReport {
styles?: AjfStyles;
forms?: AjfForm[];
variables?: AjfReportVariable[];
stringIdentifier?: AjfReportStringIdentifier[];
}
1 change: 1 addition & 0 deletions src/core/reports/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export * from './interface/dataset/dataset';
export * from './interface/dataset/table-dataset';
export * from './interface/reports/report';
export * from './interface/reports/report-container';
export * from './interface/reports/report-string-identifier';
export * from './interface/reports/report-variable';
export * from './interface/reports-instances/report-container-instance';
export * from './interface/reports-instances/report-instance';
Expand Down
5 changes: 5 additions & 0 deletions tools/public_api_guard/core/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export declare class AjfDndDirective {
static ɵfac: i0.ɵɵFactoryDef<AjfDndDirective, never>;
}

export interface AjfStringIdentifier {
label: string;
value: string[];
}

export declare class AjfVideoDirective implements AfterViewInit {
isInit: EventEmitter<any>;
get source(): HTMLVideoElement;
Expand Down
5 changes: 1 addition & 4 deletions tools/public_api_guard/core/forms.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,7 @@ export declare class AjfFormsModule {
static ɵmod: i0.ɵɵNgModuleDefWithMeta<AjfFormsModule, [typeof i1.AjfAsFieldInstancePipe, typeof i2.AjfAsRepeatingSlideInstancePipe, typeof i3.AjfBoolToIntPipe, typeof i4.AjfDateValuePipe, typeof i5.AjfDateValueStringPipe, typeof i6.AjfExpandFieldWithChoicesPipe, typeof i7.AjfFieldHost, typeof i8.AjfFieldIconPipe, typeof i9.AjfFieldIsValidPipe, typeof i10.AjfFileFieldComponent, typeof i11.AjfGetTableCellControlPipe, typeof i12.AjfImageFieldComponent, typeof i13.AjfIncrementPipe, typeof i14.AjfIsCellEditablePipe, typeof i15.AjfIsReadonlyInputFieldPipe, typeof i16.AjfIsRepeatingSlideInstancePipe, typeof i17.AjfNodeCompleteNamePipe, typeof i18.AjfRangePipe, typeof i19.AjfReadOnlyFieldComponent, typeof i20.AjfReadOnlyFileFieldComponent, typeof i21.AjfReadOnlyImageFieldComponent, typeof i22.AjfReadOnlySelectFieldComponent, typeof i23.AjfReadOnlyTableFieldComponent, typeof i24.AjfReadOnlyVideoUrlFieldComponent, typeof i25.AjfTableRowClass, typeof i26.AjfTableVisibleColumnsPipe, typeof i27.AjfValidSlidePipe], [typeof i28.AjfCommonModule, typeof i29.AjfFileInputModule, typeof i30.CommonModule, typeof i31.HttpClientModule, typeof i32.ReactiveFormsModule, typeof i33.TranslateModule], [typeof i1.AjfAsFieldInstancePipe, typeof i2.AjfAsRepeatingSlideInstancePipe, typeof i3.AjfBoolToIntPipe, typeof i4.AjfDateValuePipe, typeof i5.AjfDateValueStringPipe, typeof i6.AjfExpandFieldWithChoicesPipe, typeof i7.AjfFieldHost, typeof i8.AjfFieldIconPipe, typeof i9.AjfFieldIsValidPipe, typeof i10.AjfFileFieldComponent, typeof i11.AjfGetTableCellControlPipe, typeof i12.AjfImageFieldComponent, typeof i13.AjfIncrementPipe, typeof i14.AjfIsCellEditablePipe, typeof i15.AjfIsReadonlyInputFieldPipe, typeof i16.AjfIsRepeatingSlideInstancePipe, typeof i17.AjfNodeCompleteNamePipe, typeof i18.AjfRangePipe, typeof i19.AjfReadOnlyFieldComponent, typeof i20.AjfReadOnlyFileFieldComponent, typeof i21.AjfReadOnlyImageFieldComponent, typeof i22.AjfReadOnlySelectFieldComponent, typeof i23.AjfReadOnlyTableFieldComponent, typeof i24.AjfReadOnlyVideoUrlFieldComponent, typeof i25.AjfTableRowClass, typeof i26.AjfTableVisibleColumnsPipe, typeof i27.AjfValidSlidePipe]>;
}

export interface AjfFormStringIdentifier {
label: string;
value: string[];
}
export declare type AjfFormStringIdentifier = AjfStringIdentifier;

export interface AjfFormulaField extends AjfField {
fieldType: AjfFieldType.Formula;
Expand Down
3 changes: 3 additions & 0 deletions tools/public_api_guard/core/reports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export interface AjfReport {
footer?: AjfReportContainer;
forms?: AjfForm[];
header?: AjfReportContainer;
stringIdentifier?: AjfReportStringIdentifier[];
styles?: AjfStyles;
variables?: AjfReportVariable[];
}
Expand Down Expand Up @@ -241,6 +242,8 @@ export declare class AjfReportsModule {
static ɵmod: i0.ɵɵNgModuleDefWithMeta<AjfReportsModule, [typeof i1.AjfGetColumnContentPipe, typeof i2.AjfWidgetHost, typeof i3.AjfWidgetExport], [typeof i4.CommonModule], [typeof i1.AjfGetColumnContentPipe, typeof i2.AjfWidgetHost, typeof i3.AjfWidgetExport]>;
}

export declare type AjfReportStringIdentifier = AjfStringIdentifier;

export interface AjfReportVariable {
formula: AjfFormula;
name: string;
Expand Down

0 comments on commit 6e3abab

Please sign in to comment.