Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from AllianceBioversityCIAT/staging
Browse files Browse the repository at this point in the history
Setup project
  • Loading branch information
JuankCadavid authored May 21, 2024
2 parents a4e426b + 51ecd90 commit fb51122
Show file tree
Hide file tree
Showing 74 changed files with 30,657 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"

- name: Install dependencies
run: npm ci
working-directory: bi-client

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
working-directory: bi-client
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cd bi-client
npm run lint
npm run s-lint
16 changes: 16 additions & 0 deletions bi-client/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions bi-client/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.js
60 changes: 60 additions & 0 deletions bi-client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"no-underscore-dangle": [
"error",
{
"allow": ["_"]
}
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-explicit-any": [
"error",
{
"ignoreRestArgs": true
}
]
}
},
{
"files": ["*.html"],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
],
"rules": {}
}
]
}
56 changes: 56 additions & 0 deletions bi-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db

# Environment variables, exist two files, production and development
/src/environments/*.ts

# scripts to deploy to S3
/scripts

# Nx cache
.nx

# example
/example

Jenkinsfile
4 changes: 4 additions & 0 deletions bi-client/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
node_modules
angular.json
**/*.html
13 changes: 13 additions & 0 deletions bi-client/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": true,
"bracketSpacing": true,
"arrowParens": "avoid",
"trailingComma": "none",
"bracketSameLine": true,
"printWidth": 100,
"bracketLine": true,
"endOfLine": "auto"
}
3 changes: 3 additions & 0 deletions bi-client/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "stylelint-config-standard-scss"
}
1 change: 1 addition & 0 deletions bi-client/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
42 changes: 42 additions & 0 deletions bi-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## Use Widget

1. Add the following HTML tag to your template file where you want to embed the widget:

```html
<div id="dashboard-embed"></div>
```

2. Import the widget.js in your index.html file with the appropriate URL based on the environment:

```html
<script src="https://bitest.ciat.cgiar.org/widget/main.js"></script>
```

Note that the URL may vary depending on the environment you are working in.

3. Next, in your TypeScript component where you want to initialize the widget, declare the pbiwidget variable and use the init method to initialize the widget:

```js
declare var pbiwidget: any;

pbiwidget.init('dashboard-embed', {
resultType: 'Capacity change', // Parameter
year: 2022, // Parameter
reportName: 'type-1-report-dashboard_dev', // Report name
sectionNumber: 1 // Initial page number
});
```

Make sure to adjust the parameters according to your needs.

# PrmsBiClient

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.1.0.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
103 changes: 103 additions & 0 deletions bi-client/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"bi-client": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/bi-client",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets",
"src/widget"
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "bi-client:build:production"
},
"development": {
"buildTarget": "bi-client:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "bi-client:build"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
Loading

0 comments on commit fb51122

Please sign in to comment.