Skip to content

Commit

Permalink
Move the codiceIPA field and reword its description.
Browse files Browse the repository at this point in the history
Make the codiceIPA field more visible and explicitly
mention it's mandatory for PAs.

Fix #173.

Co-authored-by: Alessandro Sebastiani <sebbalex@users.noreply.github.com>
  • Loading branch information
bfabio and sebbalex committed Oct 13, 2020
1 parent 3db0214 commit 9d02800
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/app/contents/data.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import data, { fieldsAsync } from "./fields";

const { sections, groups, available_countries, countrySpec } = data;
Expand Down Expand Up @@ -35,6 +36,9 @@ export const getLabel = (allFields, title) => {
const generateBlocks = allFields => {
return sections.map((s, i) => {
let fields = allFields.filter(obj => obj.section === i);

fields = _.partition(fields, obj => obj.prepend).flat();

let items = fields.map(i => {
let prefix = i.group ? `${i.group}_` : "";
if (!i.title.includes(prefix)) i.title = `${prefix}${i.title}`;
Expand Down
7 changes: 5 additions & 2 deletions src/app/contents/fields/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,22 @@ const it = [
},
{
section: 3,
prepend: true, // Prepend this field at the top of its section
group: "it",
title: "riuso",
label: "Riuso",
showLabel: false,
type: "object",
cn: "block__item--full",
properties: {
codiceIPA: {
title: "codiceIPA",
label: "Codice IPA",
label: "Codice iPA dell'ente (obbligatorio per Pubbliche Amministrazioni)",
type: "string",
widget: "rsearch",
description:
"Questa chiave rappresenta il codice dell'amministrazione all'interno dell'Indice delle Pubbliche Amministrazioni (codice IPA) Il parser applicherà il corretto prefisso al valore dato a questa chiave per creare un'URI identificativa, una volta che questo sarà definito. L'URI sarà riconducibile a http://w3id.org/italia/data secondo la politica degli URI adottata in ambito DAF.",
`Codice dell'ente all'interno dell'Indice delle Pubbliche Amministrazioni
(codice iPA, https://indicepa.gov.it/).`,
ajax: {
url: elasticUrl,
params: (value => {
Expand Down
1 change: 0 additions & 1 deletion src/app/form/widgets/RemoteSearchWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ class RSComponent extends Component {

const renderInput = field => {
const className = classNames([
"form-group", "riuso-box",
{ "has-error": field.meta.touched && field.meta.error }
]);
return (
Expand Down
1 change: 0 additions & 1 deletion src/asset/block.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
display: flex;
flex-wrap: wrap;
padding: 0;
min-height: 250px;
}

.block_heading_oval {
Expand Down
4 changes: 0 additions & 4 deletions src/asset/editor_widget.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ input.rw-widget-input {
border: none !important;
}

.riuso-box {
min-height: 300px;
}

//fixes #98 - Editor area grows when unbreaked words
.editor__component .public-DraftEditor-content {
word-break: break-all;
Expand Down

0 comments on commit 9d02800

Please # to comment.