Skip to content

Commit e6d4b3b

Browse files
authored
Merge pull request #7 from bci-oss/feature/add-highlight-functionality
Add highlight functionality to search input in the commandbar
2 parents d380ce4 + 15ac545 commit e6d4b3b

File tree

14 files changed

+617
-333
lines changed

14 files changed

+617
-333
lines changed

README.md

Lines changed: 77 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22

33
## Table of Contents
44

5-
- [Introduction](#introduction)
6-
- [Getting help](#getting-help)
7-
- [Features](#features)
8-
- [Getting started](#getting-started)
9-
- [Prerequisites](#prerequisites)
10-
- [Using the schematic commands in external projects for testing purpose](#using-the-schematic-commands-in-external-projects-for-testing-purpose)
11-
- [Overview of the schematics commands](#overview-of-the-schematics-commands)
12-
- [The _types_ schematics](#the-_types_-schematics)
13-
- [Usage](#usage)
14-
- [Example type definition file](#example-type-definition-file)
15-
- [The _table_ schematics](#the-_table_-schematics)
16-
- [Features provided by the schematics table](#features-provided-by-the-schematics-table)
17-
- [Generate a component with the schematics command](#generate-a-component-with-the-schematics-command)
18-
- [Flags and options that can be used in the generation process](#flags-and-options-that-can-be-used-in-the-generation-process)
19-
- [Generate a component with a custom name](#generate-a-component-with-a-custom-name)
20-
- [Exclude one or more properties from the generation](#exclude-one-or-more-properties-from-the-generation)
21-
- [Multi-version support for Aspect Models](#multi-version-support-for-aspect-models)
22-
- [Manual adaptions in _app.module.ts_](#manual-adaptions-in-_appmodulets_)
23-
- [Show customized information in the table](#show-customized-information-in-the-table)
24-
- [Export functionality](#export-functionality)
25-
- [Custom icons for the command bar](#custom-icons-for-the-command-bar)
26-
- [Add translations](#add-translations)
27-
- [Pre-load config file](#pre-load-config-file)
28-
- [Skip Installation](#skip-install)
29-
- [Overwrite](#overwrite)
30-
- [Documentation](#documentation)
31-
- [License](#license)
5+
- [Introduction](#introduction)
6+
- [Getting help](#getting-help)
7+
- [Features](#features)
8+
- [Getting started](#getting-started)
9+
- [Prerequisites](#prerequisites)
10+
- [Using the schematic commands in external projects for testing purpose](#using-the-schematic-commands-in-external-projects-for-testing-purpose)
11+
- [Overview of the schematics commands](#overview-of-the-schematics-commands)
12+
- [The _types_ schematics](#the-_types_-schematics)
13+
- [Usage](#usage)
14+
- [Example type definition file](#example-type-definition-file)
15+
- [The _table_ schematics](#the-_table_-schematics)
16+
- [Features provided by the schematics table](#features-provided-by-the-schematics-table)
17+
- [Generate a component with the schematics command](#generate-a-component-with-the-schematics-command)
18+
- [Flags and options that can be used in the generation process](#flags-and-options-that-can-be-used-in-the-generation-process)
19+
- [Generate a component with a custom name](#generate-a-component-with-a-custom-name)
20+
- [Exclude one or more properties from the generation](#exclude-one-or-more-properties-from-the-generation)
21+
- [Multi-version support for Aspect Models](#multi-version-support-for-aspect-models)
22+
- [Manual adaptions in _app.module.ts_](#manual-adaptions-in-_appmodulets_)
23+
- [Show customized information in the table](#show-customized-information-in-the-table)
24+
- [Export functionality](#export-functionality)
25+
- [Custom icons for the command bar](#custom-icons-for-the-command-bar)
26+
- [Add translations](#add-translations)
27+
- [Pre-load config file](#pre-load-config-file)
28+
- [Skip Installation](#skip-install)
29+
- [Overwrite](#overwrite)
30+
- [Documentation](#documentation)
31+
- [License](#license)
3232

3333
## Introduction
3434

@@ -40,23 +40,23 @@ on [RDF aspect module object](https://www.w3.org/TR/turtle/).
4040

4141
Are you having trouble with SDK JS? We want to help!
4242

43-
- Check the [developer documentation](https://eclipse-esmf.github.io)
44-
- Having issues with the ESMF SDK JS schematics? Open
45-
a [GitHub issue](https://github.com/eclipse-esmf/esmf-sdk-js-schematics/issues).
43+
- Check the [developer documentation](https://eclipse-esmf.github.io)
44+
- Having issues with the ESMF SDK JS schematics? Open
45+
a [GitHub issue](https://github.com/eclipse-esmf/esmf-sdk-js-schematics/issues).
4646

4747
## Features
4848

4949
The schematics' collection for this package includes dynamic generation of:
5050

51-
- internationalization, using [i18n](https://angular.io/guide/i18n).
52-
- custom table components based on any aspect model loaded.
53-
- proper types of properties and entities used.
51+
- internationalization, using [i18n](https://angular.io/guide/i18n).
52+
- custom table components based on any aspect model loaded.
53+
- proper types of properties and entities used.
5454

5555
## SDK schematics uses ESMF Aspect Model Loader library
5656

57-
- This library is also an open source project and can be found
58-
at: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader (no action required, this library is already
59-
included in SDK schematics)
57+
- This library is also an open source project and can be found
58+
at: https://github.com/eclipse-esmf/esmf-sdk-js-aspect-model-loader (no action required, this library is already
59+
included in SDK schematics)
6060

6161
## SDK schematics generates components based on ttl files
6262

@@ -109,9 +109,9 @@ npm install @angular-devkit/schematics-cli -g
109109

110110
```json
111111
{
112-
"resolveJsonModule": true,
113-
"esModuleInterop": true,
114-
"allowSyntheticDefaultImports": true
112+
"resolveJsonModule": true,
113+
"esModuleInterop": true,
114+
"allowSyntheticDefaultImports": true
115115
}
116116
```
117117

@@ -142,9 +142,9 @@ schematics @esmf/semantic-ui-schematics:<schematics-name> --help
142142

143143
where `<schematics-name>` can be replaced by:
144144

145-
- table
146-
- i18n
147-
- types
145+
- table
146+
- i18n
147+
- types
148148

149149
7. add translations
150150

@@ -170,21 +170,6 @@ npm run combine-i18n
170170
And in assets folder an i18n folder should be generated. And i18n folder should contain the translations json files:
171171
en.movement-table.translation.json, en.json.
172172

173-
8. in index.html add a link to material icons:
174-
175-
```html
176-
177-
<head>
178-
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"/>
179-
</head>
180-
```
181-
182-
9. in styles.css import the material theme:
183-
184-
```styles.css
185-
@import '~@angular/material/prebuilt-themes/indigo-pink.css';
186-
```
187-
188173
## Overview of the schematics commands
189174

190175
### The _types_ schematics
@@ -263,13 +248,14 @@ the [angular material package](https://v12.material.angular.io/components/table/
263248
8. Column ordering
264249
9. Default sorting column selection
265250
10. Removing properties from tables header
266-
11. Column pop-up selection for showing/hiding the columns header after table generation
267-
12. Wizard output to regenerate the same table without going through the wizard again
268-
13. JSON access path
269-
14. Custom actions for a row in the table
270-
15. Pagination
271-
16. Client or remote data handling
272-
17. Possibility to add a custom service which can or cannot be overridden when generating the same component again
251+
11. Select if translations should be generated for removed properties.
252+
12. Column pop-up selection for showing/hiding the columns header after table generation
253+
13. Wizard output to regenerate the same table without going through the wizard again
254+
14. JSON access path
255+
15. Custom actions for a row in the table
256+
16. Pagination
257+
17. Client or remote data handling
258+
18. Possibility to add a custom service which can or cannot be overridden when generating the same component again
273259

274260
## Generate a component with the schematics command
275261

@@ -314,8 +300,7 @@ this will be the result in the generated component .ts file
314300
templateUrl: './movement-table.component.html',
315301
styleUrls: ['./movement-table.component.scss'],
316302
})
317-
export class MovementTableComponent {
318-
}
303+
export class MovementTableComponent {}
319304
```
320305

321306
By running the command with the '--name' flag
@@ -333,8 +318,7 @@ selector.
333318
templateUrl: './custom-table.component.html', // <- provided name reflected in the component path
334319
styleUrls: ['./custom-table.component.scss'], // <- provided name reflected in the component files
335320
})
336-
export class CustomTableComponent {
337-
} // <- provided name reflected in the component class name
321+
export class CustomTableComponent {} // <- provided name reflected in the component class name
338322
```
339323

340324
---
@@ -510,17 +494,17 @@ By pressing it, a modal dialog window will appear with multiple options.
510494
<esmf-sdk-ui-movement-table-v321 [extendedCsvExporter]="csvExporter"></esmf-sdk-ui-movement-table-v321>
511495
```
512496

513-
The `csvExporter` function will have a type `ExtendedCsvExporter` exported in the component's service file, and it
514-
will need to implement a function with 2 arguments, the displayed columns and the RQL query which will query the data
515-
from the backend.
497+
The `csvExporter` function will have a type `ExtendedCsvExporter` exported in the component's service file, and it
498+
will need to implement a function with 2 arguments, the displayed columns and the RQL query which will query the data
499+
from the backend.
516500

517501
```typescript
518502
export interface ExtendedCsvExporter {
519503
export(displayedColumns: string[], rqlQuery: string): void;
520504
}
521505
```
522506

523-
If this function is not exposed to the component, this option will not appear in the export dialog window.
507+
If this function is not exposed to the component, this option will not appear in the export dialog window.
524508

525509
#### Custom icons for the command bar
526510

@@ -579,41 +563,27 @@ Example of configuration file:
579563
580564
```json
581565
{
582-
"aspectModelTFiles": [
583-
"FOLDER\\Movement.ttl"
584-
],
585-
"excludedProperties": [],
586-
"configFile": "wizard-config.json",
587-
"complexProps": [
588-
{
589-
"prop": "position",
590-
"propsToShow": [
591-
"x",
592-
"y",
593-
"z"
594-
]
595-
}
596-
],
597-
"selectedModelElementUrn": "urn:samm:org.eclipse.esmf.test:1.0.0#Movement",
598-
"jsonAccessPath": "",
599-
"defaultSortingCol": "moving",
600-
"customColumns": [],
601-
"addRowCheckboxes": false,
602-
"customRowActions": [
603-
"schedule"
604-
],
605-
"addCommandBar": true,
606-
"enabledCommandBarFunctions": [
607-
"addCustomCommandBarActions",
608-
"addSearchBar",
609-
"addEnumQuickFilters"
610-
],
611-
"customCommandBarActions": [
612-
"edit.svg"
613-
],
614-
"enableRemoteDataHandling": true,
615-
"enableVersionSupport": true,
616-
"overwrite": true
566+
"aspectModelTFiles": ["FOLDER\\Movement.ttl"],
567+
"excludedProperties": [],
568+
"configFile": "wizard-config.json",
569+
"complexProps": [
570+
{
571+
"prop": "position",
572+
"propsToShow": ["x", "y", "z"]
573+
}
574+
],
575+
"selectedModelElementUrn": "urn:samm:org.eclipse.esmf.test:1.0.0#Movement",
576+
"jsonAccessPath": "",
577+
"defaultSortingCol": "moving",
578+
"customColumns": [],
579+
"addRowCheckboxes": false,
580+
"customRowActions": ["schedule"],
581+
"addCommandBar": true,
582+
"enabledCommandBarFunctions": ["addCustomCommandBarActions", "addSearchBar", "addEnumQuickFilters"],
583+
"customCommandBarActions": ["edit.svg"],
584+
"enableRemoteDataHandling": true,
585+
"enableVersionSupport": true,
586+
"overwrite": true
617587
}
618588
```
619589

src/ng-generate/table-prompter/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,14 @@ function getUserConfigQuestions(allAnswers: any, tree: Tree, options: Schema): Q
496496
},
497497
};
498498

499+
const requestGenerateLabelsForExcludedProps = {
500+
type: 'confirm',
501+
name: 'getExcludedPropLabels',
502+
message: 'Do you want to generate translation labels for excluded properties?',
503+
when: (answers: any) => answers.excludedProperties.length > 0,
504+
default: false,
505+
};
506+
499507
const requestCustomRowActions = {
500508
type: 'suggest',
501509
name: 'customRowActions',
@@ -680,6 +688,7 @@ function getUserConfigQuestions(allAnswers: any, tree: Tree, options: Schema): Q
680688
return [
681689
requestJSONPathSelectedModelElement,
682690
requestExcludedProperties,
691+
requestGenerateLabelsForExcludedProps,
683692
requestDefaultSortingCol,
684693
requestCustomColumnNames,
685694
requestRowCheckboxes,

0 commit comments

Comments
 (0)