Skip to content

Commit d3529e9

Browse files
committed
Merge branch 'main' into feat/478-view-only-links
# Conflicts: # src/app/features/project/contributors/components/create-view-link-dialog/create-view-link-dialog.component.html # src/app/features/project/contributors/contributors.component.html # src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html # src/app/features/project/overview/mappers/project-overview.mapper.ts # src/app/features/project/overview/models/project-overview.models.ts # src/app/features/project/settings/settings.component.html # src/app/shared/components/resource-metadata/resource-metadata.component.html
2 parents ec4e6e0 + df7b769 commit d3529e9

512 files changed

Lines changed: 4689 additions & 5372 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.fantasticonrc.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ npx lint-staged || {
33
exit 1
44
}
55

6-
npm run docs:coverage || {
7-
printf "\n\nERROR: Documentation Coverage thresholds are not met."
8-
printf "\n\nIn the future this will block your ability to commit locally until it is resolved."
9-
printf "\n\nThe same pipeline runs via GitHub actions."
10-
printf "\n\nYou are seeing this error because code was added without documentation."
6+
# npm run docs:coverage || {
7+
# printf "\n\nERROR: Documentation Coverage thresholds are not met."
8+
# printf "\n\nIn the future this will block your ability to commit locally until it is resolved."
9+
# printf "\n\nThe same pipeline runs via GitHub actions."
10+
# printf "\n\nYou are seeing this error because code was added without documentation."
1111
# exit 1
12-
}
12+
# }

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ take up to 60 seconds once the docker build finishes.
1414

1515
## Index
1616

17+
### First steps
18+
19+
- Install git commit template: [Commit Template](docs/commit.template.md).
20+
- Volta: [Volta](#volta)
21+
1722
### Recommended
1823

1924
- Compodoc: [Compodoc Conventions](docs/compodoc.md).
2025
- Docker Commands: [Docker Commands](docs/docker.md).
2126
- Git Conventions: [Git Conventions](docs/git-convention.md).
22-
- Install git commit template: [Commit Template](docs/commit.template.md).
23-
- Volta: [Volta](#volta)
24-
- Redux DevTools: [Redux DevTools](#redux-devtools)
27+
- NGXS: [NGXS Conventions](docs/ngxs.md).
2528

2629
### Optional
2730

@@ -53,8 +56,3 @@ npm run test:check-coverage-thresholds
5356

5457
OSF uses volta to manage node and npm versions inside of the repository
5558
Install Volta from [volta](https://volta.sh/) and it will automatically pin Node/npm per the repo toolchain.
56-
57-
## Redux DevTools
58-
59-
OSF Angular uses [NGXS](https://github.com/ngxs) for state management. It is highly recommended to install
60-
the `Redux DevTools` extension from the Chrome web store.

angular.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
],
4545
"styles": [
4646
"src/assets/styles/styles.scss",
47-
"src/assets/icons/dist/icons.css",
4847
"node_modules/primeflex/primeflex.css",
4948
"node_modules/@fortawesome/fontawesome-free/css/all.min.css",
5049
"node_modules/ngx-markdown-editor/assets/highlight.js/agate.min.css"

docs/assets/osf-ngxs-diagram.png

100 KB
Loading

docs/ngxs.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# NGXS State Management Overview
2+
3+
The OSF Angular project uses [NGXS](https://www.ngxs.io/) as the state management library for Angular applications. NGXS provides a simple, powerful, and TypeScript-friendly framework for managing state across components and services.
4+
5+
---
6+
7+
## Purpose
8+
9+
The goal of using NGXS is to centralize and streamline the handling of application state, reduce boilerplate, and maintain a predictable flow of data and events throughout the OSF Angular app.
10+
11+
---
12+
13+
## Core Concepts
14+
15+
- **State**: Defines a slice of the application state and how it is modified in response to actions.
16+
- **Actions**: Dispatched to signal state changes or trigger effects (e.g., API calls).
17+
- **Selectors**: Functions that extract and transform data from the store.
18+
- **Store**: Centralized container that holds the application state.
19+
- **Effects** (via `@ngxs-labs/effects` or `@ngxs/store`): Side-effect handling such as HTTP requests, logging, etc.
20+
21+
### Diagram
22+
23+
[![OSF NGRX Diagram](./assets/osf-ngxs-diagram.png)](./assets/osf-ngxs-diagram.png)
24+
25+
---
26+
27+
## Directory Structure
28+
29+
Typical NGXS-related files are organized as follows:
30+
31+
```
32+
src/app/shared/stores/
33+
└── addons/
34+
├── addons.actions.ts # All action definitions
35+
├── addons.models.ts # Interfaces & data models
36+
├── addons.state.ts # State implementation
37+
├── addons.selectors.ts # Reusable selectors
38+
```
39+
40+
```
41+
src/app/shared/services/
42+
└── addons/
43+
├── addons.service.ts # External API calls
44+
```
45+
46+
---
47+
48+
## Tooling and Extensions
49+
50+
- [Redux DevTools](https://github.com/zalmoxisus/redux-devtools-extension) is supported. Enable it in development via `NgxsReduxDevtoolsPluginModule`.
51+
- [NGXS Logger Plugin](https://www.ngxs.io/plugins/logger) can be used for debugging dispatched actions and state changes.
52+
- [NGXS Storage Plugin](https://www.ngxs.io/plugins/storage) allows selective persistence of state across reloads.
53+
54+
---
55+
56+
## Testing
57+
58+
- Mock `Store` using `jest.fn()` or test-specific modules for unit testing components and services.
59+
60+
---
61+
62+
## Documentation
63+
64+
Refer to the official NGXS documentation for full API details and advanced usage:
65+
[https://www.ngxs.io/docs](https://www.ngxs.io/docs)

jest.config.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
preset: 'jest-preset-angular',
33
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
44
globalSetup: '<rootDir>/jest.global-setup.ts',
5-
collectCoverage: true,
5+
collectCoverage: false,
66
coverageReporters: ['json-summary', 'lcov', 'clover'],
77
moduleNameMapper: {
88
'^@osf/(.*)$': '<rootDir>/src/app/$1',
@@ -45,10 +45,10 @@ module.exports = {
4545
extensionsToTreatAsEsm: ['.ts'],
4646
coverageThreshold: {
4747
global: {
48-
branches: 14.15,
49-
functions: 14.83,
50-
lines: 41.15,
51-
statements: 41.63,
48+
branches: 14.27,
49+
functions: 15.55,
50+
lines: 42.6,
51+
statements: 43.2,
5252
},
5353
},
5454
watchPathIgnorePatterns: [
@@ -74,6 +74,10 @@ module.exports = {
7474
'<rootDir>/src/app/features/project/addons/components/configure-configure-addon/',
7575
'<rootDir>/src/app/features/project/addons/components/connect-configured-addon/',
7676
'<rootDir>/src/app/features/project/addons/components/disconnect-addon-modal/',
77+
'<rootDir>/src/app/features/project/addons/components/confirm-account-connection-modal/',
78+
'<rootDir>/src/app/features/files/',
79+
'<rootDir>/src/app/features/my-projects/',
80+
'<rootDir>/src/app/features/preprints/',
7781
'<rootDir>/src/app/features/project/analytics/',
7882
'<rootDir>/src/app/features/project/contributors/',
7983
'<rootDir>/src/app/features/project/files/',

0 commit comments

Comments
 (0)