Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

budget: update entities budget and acq_account for new formly component #691

Merged
merged 1 commit into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion babel.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ extract_messages = $._, jQuery._

# Extraction from json files (schema, form)
[json: **.json]
keys_to_translate = ['^title$', 'description', 'placeholder', 'validationMessage', 'name', 'add', '403', '.*Message']
keys_to_translate = ['^title$', 'label', 'description', 'placeholder', 'validationMessage', 'name', 'add', '403', '.*Message']
1 change: 1 addition & 0 deletions rero_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,7 @@ def _(x):
# ===========================
RERO_ILS_BABEL_TRANSLATE_JSON_KEYS = [
'title',
'label',
'description',
'placeholder',
'validationMessage',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"title": "Acquisition account",
"description": "JSON schema for an acquisition account",
"additionalProperties": false,
"propertiesOrder": [
"name",
"description",
"amount_allocated"
],
"required": [
"$schema",
"pid",
Expand All @@ -26,20 +31,23 @@
},
"name": {
"title": "Name",
"description": "Name of the Acquisition account.",
"description": "Name of the acquisition account.",
"type": "string",
"minLength": 1
"minLength": 1,
"form": {
"focus": true
}
},
"description": {
"title": "Description",
"description": "Description of the Acquisition account.",
"description": "Description of the acquisition account.",
"type": "string",
"minLength": 1
},
"budget": {
"title": "Budget",
"type": "object",
"description": "The Acquisition account belongs to which budget.",
"description": "The acquisition account belongs to which budget.",
"properties": {
"$ref": {
"title": "Budget URI",
Expand All @@ -50,7 +58,7 @@
},
"amount_allocated": {
"title": "Amount allocated",
"description": "The amount allocated for the Acquisition account.",
"description": "The amount allocated for the acquisition account.",
"type": "number"
},
"library": {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion rero_ils/modules/budgets/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
from ..api import IlsRecord, IlsRecordsSearch
from ..fetchers import id_fetcher
from ..minters import id_minter
from ..providers import Provider
from ..organisations.api import Organisation
from ..providers import Provider

# provider
BudgetProvider = type(
Expand Down
59 changes: 51 additions & 8 deletions rero_ils/modules/budgets/jsonschemas/budgets/budget-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@
"title": "Budget",
"description": "JSON schema for budget.",
"additionalProperties": false,
"propertiesOrder": [
"name",
"start_date",
"end_date",
"is_active"
],
"required": [
"$schema",
"pid"
"pid",
"name",
"start_date",
"end_date"
],
"properties": {
"$schema": {
Expand All @@ -24,26 +33,60 @@
"title": "Budget name",
"description": "Name of the budget.",
"type": "string",
"minLength": 1
"minLength": 1,
"form": {
"focus": true,
"validation": {
"validators": {
"valueAlreadyExists": {
"term": "name"
}
},
"messages": {
"alreadyTakenMessage": "The budget name is already taken"
}
}
}
},
"start_date": {
"type": "string",
"format": "date",
"title": "Start date",
"pattern": "\\d{4}-((0[1-9])|(1[0-2]))-(((0[1-9])|[1-2][0-9])|(3[0-1]))$",
"validationMessage": "Required. Should be in the ISO 8601, YYYY-MM-DD.",
"title": "Budget start date"
"validationMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD).",
"form": {
"type": "datepicker",
"wrappers": [
"form-field"
],
"validation": {
"messages": {
"pattern": "Should be in the ISO 8601, YYYY-MM-DD."
Garfield-fr marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
},
"end_date": {
"type": "string",
"format": "date",
"title": "End date",
"pattern": "\\d{4}-((0[1-9])|(1[0-2]))-(((0[1-9])|[1-2][0-9])|(3[0-1]))$",
"validationMessage": "Required. Should be in the ISO 8601, YYYY-MM-DD.",
"title": "Budget end date"
"validationMessage": "Should be in the following format: 2022-12-31 (YYYY-MM-DD).",
"form": {
"type": "datepicker",
"wrappers": [
"form-field"
],
"validation": {
"messages": {
"pattern": "Should be in the ISO 8601, YYYY-MM-DD."
Garfield-fr marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
},
"is_active": {
"type": "boolean",
"title": "True if budget is active",
"description": "True if budget is active",
"title": "Active",
"default": false
},
"organisation": {
Expand Down

This file was deleted.

Loading