-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
680 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ on: | |
- status | ||
- time-picker | ||
- tooltip | ||
- user-card | ||
dry-run: | ||
description: --dry-run | ||
type: boolean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Test user-card | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
paths: | ||
- '.github/workflows/ci_test_user-card.yml' | ||
- 'projects/user-card/**' | ||
|
||
concurrency: | ||
group: ci-test-user-card-group-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ci_test_user-card: | ||
if: "${{ !contains(github.event.head_commit.message, 'chore(release): publish') }}" | ||
uses: dsi-hug/action/.github/workflows/action.yml@v1 | ||
with: | ||
working-directory: projects/user-card | ||
runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]' | ||
node-versions: '[18, 20]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@hug/user-card | ||
======= | ||
|
||
The sources for this package are in the main [DSI-HUG/ngx-components](https://github.com/dsi-hug/ngx-components) repo. Please file issues and pull requests against that repo. | ||
|
||
License: GPL-3.0-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/1.0/config/configuration-file.html | ||
|
||
module.exports = config => { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['jasmine', '@angular-devkit/build-angular'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-jasmine-html-reporter'), | ||
require('karma-coverage'), | ||
require('@angular-devkit/build-angular/plugins/karma') | ||
], | ||
client: { | ||
jasmine: { | ||
// you can add configuration options for Jasmine here | ||
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html | ||
// for example, you can disable the random execution with `random: false` | ||
// or set a specific seed with `seed: 4321` | ||
}, | ||
clearContext: false // leave Jasmine Spec Runner output visible in browser | ||
}, | ||
jasmineHtmlReporter: { | ||
suppressAll: true // removes the duplicated traces | ||
}, | ||
coverageReporter: { | ||
dir: require('path').join(__dirname, '../../coverage/user-card'), | ||
subdir: '.', | ||
reporters: [ | ||
{ type: 'html' }, | ||
{ type: 'text-summary' } | ||
] | ||
}, | ||
reporters: ['progress', 'kjhtml'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['Chrome'], | ||
singleRun: false, | ||
failOnEmptyTestSuite: false, | ||
restartOnFileChange: true | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json", | ||
"dest": "../../dist/user-card", | ||
"assets": [ | ||
"CHANGELOG.md", | ||
{ | ||
"input": "src/", | ||
"glob": "_user-card-theme.scss", | ||
"output": "." | ||
} | ||
], | ||
"lib": { | ||
"entryFile": "src/index.ts" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "@hug/ngx-user-card", | ||
"version": "1.0.0", | ||
"description": "HUG Angular - user-card component", | ||
"homepage": "https://github.com/dsi-hug/ngx-components", | ||
"license": "GPL-3.0-only", | ||
"author": "HUG - Hôpitaux Universitaires Genève", | ||
"contributors": [ | ||
"badisi (https://github.com/badisi)", | ||
"vapkse (https://github.com/vapkse)" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/dsi-hug/ngx-components.git" | ||
}, | ||
"keywords": [ | ||
"angular", | ||
"material", | ||
"material design", | ||
"components" | ||
], | ||
"sideEffects": false, | ||
"scripts": { | ||
"lint": "eslint . --fix", | ||
"test": "ng test user-card", | ||
"test:ci": "ng test user-card --watch=false --browsers=ChromeHeadless", | ||
"build:ng": "ng build user-card -c=production", | ||
"build": "nx build:ng @hug/ngx-user-card --verbose", | ||
"release": "nx release -p=@hug/ngx-user-card --yes --verbose", | ||
"release:dry-run": "nx release -p=@hug/ngx-user-card --verbose --dry-run" | ||
}, | ||
"peerDependencies": { | ||
"@angular/common": ">= 14", | ||
"@angular/core": ">= 14", | ||
"@angular/cdk": ">= 14", | ||
"@angular/material": ">= 14" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.6.3" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@use '@angular/material' as mat; | ||
|
||
@mixin user-card-theme($theme) { | ||
$foreground: map-get($theme, foreground); | ||
$background: map-get($theme, background); | ||
|
||
user-card { | ||
background-color: mat.get-color-from-palette($background, card); | ||
@include mat.elevation(3); | ||
|
||
.header-badge { | ||
|
||
&.green-badge { | ||
background-color: mat.get-color-from-palette(mat.$green-palette, 500); | ||
} | ||
|
||
&.blue-badge { | ||
background-color: mat.get-color-from-palette(mat.$blue-palette, 500); | ||
} | ||
|
||
&.red-badge { | ||
background-color: mat.get-color-from-palette(mat.$red-palette, 500); | ||
} | ||
|
||
&.grey-badge { | ||
background-color: mat.get-color-from-palette(mat.$grey-palette, 500); | ||
} | ||
} | ||
|
||
.header-separator, | ||
.header-initials { | ||
color: mat.get-color-from-palette(mat.$grey-palette, 400); | ||
} | ||
|
||
hr { | ||
border-color: mat.get-color-from-palette($foreground, divider); | ||
} | ||
|
||
.header-icon { | ||
color: mat.get-color-from-palette($foreground, icon); | ||
} | ||
|
||
.header-function, | ||
.label { | ||
color: mat.get-color-from-palette($foreground, secondary-text); | ||
} | ||
|
||
.value { | ||
color: mat.get-color-from-palette($foreground, text); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './user-card.model'; | ||
export * from './user-card.component'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// This file is required by karma.conf.js and loads recursively all the .spec and framework files | ||
|
||
import 'zone.js'; | ||
import 'zone.js/testing'; | ||
|
||
import { getTestBed } from '@angular/core/testing'; | ||
import { | ||
BrowserDynamicTestingModule, | ||
platformBrowserDynamicTesting | ||
} from '@angular/platform-browser-dynamic/testing'; | ||
|
||
declare const require: { | ||
context: (path: string, deep?: boolean, filter?: RegExp) => { | ||
<T>(id: string): T; | ||
keys: () => string[]; | ||
}; | ||
}; | ||
|
||
// First, initialize the Angular testing environment. | ||
getTestBed().initTestEnvironment( | ||
BrowserDynamicTestingModule, | ||
platformBrowserDynamicTesting() | ||
); | ||
|
||
// Then we find all the tests. | ||
const context = require.context('./', true, /\.spec\.ts$/); | ||
// And load the modules. | ||
context.keys().forEach(context); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<div class="user-card-header"> | ||
<span class="header-badge" | ||
*ngIf="userCard.badgeColor as badgeColor" | ||
[ngClass]="badgeColor + '-badge'"></span> | ||
<div class="header-infos"> | ||
<div class="header-fullname"> | ||
{{ userCard.fullname }} <span class="header-initials" | ||
*ngIf="userCard.initials as initials">{{' - ' + initials}}</span> | ||
</div> | ||
<div class="header-function"> | ||
{{ userCard.function }}{{ userCard.specialty ? ' - ' + userCard.specialty : '' }} | ||
</div> | ||
</div> | ||
</div> | ||
<div class="user-card-wrapper" | ||
*ngIf="expanded"> | ||
<hr> | ||
<div class="user-card-content"> | ||
<div class="content-service"> | ||
<div class="label">Service</div> | ||
<div class="value">{{ userCard.service ?? '-'}}</div> | ||
</div> | ||
<div class="content-type"> | ||
<div class="label">Type</div> | ||
<div class="value">{{ userCard.type ?? '-'}}</div> | ||
</div> | ||
<div class="content-phone"> | ||
<div class="label">Téléphone</div> | ||
<div class="value">{{ userCard.phoneNumber ?? '-'}}</div> | ||
</div> | ||
<div class="content-mobile"> | ||
<div class="label">Mobile</div> | ||
<div class="value">{{ userCard.mobileNumber ?? '-'}}</div> | ||
</div> | ||
<div class="content-email"> | ||
<div class="label">Email</div> | ||
<div class="value">{{ userCard.email ?? '-'}}</div> | ||
</div> | ||
<div class="content-address"> | ||
<div class="label">Adresse</div> | ||
<div class="value" | ||
[innerHTML]="userCard.address ?? '-'"></div> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.