Skip to content

Commit

Permalink
Pull request #1554: Release/patch 12.0.4
Browse files Browse the repository at this point in the history
Merge in OUI/oblique from release/patch_12.0.4 to master

* commit 'a4fb2ec22bf7f8aac93d864746eed76da170c1eb':
  chore(toolchain): release version 12.0.4
  chore(toolchain): update dependencies and refactor accordingly
  fix(service-navigation/web-component): add missing styles
  feat(sds/material): add stretchTabs example for tabs
  fix(oblique/material): deactivate stretchTabs per default
  fix(oblique/material): add missing theme for pseudo-checkboxes
  fix(service-navigation/web-component): add missing default values
  fix(oblique/service-navigation): change `flex` to `inline-flex` for authentication widget
  fix(oblique/material): add missing shadow to mat-menu
  fix(oblique/schematics): provide `provideHttpClient` instead of deprecated `HttpClientModule`
  • Loading branch information
nina-egger committed Nov 29, 2024
2 parents 48b3bdf + a4fb2ec commit faa7c4d
Show file tree
Hide file tree
Showing 37 changed files with 352 additions and 269 deletions.
430 changes: 210 additions & 220 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Oblique",
"name": "oblique",
"version": "12.0.3",
"version": "12.0.4",
"license": "MIT",
"organization": {
"name": "Federal Office of Information Technology, Systems and Telecommunication FOITT",
Expand Down Expand Up @@ -47,12 +47,12 @@
"@angular/common": "^18.2.4",
"@angular/compiler": "^18.2.4",
"@angular/core": "^18.2.4",
"@angular/forms": "^18.2.12",
"@angular/forms": "^18.2.13",
"@angular/material": "^18.2.4",
"@angular/material-moment-adapter": "^18.2.14",
"@angular/platform-browser": "^18.2.4",
"@angular/platform-browser-dynamic": "^18.2.12",
"@angular/router": "^18.2.12",
"@angular/platform-browser-dynamic": "^18.2.13",
"@angular/router": "^18.2.13",
"@ngx-translate/core": "^15.0.0",
"@popperjs/core": "^2.11.8",
"ajv": "^8.17.1",
Expand All @@ -70,12 +70,12 @@
"@angular-devkit/core": "^18.2.4",
"@angular-eslint/eslint-plugin": "^18.3.1",
"@angular-eslint/eslint-plugin-template": "^18.3.1",
"@angular-eslint/template-parser": "^18.4.1",
"@angular-eslint/template-parser": "^18.4.2",
"@angular/cli": "^18.2.12",
"@angular/compiler-cli": "^18.2.12",
"@angular/compiler-cli": "^18.2.13",
"@types/jest": "^29.5.14",
"@types/js-cookie": "^3.0.6",
"@types/node": "^20.17.6",
"@types/node": "^20.17.9",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"chalk": "^4.1.2",
Expand All @@ -85,8 +85,8 @@
"jest": "^29.7.0",
"jest-sonar": "^0.2.16",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"stylelint": "^16.10.0",
"prettier": "^3.4.1",
"stylelint": "^16.11.0",
"stylelint-config-prettier-scss": "^1.0.0",
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-scss": "^6.10.0",
Expand Down
2 changes: 1 addition & 1 deletion projects/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/cli",
"version": "12.0.3",
"version": "12.0.4",
"description": "Command Line Interface to manage Oblique projects",
"keywords": [
"ob",
Expand Down
2 changes: 1 addition & 1 deletion projects/cli/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/cli
sonar.projectKey=oblique_cli
sonar.projectVersion=12.0.3
sonar.projectVersion=12.0.4
sonar.typescript.lcov.reportPaths=coverage/cli/lcov.info
sonar.testExecutionReportPaths=coverage/cli/sqr.xml
sonar.tests=projects/cli/src
Expand Down
2 changes: 1 addition & 1 deletion projects/design-system/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/design-system",
"version": "12.0.3",
"version": "12.0.4",
"scripts": {
"lint": "ts-node scripts/lint.ts",
"format": "ts-node scripts/lint.ts --fix",
Expand Down
2 changes: 1 addition & 1 deletion projects/design-system/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/design-system
sonar.projectKey=oblique_design-system
sonar.projectVersion=12.0.3
sonar.projectVersion=12.0.4
sonar.typescript.lcov.reportPaths=coverage/design-system/lcov.info
sonar.testExecutionReportPaths=coverage/design-system/sqr.xml
sonar.tests=projects/design-system/src/lib
Expand Down
10 changes: 10 additions & 0 deletions projects/oblique/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# [12.0.4](https://github.com/oblique-bit/oblique/compare/12.0.3...12.0.4) (2024-11-29)

## Bug Fixes

- **material:** deactivate stretchTabs per default ([d7366cdd](https://github.com/oblique-bit/oblique/commit/d7366cdd33ec09f3c6b3678d3ae173bc21c006f1))
- **material:** add missing theme for pseudo-checkboxes ([183eb334](https://github.com/oblique-bit/oblique/commit/183eb33401c4dc23268cd81c1408f685066aaf99))
- **material:** add missing shadow to mat-menu ([d65e6d2f](https://github.com/oblique-bit/oblique/commit/d65e6d2f3a5a6a3cf9c8947ec7c7918bbbc6c917))
- **schematics:** provide `provideHttpClient` instead of deprecated `HttpClientModule` ([5924c7da](https://github.com/oblique-bit/oblique/commit/5924c7dacd226eb280624bc3992336619ea87033))
- **service-navigation:** change `flex` to `inline-flex` for authentication widget ([e7c5e361](https://github.com/oblique-bit/oblique/commit/e7c5e361b077a756d17145459838e213d1ac5685))

# [12.0.3](https://github.com/oblique-bit/oblique/compare/12.0.2...12.0.3) (2024-11-22)

## Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions projects/oblique/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oblique/oblique",
"version": "12.0.3",
"version": "12.0.4",
"publishConfig": {
"registry": "https://registry.npmjs.com/"
},
Expand Down Expand Up @@ -39,7 +39,7 @@
"rxjs": "^7.0.0"
},
"dependencies": {
"@angular-eslint/schematics": "^18.4.1",
"@angular-eslint/schematics": "^18.4.2",
"@angular/cdk": "^18.0.0 || ^19.0.0",
"@schematics/angular": "^18.2.4",
"ansi-colors": "^4.1.3",
Expand Down
3 changes: 1 addition & 2 deletions projects/oblique/schematics/index/ng-add/rules/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Rule, SchematicContext, Tree, chain} from '@angular-devkit/schematics';
import {insertImport} from '@angular/cdk/schematics';
import {addImportToModule, addProviderToModule} from '@schematics/angular/utility/ast-utils';
import {Change, InsertChange} from '@schematics/angular/utility/change';
import {adaptInsertChange, addDependency, appModulePath, applyChanges, createSrcFile, importModuleInRoot} from '../ng-add-utils';
import {adaptInsertChange, addDependency, appModulePath, applyChanges, createSrcFile} from '../ng-add-utils';
import {ObliquePackage, addFile, createSafeRule, infoMigration, readFile} from '../../utils';

export function addLocales(locales: string[]): Rule {
Expand Down Expand Up @@ -73,7 +73,6 @@ function addTranslation(locales: string[]): Rule {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
return createSafeRule((tree: Tree, _context: SchematicContext) => {
addDependency(tree, '@ngx-translate/core');
importModuleInRoot(tree, 'HttpClientModule', '@angular/common/http');
locales.map(locale => locale.split('-')[0]).forEach((lang: string) => addFile(tree, `src/assets/i18n/${lang}.json`, '{}'));
addTranslationToImports(tree);
return tree;
Expand Down
19 changes: 16 additions & 3 deletions projects/oblique/schematics/index/ng-add/rules/obliqueFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,23 @@ function addInterceptors(httpInterceptors: boolean): Rule {
const obliqueInterceptorProvider = '{provide: HTTP_INTERCEPTORS, useClass: ObHttpApiInterceptor, multi: true}';
const sourceFile = createSrcFile(tree, appModulePath);
const changes = addProviderToModule(sourceFile, appModulePath, obliqueInterceptorProvider, ObliquePackage)
.concat(insertImport(sourceFile, appModulePath, 'HTTP_INTERCEPTORS', '@angular/common/http'))
.concat(addProviderToModule(sourceFile, appModulePath, 'provideHttpClient(withInterceptorsFromDi())', '@angular/common/http'))
.filter((change: Change) => change instanceof InsertChange)
.map((change: InsertChange) => adaptInsertChange(tree, change, obliqueInterceptorProvider, obliqueInterceptorModuleName));

.map((change: InsertChange) => adaptInsertChange(tree, change, obliqueInterceptorProvider, obliqueInterceptorModuleName))
.map((change: InsertChange) =>
adaptInsertChange(
tree,
change,
'provideHttpClient(withInterceptorsFromDi())',
'provideHttpClient, HTTP_INTERCEPTORS, withInterceptorsFromDi'
)
);
tree = applyChanges(tree, appModulePath, changes);
} else {
const sourceFile = createSrcFile(tree, appModulePath);
const changes = addProviderToModule(sourceFile, appModulePath, 'provideHttpClient()', '@angular/common/http')
.filter((change: Change) => change instanceof InsertChange)
.map((change: InsertChange) => adaptInsertChange(tree, change, 'provideHttpClient()', 'provideHttpClient'));
tree = applyChanges(tree, appModulePath, changes);
}
return tree;
Expand Down
2 changes: 1 addition & 1 deletion projects/oblique/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/oblique
sonar.projectKey=oblique_oblique
sonar.projectVersion=12.0.3
sonar.projectVersion=12.0.4
sonar.typescript.lcov.reportPaths=coverage/oblique/lcov.info
sonar.testExecutionReportPaths=coverage/oblique/sqr.xml
sonar.tests=projects/oblique/src/lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
padding-left: variables.$ob-spacing-sm;

a.ob-button[id*="login"] {
display: flex;
display: inline-flex;
flex-direction: row-reverse;

&.mat-mdc-button > .mat-icon {
Expand Down
2 changes: 2 additions & 0 deletions projects/oblique/src/lib/utilities.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {MatRadioDefaultOptions} from '@angular/material/radio';
import {StepperOptions} from '@angular/cdk/stepper';
import {ObEPamsEnvironment} from './service-navigation/service-navigation.model';
import {MatSlideToggleDefaultOptions} from '@angular/material/slide-toggle';
import {MatTabsConfig} from '@angular/material/tabs';

export interface ObIBanner {
text: string;
Expand All @@ -22,4 +23,5 @@ export interface ObIMaterialConfig {
MAT_CHECKBOX_OPTIONS?: MatCheckboxDefaultOptions;
MAT_RADIO_OPTIONS?: MatRadioDefaultOptions;
MAT_SLIDE_TOGGLE_OPTIONS?: MatSlideToggleDefaultOptions;
MAT_TABS_CONFIG?: MatTabsConfig;
}
17 changes: 15 additions & 2 deletions projects/oblique/src/lib/utilities.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ import {
radioOptionsProvider,
slideToggleOptionsProvider,
stepperOptionsOptionsProvider,
tabsOptionsProvider,
windowProvider
} from './utilities';
import {MAT_TABS_CONFIG} from '@angular/material/tabs';

describe('utilities', () => {
describe('windowProvider', () => {
Expand Down Expand Up @@ -176,9 +178,19 @@ describe('utilities', () => {
});
});

describe('tabsOptionsProvider', () => {
it('should return default config without parameters', () => {
expect(tabsOptionsProvider()).toEqual({stretchTabs: false});
});

it('should return given config when provided as parameters', () => {
expect(tabsOptionsProvider({MAT_TABS_CONFIG: {stretchTabs: true}})).toEqual({stretchTabs: true});
});
});

describe('obliqueProviders', () => {
it('should return 7 configurations', () => {
expect(obliqueProviders().length).toBe(7);
it('should return 8 configurations', () => {
expect(obliqueProviders().length).toBe(8);
});

it.each([
Expand All @@ -187,6 +199,7 @@ describe('utilities', () => {
MAT_CHECKBOX_DEFAULT_OPTIONS,
MAT_RADIO_DEFAULT_OPTIONS,
MAT_SLIDE_TOGGLE_DEFAULT_OPTIONS,
MAT_TABS_CONFIG,
WINDOW,
MATERIAL_SANITY_CHECKS
])('should contain ½s', provide => {
Expand Down
6 changes: 6 additions & 0 deletions projects/oblique/src/lib/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {ObIBanner, ObIMaterialConfig, ObIPamsConfiguration} from './utilities.mo
import {ObCheckboxModule} from './checkbox/checkbox.module';
import {ObFormFieldModule} from './form-field/form-field.module';
import {MATERIAL_SANITY_CHECKS} from '@angular/material/core';
import {MAT_TABS_CONFIG, MatTabsConfig} from '@angular/material/tabs';

export const WINDOW = new InjectionToken<Window>('Window');
export const OB_BANNER = new InjectionToken<ObIBanner>('Banner');
Expand Down Expand Up @@ -66,6 +67,10 @@ export function slideToggleOptionsProvider(config?: ObIMaterialConfig): MatSlide
return config?.MAT_SLIDE_TOGGLE_OPTIONS || {color: 'primary'};
}

export function tabsOptionsProvider(config?: ObIMaterialConfig): MatTabsConfig {
return config?.MAT_TABS_CONFIG || {stretchTabs: false};
}

export const OB_MATERIAL_CONFIG = new InjectionToken<ObIMaterialConfig>('ObIMaterialConfig');

export function obliqueProviders(): Provider[] {
Expand All @@ -75,6 +80,7 @@ export function obliqueProviders(): Provider[] {
{provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useFactory: checkboxOptionsProvider, deps: [[new Optional(), OB_MATERIAL_CONFIG]]},
{provide: MAT_RADIO_DEFAULT_OPTIONS, useFactory: radioOptionsProvider, deps: [[new Optional(), OB_MATERIAL_CONFIG]]},
{provide: MAT_SLIDE_TOGGLE_DEFAULT_OPTIONS, useFactory: slideToggleOptionsProvider, deps: [[new Optional(), OB_MATERIAL_CONFIG]]},
{provide: MAT_TABS_CONFIG, useFactory: tabsOptionsProvider, deps: [[new Optional(), OB_MATERIAL_CONFIG]]},
{provide: WINDOW, useFactory: windowProvider, deps: [DOCUMENT]},
{provide: MATERIAL_SANITY_CHECKS, useValue: {theme: false}}
];
Expand Down
2 changes: 1 addition & 1 deletion projects/oblique/src/lib/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const appVersion = '12.0.3';
export const appVersion = '12.0.4';
2 changes: 1 addition & 1 deletion projects/oblique/src/styles/scss/material/_mat-menu.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use "../core/mixins/shadow";

.mat-mdc-menu-panel {
.mat-mdc-menu-panel.mat-mdc-elevation-specific {
@include shadow.ob-shadow-default();
}
1 change: 1 addition & 0 deletions projects/oblique/src/styles/scss/oblique-material.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ $theme-tabs: (
@include mat.tabs-theme(mat.m2-define-light-theme($theme-tabs));
@include mat.tooltip-theme(mat.m2-define-light-theme($theme));
@include mat.option-theme(mat.m2-define-light-theme($theme));
@include mat.pseudo-checkbox-theme(mat.m2-define-light-theme($theme));

// import to overwrite mat-component-specifics
@import "material/mat-autocomplete";
Expand Down
4 changes: 2 additions & 2 deletions projects/sandbox-ssr/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sandbox-ssr",
"version": "12.0.3",
"version": "12.0.4",
"scripts": {
"start": "ng serve",
"start-ssr": "node ../../dist/sandbox-ssr/server/server.mjs",
Expand All @@ -12,7 +12,7 @@
"release": "ts-node scripts/release.ts"
},
"dependencies": {
"@angular/platform-server": "^18.2.12",
"@angular/platform-server": "^18.2.13",
"@angular/ssr": "^18.2.12",
"express": "^4.21.1"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/sandbox-ssr/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/sandbox-ssr
sonar.projectKey=oblique_sandbox-ssr
sonar.projectVersion=12.0.3
sonar.projectVersion=12.0.4
sonar.typescript.lcov.reportPaths=coverage/sandbox-ssr/lcov.info
sonar.testExecutionReportPaths=coverage/sandbox-ssr/sqr.xml
sonar.tests=projects/sandbox-ssr/src/app
Expand Down
2 changes: 1 addition & 1 deletion projects/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sandbox",
"version": "12.0.3",
"version": "12.0.4",
"scripts": {
"start": "ng serve",
"start-pams": "ng serve --configuration pams",
Expand Down
2 changes: 1 addition & 1 deletion projects/sandbox/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/sandbox
sonar.projectKey=oblique_sandbox
sonar.projectVersion=12.0.3
sonar.projectVersion=12.0.4
sonar.typescript.lcov.reportPaths=coverage/sandbox/lcov.info
sonar.testExecutionReportPaths=coverage/sandbox/sqr.xml
sonar.tests=projects/sandbox/src/app
Expand Down
1 change: 1 addition & 0 deletions projects/sds/.stylelintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ extends: "../../.stylelintrc.yml"
rules:
# rules that need some refactoring to be enabled
no-descending-specificity: null
selector-id-pattern: null
selector-class-pattern: ^([a-z][a-z0-9]*)([-_]{0,2}[a-z0-9]+)*$
6 changes: 6 additions & 0 deletions projects/sds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# [12.0.4](https://github.com/oblique-bit/oblique/compare/12.0.3...12.0.4) (2024-11-29)

## Features

- **material:** add stretchTabs example for tabs ([d1a68625](https://github.com/oblique-bit/oblique/commit/d1a6862590932aded61d6574109925225992251a))

# [12.0.1](https://github.com/oblique-bit/oblique/compare/12.0.0...12.0.1) (2024-11-01)

## Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion projects/sds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swiss-design-system",
"version": "12.0.3",
"version": "12.0.4",
"scripts": {
"start": "ng serve",
"lint": "ts-node scripts/lint.ts",
Expand Down
2 changes: 1 addition & 1 deletion projects/sds/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectName=@oblique/sds
sonar.projectKey=oblique_sds
sonar.projectVersion=12.0.3
sonar.projectVersion=12.0.4
sonar.typescript.lcov.reportPaths=coverage/sds/lcov.info
sonar.testExecutionReportPaths=coverage/sds/sqr.xml
sonar.tests=projects/sds/src/app
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<mat-tab-group mat-stretch-tabs="true">
<mat-tab label="First"> Content with headerPosition below 1 </mat-tab>
<mat-tab label="Second"> Content 2 </mat-tab>
<mat-tab label="Third"> Content 3 </mat-tab>
</mat-tab-group>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {Component} from '@angular/core';
import {MatTabsModule} from '@angular/material/tabs';

@Component({
selector: 'app-tabs-example-stretched-preview',
templateUrl: './tabs-example-stretched-preview.component.html',
standalone: true,
imports: [MatTabsModule]
})
export class TabsExampleStretchedPreviewComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe(TabsCodeExamplesComponent.name, () => {
expect(component).toBeTruthy();
});

it('should have 2 CodeExampleComponent', () => {
expect(fixture.debugElement.queryAll(By.directive(CodeExampleComponent)).length).toBe(2);
it('should have 3 CodeExampleComponent', () => {
expect(fixture.debugElement.queryAll(By.directive(CodeExampleComponent)).length).toBe(3);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {CommonModule} from '@angular/common';
import {CodeExampleComponent} from '../../code-example/code-example.component';
import {TabsExampleBasicPreviewComponent} from './previews/basic/tabs-example-basic-preview.component';
import {TabsExampleVariationsPreviewComponent} from './previews/variations/tabs-example-variations-preview.component';
import {TabsExampleStretchedPreviewComponent} from './previews/stretched/tabs-example-stretched-preview.component';

@Component({
selector: 'app-code-example-tabs',
Expand Down Expand Up @@ -34,6 +35,15 @@ export class TabsCodeExamplesComponent extends CodeExamples {
this.getSnippet('tabs', 'variations/tabs-example-variations-preview.component.ts', 'TS'),
this.getSnippet('tabs', 'variations/tabs-example-variations-preview.component.scss', 'SCSS')
]
},
{
component: TabsExampleStretchedPreviewComponent,
idParts: ['stretched'],
title: 'Tabs stretched',
snippets: [
this.getSnippet('tabs', 'stretched/tabs-example-stretched-preview.component.html', 'HTML'),
this.getSnippet('tabs', 'stretched/tabs-example-stretched-preview.component.ts', 'TS')
]
}
];
}
Loading

0 comments on commit faa7c4d

Please sign in to comment.