diff --git a/package.json b/package.json index bf50dbc32..1b8c2ae66 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "@axelor/aos-mobile-intervention": "8.3.0", "@axelor/aos-mobile-manufacturing": "8.3.0", "@axelor/aos-mobile-project": "8.3.0", + "@axelor/aos-mobile-purchase": "8.3.0", "@axelor/aos-mobile-quality": "8.3.0", "@axelor/aos-mobile-sale": "8.3.0", "@axelor/aos-mobile-stock": "8.3.0", diff --git a/packages/apps/purchase/.eslintrc.js b/packages/apps/purchase/.eslintrc.js new file mode 100644 index 000000000..5b00eca45 --- /dev/null +++ b/packages/apps/purchase/.eslintrc.js @@ -0,0 +1,8 @@ +module.exports = { + root: true, + extends: ['@react-native', 'prettier'], + ignorePatterns: ['lib/'], + rules: { + 'prettier/prettier': 'off', + }, +}; diff --git a/packages/apps/purchase/.gitignore b/packages/apps/purchase/.gitignore new file mode 100644 index 000000000..c3af85790 --- /dev/null +++ b/packages/apps/purchase/.gitignore @@ -0,0 +1 @@ +lib/ diff --git a/packages/apps/purchase/.prettierrc.js b/packages/apps/purchase/.prettierrc.js new file mode 100644 index 000000000..7f82eab31 --- /dev/null +++ b/packages/apps/purchase/.prettierrc.js @@ -0,0 +1,5 @@ +const projectConfig = require('../../../.prettierrc'); + +module.exports = { + ...projectConfig, +}; diff --git a/packages/apps/purchase/README.md b/packages/apps/purchase/README.md new file mode 100644 index 000000000..d7be846aa --- /dev/null +++ b/packages/apps/purchase/README.md @@ -0,0 +1,44 @@ +--- +title: Purchase +tags: Readme +--- + +

@axelor/aos-mobile-purchase

+ +
+ +
+ +## Presentation + +This package was developed for the [Axelor Open Mobile](https://github.com/axelor/axelor-mobile) application. + +The purpose of this package is to link with the purchase module of the [Axelor Open Suite (AOS)](https://github.com/axelor/axelor-open-suite) ERP. It provides a simplified version of a number of processes available on the webapp. This package is compatible with AOS from version 8.3.0. + +## Usage + +Install the library : + +```bash +yarn add @axelor/aos-mobile-purchase +``` + +Compatibility with React v18.2.x and React Native v0.73.x. + +To add this package in your application, you need to add it in the _modules_ props of the component `Application` from @axelor/aos-mobile-core package. + +```typescript +import React from 'react'; +import {Application} from '@axelor/aos-mobile-core'; +import {PurchaseModule} from '@axelor/aos-mobile-purchase'; + +const App = () => { + return ; +}; + +export default App; +``` + +## Developpment + +This package is developed as part of the Axelor Open Mobile application. To contribute, please go to the [Github project](https://github.com/axelor/axelor-mobile) and follow the guidelines. You will also find an installation guide to help you configure your environment. diff --git a/packages/apps/purchase/babel.config.js b/packages/apps/purchase/babel.config.js new file mode 100644 index 000000000..f7b3da3b3 --- /dev/null +++ b/packages/apps/purchase/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ['module:@react-native/babel-preset'], +}; diff --git a/packages/apps/purchase/package.json b/packages/apps/purchase/package.json new file mode 100644 index 000000000..f4b802926 --- /dev/null +++ b/packages/apps/purchase/package.json @@ -0,0 +1,45 @@ +{ + "name": "@axelor/aos-mobile-purchase", + "version": "8.3.0", + "author": "Axelor", + "license": "AGPL-3.0-only", + "publishConfig": { + "access": "public" + }, + "main": "lib/index.js", + "types": "lib/index.d.js", + "files": ["lib"], + "scripts": { + "clean": "rm -rf lib/", + "compile": "tsc -p tsconfig.build.json", + "dev": "npm run compile -- --watch", + "build": "npm run clean && npm run compile", + "npm-publish": "npm publish", + "lint": "eslint .", + "format": "prettier --write src/", + "format:check": "prettier --check src/", + "license:add": "npx add-copyright-header --generate --dir 'src'" + }, + "peerDependencies": { + "react": "18.2.0", + "react-native": "0.73.9" + }, + "dependencies": { + "@axelor/aos-mobile-core": "8.3.0", + "@axelor/aos-mobile-ui": "8.3.0", + "@reduxjs/toolkit": "^2.2.7" + }, + "devDependencies": { + "@babel/runtime": "^7.20.0", + "@react-native/babel-preset": "0.73.21", + "@react-native/eslint-config": "0.73.2", + "@types/react": "^18.2.6", + "eslint": "8.57.0", + "prettier": "^3.3.3", + "react": "18.2.0", + "react-native": "0.73.9" + }, + "resolutions": { + "@types/react": "^18.2.6" + } +} \ No newline at end of file diff --git a/packages/apps/purchase/src/i18n/en.json b/packages/apps/purchase/src/i18n/en.json new file mode 100644 index 000000000..c6c997fe6 --- /dev/null +++ b/packages/apps/purchase/src/i18n/en.json @@ -0,0 +1,3 @@ +{ + "Purchase_Purchase": "Purchase" +} diff --git a/packages/apps/purchase/src/i18n/fr.json b/packages/apps/purchase/src/i18n/fr.json new file mode 100644 index 000000000..e2327c839 --- /dev/null +++ b/packages/apps/purchase/src/i18n/fr.json @@ -0,0 +1,3 @@ +{ + "Purchase_Purchase": "Achats" +} diff --git a/packages/apps/purchase/src/index.ts b/packages/apps/purchase/src/index.ts new file mode 100644 index 000000000..6a38082a6 --- /dev/null +++ b/packages/apps/purchase/src/index.ts @@ -0,0 +1,36 @@ +/* + * Axelor Business Solutions + * + * Copyright (C) 2024 Axelor (). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import {Module} from '@axelor/aos-mobile-core'; +import enTranslations from './i18n/en.json'; +import frTranslations from './i18n/fr.json'; + +export const PurchaseModule: Module = { + name: 'app-purchase', + title: 'Purchase_Purchase', + subtitle: 'Purchase_Purchase', + icon: 'cart-fill', + compatibilityAOS: { + moduleName: 'axelor-purchase', + downToVersion: '8.3.0', + }, + translations: { + en: enTranslations, + fr: frTranslations, + }, +}; diff --git a/packages/apps/purchase/tsconfig.build.json b/packages/apps/purchase/tsconfig.build.json new file mode 100644 index 000000000..d7b73541e --- /dev/null +++ b/packages/apps/purchase/tsconfig.build.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.build.json", + "compilerOptions": { + "resolveJsonModule": true, + "esModuleInterop": true, + "outDir": "lib", + "paths": { + "@/*": ["./src/*"] + } + }, + "include": ["src"] +} diff --git a/packages/apps/purchase/tsconfig.json b/packages/apps/purchase/tsconfig.json new file mode 100644 index 000000000..432038e36 --- /dev/null +++ b/packages/apps/purchase/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "paths": { + "@/*": ["./src/*"] + } + } +} diff --git a/src/App.js b/src/App.js index 1962238c9..2ffae140d 100644 --- a/src/App.js +++ b/src/App.js @@ -27,6 +27,7 @@ import {QualityModule} from '@axelor/aos-mobile-quality'; import {InterventionModule} from '@axelor/aos-mobile-intervention'; import {SaleModule} from '@axelor/aos-mobile-sale'; import {ProjectModule} from '@axelor/aos-mobile-project'; +import {PurchaseModule} from '@axelor/aos-mobile-purchase'; import {DmsModule} from '@axelor/aos-mobile-dms'; import application_properties from '../package.json'; import {app_config} from './app.config'; @@ -45,6 +46,7 @@ const App = () => { SaleModule, ProjectModule, DmsModule, + PurchaseModule, ]} mainMenu="auth_menu_user" version={application_properties.version}