Skip to content

Commit

Permalink
budget: update entities budget and acq_account for new formly component
Browse files Browse the repository at this point in the history
* Updates budget and acq_account for formly.
* Fixes translation for new options form.
* Updates babel config to extract new label key.

Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
Garfield-fr committed Jan 16, 2020
1 parent ada5f7d commit d94c5b4
Show file tree
Hide file tree
Showing 20 changed files with 31,958 additions and 8,764 deletions.
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 @@ -28,7 +33,10 @@
"title": "Name",
"description": "Name of the Acquisition account.",
"type": "string",
"minLength": 1
"minLength": 1,
"form": {
"focus": true
}
},
"description": {
"title": "Description",
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
55 changes: 49 additions & 6 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": "Budget 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"
"form": {
"type": "datepicker",
"wrappers": [
"form-field"
],
"validation": {
"messages": {
"pattern": "Should be in the ISO 8601, YYYY-MM-DD."
}
}
}
},
"end_date": {
"type": "string",
"format": "date",
"title": "Budget 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"
"form": {
"type": "datepicker",
"wrappers": [
"form-field"
],
"validation": {
"messages": {
"pattern": "Should be in the ISO 8601, YYYY-MM-DD."
}
}
}
},
"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

0 comments on commit d94c5b4

Please sign in to comment.