@genesislcap/blank-app-seed 3.29.1-prerelease.10 → 3.29.1-prerelease.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed-config",
3
3
  "description": "Genesis Blank App Seed Configuration",
4
- "version": "3.29.1-prerelease.10",
4
+ "version": "3.29.1-prerelease.12",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "lint": "eslint .",
@@ -1,38 +1,30 @@
1
-
2
- {{#if tile.config.permissions.viewRight}}
3
1
  import { getUser } from '@genesislcap/foundation-user';
4
2
  import { getViewUpdateRightComponent } from '../../../utils';
5
3
  import ErrorMessage from '../../../components/ErrorMessage/ErrorMessage';
6
- {{else}}{{#if tile.config.permissions.updateRight}}
7
- import { getViewUpdateRightComponent } from '../../../utils';
8
- import { getUser } from '@genesislcap/foundation-user';
9
- import ErrorMessage from '../../../components/ErrorMessage/ErrorMessage';
10
- {{/if}}{{/if}}
11
4
  {{#if tile.config.createFormUiSchema}}
12
- import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
5
+ import { createFormSchema as createFormSchemaTile } from './{{kebabCase tile.title}}.create.form.schema';
13
6
  {{/if}}
14
7
  {{#if tile.config.uischema}}
15
- import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
8
+ import { createFormSchema as createFormSchemaTile } from './{{kebabCase tile.title}}.create.form.schema';
16
9
  {{/if}}
17
10
  {{#if tile.config.updateFormUiSchema}}
18
- import { updateFormSchema } from './{{kebabCase tile.title}}.update.form.schema';
11
+ import { updateFormSchema as updateFormSchemaTile } from './{{kebabCase tile.title}}.update.form.schema';
19
12
  {{/if}}
20
13
  {{#if tile.config.columns}}
21
- import { columnDefs } from './{{kebabCase tile.title}}.column.defs';
14
+ import { columnDefs as columnDefsTile } from './{{kebabCase tile.title}}.column.defs';
22
15
  {{/if}}
23
16
  {{#if tile.config.gridOptions}}
24
- import { gridOptions as tileGridOptions } from './{{kebabCase tile.title}}.gridOptions';
17
+ import { gridOptions as gridOptionsTile } from './{{kebabCase tile.title}}.gridOptions';
25
18
  {{/if}}
26
19
  import './{{kebabCase tile.title}}.component.css';
27
20
 
28
- export const {{pascalCase tile.componentName}} = () => { {{#if tile.config.permissions.viewRight}}
29
- const hasUserPermission = (permissionCode) => getViewUpdateRightComponent(getUser(), permissionCode);{{else}}{{#if tile.config.permissions.updateRight}}
30
- const hasUserPermission = (permissionCode) => getViewUpdateRightComponent(getUser(), permissionCode);{{/if}}{{/if}}{{#if tile.config.createFormUiSchema}}
31
- const createFormSchema = createFormSchema;{{/if}}{{#if tile.config.uischema}}
32
- const uischema = createFormSchema;{{/if}}{{#if tile.config.updateFormUiSchema}}
33
- const updateFormSchema = updateFormSchema;{{/if}}{{#if tile.config.columns}}
34
- const columnDefs = columnDefs;{{/if}}{{#if tile.config.gridOptions}}
35
- const gridOptions = tileGridOptions;{{/if}}{{#if tile.config.reqrep}}
21
+ export const {{pascalCase tile.componentName}} = () => {
22
+ const hasUserPermission = (permissionCode) => getViewUpdateRightComponent(getUser(), permissionCode);{{#if tile.config.createFormUiSchema}}
23
+ const createFormSchema = createFormSchemaTile;{{/if}}{{#if tile.config.uischema}}
24
+ const uischema = createFormSchemaTile;{{/if}}{{#if tile.config.updateFormUiSchema}}
25
+ const updateFormSchema = updateFormSchemaTile;{{/if}}{{#if tile.config.columns}}
26
+ const columnDefs = columnDefsTile;{{/if}}{{#if tile.config.gridOptions}}
27
+ const gridOptions = gridOptionsTile;{{/if}}{{#if tile.config.reqrep}}
36
28
  const reqrep = { pollingInterval: 5000 };{{/if}}{{#if tile.config.type}}
37
29
  const chartConfig = { {{#ifEquals tile.config.type 'pie'}}
38
30
  "radius": 0.75,
@@ -1,5 +1,7 @@
1
1
  {{#if config.permissions.viewRight}}hasUserPermission('{{config.permissions.viewRight}}') ? ({{/if}}
2
2
  <rapid-grid-pro
3
+ header-case-type="capitalCase"{{#if config.useOnlyTemplateCols}}
4
+ only-template-col-defs{{/if}}
3
5
  enable-row-flashing
4
6
  enable-cell-flashing
5
7
  >
@@ -15,6 +17,11 @@
15
17
  deferredGridOptions=\{{ onRowClicked: gridOptions?.onRowClicked }}
16
18
  {{/if}}
17
19
  ></grid-pro-genesis-datasource>
20
+ {{#if config.gridOptions}}
21
+ {gridOptions?.columnDefs?.map((columnDef, index) => (
22
+ <grid-pro-column key={index} definition={columnDef}></grid-pro-column>
23
+ ))}
24
+ {{/if}}
18
25
  </rapid-grid-pro>{{#if config.permissions.viewRight}}
19
26
  ) : (
20
27
  <ErrorMessage elementType="h3" message="You do not have access to view this component." />
@@ -1,5 +1,5 @@
1
1
  {
2
- "UI": "14.201.0",
2
+ "UI": "14.203.1",
3
3
  "GSF": "8.3.0-beta4",
4
4
  "Auth": "8.3.0-beta4"
5
5
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.29.1-prerelease.12](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.29.1-prerelease.11...v3.29.1-prerelease.12) (2024-09-03)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * update unit test commands in package.json (#329) 290a3ab
9
+
10
+ ## [3.29.1-prerelease.11](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.29.1-prerelease.10...v3.29.1-prerelease.11) (2024-08-28)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * automated dependency version update [skip-ci] [PSD-9](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/9) (#323) aea0500
16
+
3
17
  ## [3.29.1-prerelease.10](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.29.1-prerelease.9...v3.29.1-prerelease.10) (2024-08-23)
4
18
 
5
19
 
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
2
  root: true,
3
- env: { browser: true, es2020: true },
3
+ env: { browser: true, es2020: true, node: true, jest: true },
4
4
  extends: [
5
5
  'eslint:recommended',
6
6
  'plugin:@typescript-eslint/recommended',
@@ -10,6 +10,8 @@ module.exports = {
10
10
  parser: '@typescript-eslint/parser',
11
11
  plugins: ['react-refresh'],
12
12
  rules: {
13
+ '@typescript-eslint/no-unused-vars': 'off',
14
+ '@typescript-eslint/no-var-requires': 'off',
13
15
  'react-refresh/only-export-components': [
14
16
  'warn',
15
17
  { allowConstantExport: true },
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>{{pkgName}}</title>
7
+ <title>{{capitalCase appName}}</title>
8
8
  </head>
9
9
  <body>
10
10
  <div id="root"></div>
@@ -0,0 +1,18 @@
1
+ const { execSync } = require('child_process');
2
+ const glob = require('glob');
3
+ const path = require('path');
4
+ const cssFiles = glob.sync(path.join(__dirname, '**/*.css'));
5
+
6
+ if (cssFiles.length === 0) {
7
+ console.log('No CSS files found.');
8
+ process.exit(0);
9
+ }
10
+
11
+ const command = `genx lint -l stylelint ${cssFiles.join(' ')}`;
12
+
13
+ try {
14
+ execSync(command, { stdio: 'inherit' });
15
+ } catch (error) {
16
+ console.error('Error running stylelint:', error);
17
+ process.exit(1);
18
+ }
@@ -5,12 +5,26 @@
5
5
  "scripts": {
6
6
  "baseline": "npm run clean && npm run bootstrap",
7
7
  "bootstrap": "npm i --legacy-peer-deps",
8
+ "bootstrap:ci": "npm ci --no-fund --no-audit",
9
+ "build": "vite build",
10
+ "build:stats": "npm run build --stats-json",
11
+ "clean": "genx clean dist node_modules",
8
12
  "dev": "vite",
9
- "build": "tsc -b && vite build",
10
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
11
- "serve": "vite preview",
12
- "clean": "rm -rf node_modules dist",
13
- "lint:fix": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix"
13
+ "dev:docker": "npm run dev -- --host 0.0.0.0",
14
+ "dev:no-open": "NO_OPEN=true npm run dev",
15
+ "dev:intellij": "npm run dev",
16
+ "dev:https": "HTTPS=true npm run dev",
17
+ "dsconfig": "dsconfig --path src/styles/design-tokens.json",
18
+ "lint": "eslint src/**/*.js src/**/*.jsx",
19
+ "lint:fix": "eslint src/**/*.js src/**/*.jsx --fix",
20
+ "lint:eslint": "npm lint",
21
+ "lint:stylelint": "node lint-css.js",
22
+ "test": "genx test",
23
+ "test:e2e": "genx test --e2e",
24
+ "test:e2e:debug": "genx test --e2e --debug",
25
+ "test:e2e:ui": "genx test --e2e --interactive",
26
+ "test:coverage": "genx test --no-watch --coverage",
27
+ "test:unit:watch": "genx test --watch"
14
28
  },
15
29
  "dependencies": {
16
30
  "@ag-grid-community/client-side-row-model": "29.2.0",
@@ -37,6 +51,15 @@
37
51
  "react-router-dom": "6.24.1"
38
52
  },
39
53
  "devDependencies": {
54
+ "@genesislcap/design-system-configurator": "{{versions.UI}}",
55
+ "@genesislcap/eslint-config": "{{versions.UI}}",
56
+ "@genesislcap/prettier-config": "{{versions.UI}}",
57
+ "@genesislcap/foundation-testing": "{{versions.UI}}",
58
+ "@genesislcap/genx": "{{versions.UI}}",
59
+ "@genesislcap/build-kit": "{{versions.UI}}",
60
+ "@testing-library/dom": "^10.4.0",
61
+ "@testing-library/jest-dom": "^6.5.0",
62
+ "@testing-library/react": "^16.0.0",
40
63
  "@types/node": "^20.14.10",
41
64
  "@types/react": "npm:types-react@alpha",
42
65
  "@types/react-dom": "npm:types-react-dom@alpha",
@@ -0,0 +1,17 @@
1
+ import { configDefaults } from '@genesislcap/foundation-testing/e2e';
2
+
3
+ export const PROTOCOL = process.env['PROTOCOL'] || 'http';
4
+ export const HOST = process.env['HOST'] || 'localhost';
5
+ export const PORT: number = Number(process.env['PORT']) || 5173;
6
+
7
+ export default {
8
+ ...configDefaults,
9
+ webServer: {
10
+ ...configDefaults.webServer,
11
+ url: `${PROTOCOL}://${HOST}:${PORT}`,
12
+ },
13
+ use: {
14
+ ...configDefaults.use,
15
+ baseURL: `${PROTOCOL}://${HOST}:${PORT}`,
16
+ }
17
+ };
@@ -29,7 +29,7 @@ const styles = {
29
29
  const ErrorMessage = ({ elementType = 'div', message = '' }) => {
30
30
  const ElementType = elementType;
31
31
 
32
- return (
32
+ return message && message !== '' && (
33
33
  <section style={styles.errorMessageWrapper}>
34
34
  <div style={styles.errorMessage}>
35
35
  {(() => {
@@ -0,0 +1,80 @@
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import '@testing-library/jest-dom';
4
+ import ErrorMessage from './ErrorMessage';
5
+
6
+ describe('ErrorMessage Component', () => {
7
+ const message = 'Test Error Message';
8
+
9
+ test('renders the message as a div by default', () => {
10
+ render(<ErrorMessage message={message} />);
11
+ const displayedMessage = screen.getByText(message);
12
+ expect(displayedMessage.tagName).toBe('DIV');
13
+ expect(displayedMessage).toBeInTheDocument();
14
+ });
15
+
16
+ test('renders the message as an h1 element when elementType is "h1"', () => {
17
+ render(<ErrorMessage message={message} elementType="h1" />);
18
+ const displayedMessage = screen.getByRole('heading', { level: 1 });
19
+ expect(displayedMessage.tagName).toBe('H1');
20
+ expect(displayedMessage).toBeInTheDocument();
21
+ });
22
+
23
+ test('renders the message as a p element when elementType is "p"', () => {
24
+ render(<ErrorMessage message={message} elementType="p" />);
25
+ const displayedMessage = screen.getByText(message);
26
+ expect(displayedMessage.tagName).toBe('P');
27
+ expect(displayedMessage).toBeInTheDocument();
28
+ });
29
+
30
+ test('applies the correct styles to the error message wrapper', () => {
31
+ render(<ErrorMessage message={message} />);
32
+ const wrapper = screen.getByText(message).closest('section');
33
+ expect(wrapper).toHaveStyle(`
34
+ display: flex;
35
+ flex-direction: column;
36
+ justify-content: center;
37
+ align-items: center;
38
+ height: 100%;
39
+ width: 100%;
40
+ `);
41
+ });
42
+
43
+ test('applies the correct styles to the error message itself', () => {
44
+ render(<ErrorMessage message={message} />);
45
+ const displayedMessage = screen.getByText(message);
46
+ const messageWrapper = displayedMessage.parentElement;
47
+
48
+ expect(messageWrapper).toBeInTheDocument();
49
+ expect(messageWrapper).toHaveStyle(`
50
+ color: var(--neutral-foreground-rest);
51
+ background-color: var(--neutral-layer-4);
52
+ border-color: var(--error-color);
53
+ border-radius: 7px;
54
+ border-style: solid;
55
+ border-width: 4px;
56
+ padding: 5px;
57
+ margin: 15px;
58
+ text-align: center;
59
+ width: fit-content;
60
+ align-self: center;
61
+ height: auto;
62
+ max-height: 100%;
63
+ `);
64
+ });
65
+
66
+ test('renders nothing if the message is an empty string', () => {
67
+ const { container } = render(<ErrorMessage message="" />);
68
+ expect(container.firstChild).toBeNull();
69
+ });
70
+
71
+ test('renders the correct element type for various elementType props', () => {
72
+ const elementTypes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'span', 'div'];
73
+ elementTypes.forEach((elementType) => {
74
+ const { container } = render(<ErrorMessage message={message} elementType={elementType} />);
75
+ const displayedMessage = container.querySelector(elementType);
76
+ expect(displayedMessage).toBeInTheDocument();
77
+ expect(displayedMessage.tagName).toBe(elementType.toUpperCase());
78
+ });
79
+ });
80
+ });
@@ -1,7 +1,7 @@
1
1
  declare namespace JSX {
2
2
  interface IntrinsicElements {
3
3
  // Wildcard for all webcomponents:
4
- [elemName: string]: any;
4
+ [elemName: string]: unknown;
5
5
  }
6
6
  }
7
7
 
@@ -1,4 +1,4 @@
1
1
  declare module '*.svg' {
2
- const content: any;
2
+ const content: string;
3
3
  export default content;
4
4
  }
@@ -1,7 +1,7 @@
1
1
  {{#if FDC3.includeDependencies}}
2
2
  import { DefaultFDC3 } from '@genesislcap/foundation-fdc3';
3
3
  {{/if}}
4
- export const isFDC3 = (): boolean => !!(window as any).fdc3;
4
+ export const isFDC3 = (): boolean => !!((window as unknown as { fdc3?: boolean }).fdc3);
5
5
  {{#if FDC3.includeDependencies}}
6
6
 
7
7
  export const onFDC3Ready = async (FDC3ReadyCb: () => any): Promise<void> => {
@@ -0,0 +1,26 @@
1
+ import { base, Page } from '@genesislcap/foundation-testing/e2e';
2
+ import { ProtectedPage } from './pages';
3
+ import { PORT } from '../../playwright.config';
4
+
5
+ export type FixtureConfig = {
6
+ API_HOST: string;
7
+ DEFAULT_USER: string;
8
+ DEFAULT_PASSWORD: string;
9
+ PORT: number;
10
+ };
11
+
12
+ export type Fixture = {
13
+ config: FixtureConfig;
14
+ protectedPage: ProtectedPage;
15
+ };
16
+
17
+ const API_HOST = process.env['API_HOST'] || 'localhost';
18
+
19
+ export const test = base.extend<Fixture>({
20
+ config: [{ PORT, API_HOST, DEFAULT_PASSWORD: '', DEFAULT_USER: '' }, { option: true }],
21
+ protectedPage: async ({ config, page }: { config: FixtureConfig, page: Page }, use: (page: ProtectedPage) => Promise<unknown>) => {
22
+ const protectedPage = new ProtectedPage(config, page);
23
+ await protectedPage.goto();
24
+ await use(protectedPage);
25
+ },
26
+ });
@@ -0,0 +1,6 @@
1
+ import { expect } from '@genesislcap/foundation-testing/e2e';
2
+ import { test } from '../fixture';
3
+
4
+ test('expected page title', async ({ page }: { page: any }) => {
5
+ await expect(page).toHaveTitle(/{{capitalCase appName}}/);
6
+ });
@@ -0,0 +1,2 @@
1
+ export * from './fixture';
2
+ export * from './pages';
@@ -0,0 +1 @@
1
+ export * from './protected';
@@ -0,0 +1,16 @@
1
+ import type { Page } from '@genesislcap/foundation-testing/e2e';
2
+ import type { FixtureConfig } from '../fixture';
3
+
4
+ export class ProtectedPage {
5
+ config: FixtureConfig;
6
+ page: Page;
7
+
8
+ constructor(config: FixtureConfig, page: Page) {
9
+ this.config = config;
10
+ this.page = page;
11
+ }
12
+
13
+ async goto() {
14
+ await this.page.goto('/');
15
+ }
16
+ }
@@ -9,5 +9,5 @@
9
9
  "strict": true,
10
10
  "noEmit": true
11
11
  },
12
- "include": ["vite.config.ts"]
12
+ "include": ["vite.config.js"]
13
13
  }
@@ -0,0 +1,47 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { resolve } from 'path';
3
+ import path from 'node:path';
4
+ import { defineConfig } from 'vite';
5
+ import react from '@vitejs/plugin-react';
6
+ import visualizer from 'rollup-plugin-visualizer';
7
+
8
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
+
10
+ export default defineConfig(({ mode }) => {
11
+ const https = process.env.HTTPS === 'true';
12
+ const open = !(process.env.NO_OPEN === 'true');
13
+
14
+ const config = {
15
+ server: {
16
+ https,
17
+ open,
18
+ },
19
+ plugins: [
20
+ react(),
21
+ ],
22
+ build: {
23
+ rollupOptions: {
24
+ plugins: []
25
+ }
26
+ },
27
+ resolve: {
28
+ alias: {
29
+ 'foundationZero/ZeroDesignSystem': resolve(__dirname, 'node_modules/@genesislcap/foundation-zero'),
30
+ },
31
+ },
32
+ };
33
+
34
+ if (mode === 'stats') {
35
+ config.build.rollupOptions.plugins.push(
36
+ visualizer({
37
+ template: 'raw-data',
38
+ filename: 'stats.json',
39
+ open: true,
40
+ gzipSize: true,
41
+ brotliSize: true,
42
+ })
43
+ );
44
+ }
45
+
46
+ return config;
47
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed",
3
3
  "description": "Genesis Blank App Seed",
4
- "version": "3.29.1-prerelease.10",
4
+ "version": "3.29.1-prerelease.12",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "release": "semantic-release"
@@ -1,14 +0,0 @@
1
- import { defineConfig } from 'vite';
2
- import react from '@vitejs/plugin-react';
3
- import { resolve } from 'path';
4
-
5
- export default defineConfig({
6
- plugins: [
7
- react(),
8
- ],
9
- resolve: {
10
- alias: {
11
- 'foundationZero/ZeroDesignSystem': resolve(__dirname, 'node_modules/@genesislcap/foundation-zero'),
12
- },
13
- },
14
- });