Skip to content

Commit 7200aaf

Browse files
committed
feat: add a pkg
1 parent c72edc8 commit 7200aaf

File tree

562 files changed

+672104
-0
lines changed

Some content is hidden

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

562 files changed

+672104
-0
lines changed

manatee/pkg/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# consultations-pkg
2+
3+
## options
4+
```
5+
-db : run setup_py to rebuild your database
6+
-ow : overwrite concepts and collections
7+
-st : stage concepts and collections
8+
-s : a zipfile located on github or locally
9+
-y : accept defaults
10+
```
11+
12+
## load data
13+
To load data the target must be an arches project rather than the arches application:
14+
15+
```
16+
arches-project create myproject
17+
cd myproject
18+
python manage.py packages -o load_package -s https://github.com/archesproject/consultations-pkg/archive/master.zip -db true -y
19+
```

manatee/pkg/business_data/files/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"business_data" : {
3+
"resources" : [
4+
{
5+
"resourceinstance" : {
6+
"descriptors" : {
7+
"en" : {
8+
"description" : "Global root of group hierarchy.",
9+
"map_popup" : "Undefined",
10+
"name" : "Global Group"
11+
}
12+
},
13+
"graph_id" : "07883c9e-b25c-11e9-975a-a4d18cec433a",
14+
"graph_publication_id" : "82071e74-7042-11ee-bda3-0242ac140008",
15+
"legacyid" : null,
16+
"name" : "Root Group",
17+
"publication_id" : "6c8e0434-704e-11ee-89fc-0242ac140008",
18+
"resourceinstanceid" : "d2368123-9628-49a2-b3dd-78ac6ee3e911"
19+
},
20+
"tiles" : [
21+
{
22+
"data" : {
23+
"127095f5-c05e-11e9-bb57-a4d18cec433a" : {
24+
"de" : {
25+
"direction" : "ltr",
26+
"value" : ""
27+
},
28+
"el" : {
29+
"direction" : "ltr",
30+
"value" : ""
31+
},
32+
"en" : {
33+
"direction" : "ltr",
34+
"value" : "Global Group"
35+
},
36+
"en-US" : {
37+
"direction" : "ltr",
38+
"value" : ""
39+
},
40+
"en-us" : {
41+
"direction" : "ltr",
42+
"value" : ""
43+
},
44+
"fr" : {
45+
"direction" : "ltr",
46+
"value" : ""
47+
},
48+
"pt" : {
49+
"direction" : "ltr",
50+
"value" : ""
51+
},
52+
"ru" : {
53+
"direction" : "ltr",
54+
"value" : ""
55+
},
56+
"zh" : {
57+
"direction" : "ltr",
58+
"value" : ""
59+
}
60+
},
61+
"6b7fc7e2-0279-11ed-b140-0242ac180008" : null,
62+
"e8fe4f4e-027a-11ed-9dee-0242ac180008" : null
63+
},
64+
"nodegroup_id" : "12707705-c05e-11e9-8177-a4d18cec433a",
65+
"parenttile_id" : null,
66+
"provisionaledits" : null,
67+
"resourceinstance_id" : "d2368123-9628-49a2-b3dd-78ac6ee3e911",
68+
"sortorder" : 0,
69+
"tileid" : "8225f975-813d-4705-9ada-e8cedd6fea48"
70+
},
71+
{
72+
"data" : {
73+
"32dba023-c05e-11e9-aa88-a4d18cec433a" : {
74+
"de" : {
75+
"direction" : "ltr",
76+
"value" : ""
77+
},
78+
"el" : {
79+
"direction" : "ltr",
80+
"value" : ""
81+
},
82+
"en" : {
83+
"direction" : "ltr",
84+
"value" : "Global root of group hierarchy."
85+
},
86+
"en-US" : {
87+
"direction" : "ltr",
88+
"value" : ""
89+
},
90+
"en-us" : {
91+
"direction" : "ltr",
92+
"value" : ""
93+
},
94+
"fr" : {
95+
"direction" : "ltr",
96+
"value" : ""
97+
},
98+
"pt" : {
99+
"direction" : "ltr",
100+
"value" : ""
101+
},
102+
"ru" : {
103+
"direction" : "ltr",
104+
"value" : ""
105+
},
106+
"zh" : {
107+
"direction" : "ltr",
108+
"value" : ""
109+
}
110+
}
111+
},
112+
"nodegroup_id" : "32db94f8-c05e-11e9-a2c1-a4d18cec433a",
113+
"parenttile_id" : null,
114+
"provisionaledits" : null,
115+
"resourceinstance_id" : "d2368123-9628-49a2-b3dd-78ac6ee3e911",
116+
"sortorder" : 0,
117+
"tileid" : "98e7a90d-b1dc-49f6-8919-9434785e86ff"
118+
}
119+
]
120+
}
121+
]
122+
}
123+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"business_data" : {
3+
"resources" : [
4+
{
5+
"resourceinstance" : {
6+
"descriptors" : {
7+
"en" : {
8+
"description" : "Global root of group hierarchy.",
9+
"map_popup" : "Undefined",
10+
"name" : "Global Set"
11+
}
12+
},
13+
"graph_id" : "b16832e8-dfc9-4fc8-9c07-0c0b980ed220",
14+
"graph_publication_id" : "5ce8cde2-705e-11ee-977f-0242ac140008",
15+
"legacyid" : null,
16+
"name" : "Global Set",
17+
"publication_id" : "5ce8cde2-705e-11ee-977f-0242ac140008",
18+
"resourceinstanceid" : "74e496c7-ec7e-43b8-a7b3-05bacf496794"
19+
},
20+
"tiles" : [
21+
{
22+
"data" : {
23+
"a829879a-6f43-11ee-9ebf-0242ac140008" : {
24+
"de" : {
25+
"direction" : "ltr",
26+
"value" : ""
27+
},
28+
"el" : {
29+
"direction" : "ltr",
30+
"value" : ""
31+
},
32+
"en" : {
33+
"direction" : "ltr",
34+
"value" : "Global Set"
35+
},
36+
"en-US" : {
37+
"direction" : "ltr",
38+
"value" : ""
39+
},
40+
"en-us" : {
41+
"direction" : "ltr",
42+
"value" : ""
43+
},
44+
"fr" : {
45+
"direction" : "ltr",
46+
"value" : ""
47+
},
48+
"pt" : {
49+
"direction" : "ltr",
50+
"value" : ""
51+
},
52+
"ru" : {
53+
"direction" : "ltr",
54+
"value" : ""
55+
},
56+
"zh" : {
57+
"direction" : "ltr",
58+
"value" : ""
59+
}
60+
}
61+
},
62+
"nodegroup_id" : "2cd7a956-6f42-11ee-9192-0242ac140008",
63+
"parenttile_id" : null,
64+
"provisionaledits" : null,
65+
"resourceinstance_id" : "74e496c7-ec7e-43b8-a7b3-05bacf496794",
66+
"sortorder" : 0,
67+
"tileid" : "9aa3ad91-a049-4aa7-905b-e7269a707107"
68+
}
69+
]
70+
}
71+
]
72+
}
73+
}

manatee/pkg/business_data/relations/.gitkeep

Whitespace-only changes.

manatee/pkg/business_data/resource_views/.gitkeep

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "User Account Card",
3+
"description": "User account related to a person",
4+
"component": "views/components/cards/user_account",
5+
"componentname": "user-account-card",
6+
"defaultconfig": {
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
from arches.app.datatypes.base import BaseDataType
2+
from arches.app.models.models import Widget
3+
from arches.app.models.system_settings import settings
4+
5+
bngpoint = Widget.objects.get(name="bngpoint")
6+
7+
details = {
8+
"datatype": "bngcentrepoint",
9+
"iconclass": "fa fa-location-arrow",
10+
"modulename": "bngcentrepoint.py",
11+
"classname": "BNGCentreDataType",
12+
"defaultwidget": bngpoint,
13+
"defaultconfig": None,
14+
"configcomponent": None,
15+
"configname": None,
16+
"isgeometric": False,
17+
"issearchable": False,
18+
}
19+
20+
21+
class BNGCentreDataType(BaseDataType):
22+
def validate(self, value, row_number=None, source=None, node=None, nodeid=None, strict=False, request=None):
23+
24+
errors = []
25+
gridSquareArray = [
26+
"NA",
27+
"NB",
28+
"NC",
29+
"ND",
30+
"NE",
31+
"NF",
32+
"NG",
33+
"NH",
34+
"NJ",
35+
"NK",
36+
"NL",
37+
"NM",
38+
"NN",
39+
"NO",
40+
"NP",
41+
"NR",
42+
"NS",
43+
"NT",
44+
"NU",
45+
"NV",
46+
"NW",
47+
"NX",
48+
"NY",
49+
"NZ",
50+
"OA",
51+
"OB",
52+
"OF",
53+
"OG",
54+
"OL",
55+
"OM",
56+
"OQ",
57+
"OR",
58+
"OV",
59+
"OW",
60+
"SA",
61+
"SB",
62+
"SC",
63+
"SD",
64+
"SE",
65+
"SF",
66+
"SG",
67+
"SH",
68+
"SJ",
69+
"SK",
70+
"SL",
71+
"SM",
72+
"SN",
73+
"SO",
74+
"SP",
75+
"SQ",
76+
"SR",
77+
"SS",
78+
"ST",
79+
"SU",
80+
"SV",
81+
"SW",
82+
"SX",
83+
"SY",
84+
"SZ",
85+
"TA",
86+
"TB",
87+
"TF",
88+
"TG",
89+
"TL",
90+
"TM",
91+
"TQ",
92+
"TR",
93+
"TV",
94+
"TW",
95+
]
96+
try:
97+
# CS - Validation for datatype. Replicates functionality in widget which will be removed once datatype validation is fixed.
98+
firstTwoCharacters = value[0:2]
99+
numberElement = value[2:]
100+
101+
firstTwoCharacters in gridSquareArray
102+
isinstance(int(numberElement), int)
103+
len(value) == 12
104+
except Exception:
105+
errors.append({"type": "ERROR", "message": "Issue with input data"})
106+
107+
return errors
108+
109+
def append_to_document(self, document, nodevalue, nodeid, tile, provisional=False):
110+
111+
document["strings"].append({"string": nodevalue, "nodegroup_id": tile.nodegroup_id})
112+
113+
def get_search_terms(self, nodevalue, nodeid=None):
114+
return [nodevalue]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% load i18n %}
2+
3+
<div style="height:0px">
4+
<div class="row widget-container">
5+
<div class="form-group">
6+
<div class="col-xs-12">
7+
<label class="col-xs-12 control-label widget-input-label" for="bngNode"> {% trans "BNG Node" %}</label>
8+
<select data-placeholder="{% trans "Choose a card." %}"
9+
data-bind="chosen: {width: '100%', disable_search_threshold: 15}, value: bng_node, options: nodesBNG, optionsText: 'name', optionsValue: 'nodeid', valueAllowUnset: true"
10+
id="bngNode"></select>
11+
</div>
12+
</div>
13+
14+
<div class="form-group">
15+
<div class="col-xs-12">
16+
<label class="col-xs-12 control-label widget-input-label" for="geojsonNode"> {% trans "GeoJSON Node" %}</label>
17+
<select data-placeholder="{% trans "Choose a card." %}"
18+
data-bind="chosen: {width: '100%', disable_search_threshold: 15}, value: geojson_node, options: nodesGeoJSON, optionsText: 'name', optionsValue: 'nodeid', valueAllowUnset: true"
19+
id="geojsonNode"></select>
20+
</div>
21+
</div>
22+
23+
</div>
24+
</div>

0 commit comments

Comments
 (0)