Skip to content

Commit

Permalink
Merge pull request #85 from hashtopolis/dev
Browse files Browse the repository at this point in the history
merge dev updates into master for next release
  • Loading branch information
s3inlc authored Mar 19, 2024
2 parents 4c9b308 + 45790d5 commit da78700
Show file tree
Hide file tree
Showing 613 changed files with 39,199 additions and 24,765 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"extensions": [
"Angular.ng-template",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"amatiasq.sort-imports",
"firefox-devtools.vscode-firefox-debug",
"github.vscode-pull-request-github",
"ms-azuretools.vscode-docker"
Expand Down
26 changes: 16 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": [
"*.ts"
],
"files": ["*.ts"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": ["error"],
"@angular-eslint/directive-selector": [
"error",
{
Expand All @@ -30,13 +28,21 @@
"prefix": "app",
"style": "kebab-case"
}
],
"sort-imports": [
"error",
{
"ignoreCase": false,
"ignoreDeclarationSort": false,
"ignoreMemberSort": false,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
"allowSeparatedGroups": false
}
]
}
},
{
"files": [
"*.html"
],
"files": ["*.html"],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
Expand Down
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"singleQuote": true,
"trailingComma": "none",
"endOfLine": "auto",
"tabWidth": 2,
"semi:": false,
"bracketSameLine:": true,
"arrowParens": "always"
}
21 changes: 21 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"eslint.enable": true,
"eslint.validate": [
"javascript",
"typescript",
"css",
"scss",
"html"
],
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.configPath": ".prettierrc.json",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
}
47 changes: 47 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [project email]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html)

For answers to common questions about this code of conduct, see [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq)

[homepage]: https://www.contributor-covenant.org
45 changes: 45 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Contributing to Hashtopolis Web UI

First off, thank you for considering contributing to Hashtopolis Web UI! 👍

## Code of Conduct

Please note that this project is released with a [Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms.

## How Can I Contribute?

### Reporting Bugs

If you find a bug, open an issue. Make sure to include details like your operating system, browser version, and steps to reproduce the bug.

### Suggesting Enhancements

For new features or improvements, open an issue with your proposal. Discuss the scope, implementation details, and potential challenges.

### Pull Requests

1. Fork the repository and create your branch from `master`.
2. If you've added code that should be tested, add tests.
3. Ensure the test suite passes (`npm test`).
4. Make sure your code lints (`npm run lint`).
5. Issue a pull request.

## Development Setup

See [DEVELOPMENT.md](DEVELOPMENT.md)

## Code Style

Follow the [style guide](STYLE_GUIDE.md) to maintain consistency in the codebase.

## Versioning

This project follows semantic versioning. Before creating a pull request, consider how your changes will impact the version number.

## License

By contributing, you agree that your contributions will be licensed under the [LICENSE](LICENSE.md) file.

---

Thank you for your contributions! 🚀
File renamed without changes.
1 change: 1 addition & 0 deletions LICENCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
...
146 changes: 146 additions & 0 deletions STYLE_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Project Style Guide

This document outlines the coding and documentation conventions for our project.

## Table of Contents

1. [General Guidelines](#general-guidelines)
2. [Naming Conventions](#naming-conventions)
3. [Comments](#comments)
4. [Formatting](#formatting)
5. [Error Handling](#error-handling)
6. [Documentation](#documentation)
7. [Angular-Specific Guidelines](#angular-specific-guidelines)

## 1. General Guidelines

- Write clear and concise code.
- Keep functions and methods focused on a single responsibility.
- Follow the [Code of Conduct](CONTRIBUTING.md).

## 2. Naming Conventions

### Variable Names:

Choose variable names that are descriptive, clear, and contextually relevant, avoiding ambiguity, generic terms, and "magic" values, and strive for consistency and single responsibility to enhance code readability and maintainability. Below are some guidelines for variable naming.

- Boolean Variables: consider using prefixes like is (e.g., isVisible, isFinished) or has (e.g., hasPermission, hasErrors)

### Constants:

- Use uppercase letters and underscores to separate words (e.g., MAX_ATTEMPTS, API_URL).
- Group related constants with a common prefix (e.g., APP_CONSTANTS_MAX_ATTEMPTS).

### Classes:

- Use PascalCase for class names (e.g., AppComponent, UserService).
- Suffix services with "Service" (e.g., DataService).
- Use descriptive names that convey the purpose of the class.

### Components:

- Use kebab-case for component selectors (e.g., <app-my-component>).
- Use PascalCase for component class names (e.g., MyComponent).
- Suffix components with "Component" (e.g., UserListComponent).
- Choose clear and concise names that reflect the component's role.

### Files:

- Use kebab-case for file names (e.g., user-list.component.ts, data-service.service.ts).
- Match the file name with the primary class or component it contains.
- Include the file extension (e.g., .ts, .html, .scss).

### Interfaces:

- Use PascalCase for interface names (e.g., User, ApiResponse).
- Prefix interfaces with "I" (e.g., IUser, IApiResponse), although this is optional.

### Modules:

- Use PascalCase for module names (e.g., AppModule, UserModule).
- Choose names that represent the feature or functionality encapsulated by the module.

### Directives:

- Use camelCase for directive selectors (e.g., appMyDirective).
- Use PascalCase for directive class names (e.g., MyDirective).
- Suffix directives with "Directive" (e.g., HighlightDirective).

### Services:

- Use camelCase for service instances (e.g., dataService, authService).
- Use PascalCase for service class names (e.g., DataService, AuthService).
- Suffix services with "Service" (e.g., DataService).

### Enums:

- Use PascalCase for enum names (e.g., Color, UserRole).
- Use uppercase letters for enum values (e.g., RED, ADMIN).

### Routes:

- Use kebab-case for route paths (e.g., /user-profile, /dashboard).
- Use PascalCase for route components (e.g., UserProfileComponent, DashboardComponent).

## 3. Comments

- Use comments sparingly; prefer self-explanatory code.
- Add comments for complex logic or where clarification is needed.
- Keep comments up-to-date.

```typescript
// Good
const calculateTotal = (items: number[]): number => {
// Sum up the array of items
return items.reduce((sum, item) => sum + item, 0);
};

// Bad
const calculateTotal = (arr: number[]): number => arr.reduce((s, i) => s + i, 0);
```

## 4. Formatting

- Follow consistent indentation (2 spaces).
- Keep lines around 80-120 characters.
- Use a consistent line break style (e.g., Unix-style line endings).

## 5. Error Handling

- Always handle errors appropriately.
- Avoid empty catch blocks; log or handle the error.

```typescript
// Good
try {
// some code that may throw an error
} catch (error) {
console.error('An error occurred:', error);
}

// Bad
try {
// some code that may throw an error
} catch (error) {
// empty catch block
}
```

## 6. Documentation

- Provide clear and concise documentation for public APIs.
- Use JSDoc comments for functions and methods.

```typescript
/**
* Adds two numbers.
* @param {number} a - The first number.
* @param {number} b - The second number.
* @returns {number} The sum of the two numbers.
*/
const addNumbers = (a: number, b: number): number => a + b;
```

## 7. Angular-Specific Guidelines

- Follow the official [Angular Style Guide](https://angular.io/guide/styleguide).
32 changes: 7 additions & 25 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,14 @@
"src/assets"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/bootstrap-darkmode/css/darktheme.css",
"node_modules/sweetalert2/src/sweetalert2.scss",
{
"input": "src/styles/styles.scss",
"bundleName": "default",
"inject": true
},
{
"input": "src/styles/dark.scss",
"bundleName": "dark",
"inject": false
},
{
"input": "src/styles/light.scss",
"bundleName": "light",
"inject": false
},
"node_modules/datatables.net-bs5/css/dataTables.bootstrap5.min.css",
"node_modules/datatables.net-buttons-dt/css/buttons.dataTables.css",
"node_modules/datatables.net-select-dt/css/select.dataTables.css",
"node_modules/datatables.net-responsive-dt/css/responsive.dataTables.css",
"node_modules/@selectize/selectize/dist/css/selectize.css",
"node_modules/@selectize/selectize/dist/css/selectize.bootstrap5.css",
"node_modules/jquery-ui/themes/base/selectable.css"
"src/styles/styles.scss",
"sweetalert2/src/sweetalert2.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"node_modules"
]
},
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/jquery-ui/dist/jquery-ui.js",
Expand Down
5 changes: 5 additions & 0 deletions jasmine.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"failFast": false,
"failSpecWithNoExpectations": true,
"random": false
}
Loading

0 comments on commit da78700

Please sign in to comment.