Skip to content

Commit

Permalink
Merge pull request #6337 from OCHA-DAP/dev
Browse files Browse the repository at this point in the history
dev into prod
  • Loading branch information
danmihaila authored Jun 1, 2024
2 parents 65c9faa + 4051dd1 commit 412d655
Show file tree
Hide file tree
Showing 114 changed files with 2,294 additions and 729 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _fetch_org_list_metadata(self):

if len(self.all_org_list) > 0:
for o in self.all_org_list:
if not o.get('closed_organization'):
if not o.get('closed_organization') and o.get('request_membership') != 'false':
self.active_org_dict[o.get('id')] = o.get('display_name')
else:
self.inactive_org_dict[o.get('id')] = o.get('display_name')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@


@validator_args
def request_new_organization_schema(not_empty, ignore_missing, hdx_url_validator):
def request_new_organization_schema(not_empty, ignore_missing):
schema = {
'name': [not_empty, unicode_safe],
'description': [not_empty, unicode_safe],
'website': [ignore_missing, unicode_safe, hdx_url_validator],
'website': [ignore_missing, unicode_safe],
'role': [not_empty, unicode_safe],
'data_type': [not_empty, unicode_safe],
'data_already_available': [not_empty, unicode_safe],
'data_already_available_link': [ignore_missing, unicode_safe, hdx_url_validator],
'data_already_available_link': [ignore_missing, unicode_safe],
}
return schema

Expand Down
3 changes: 2 additions & 1 deletion ckanext-hdx_org_group/ckanext/hdx_org_group/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ def get_validators(self):
def _modify_group_schema(self, schema):
schema.update({
'description': [tk.get_validator('not_empty')],
'org_url': [tk.get_validator('not_missing'), tk.get_converter('convert_to_extras')],
'org_url': [tk.get_validator('not_missing'), tk.get_validator('hdx_url_validator'),
tk.get_converter('convert_to_extras')],
'fts_id': [tk.get_validator('hdx_org_keep_prev_value_if_empty_unless_sysadmin'),
tk.get_validator('ignore_missing'),
tk.get_converter('convert_to_extras')],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def test_new_org_request(self):
self._get_action('hdx_send_new_org_request')(
{'model': model, 'session': model.Session},
{'title': 'Org Title', 'description': 'Org Description',
'org_url': 'http://test-org.com/',
'org_url': 'https://test-org.com/',
'your_name': 'Some Name', 'your_email': '[email protected]'}
)
assert False, 'anon user should not be allowed to send new org request'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_create_org_api(self):
new_org_dict = {
'name': 'test_org_dd',
'title': 'Test Org D',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
}
Expand All @@ -48,7 +48,7 @@ def test_create_org_api(self):
'id': org_dict.get('id'),
'name': 'test_org_dd',
'title': 'Test Org DD',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
}
Expand All @@ -65,7 +65,7 @@ def test_fts_id_api(self):
'name': 'test_org_d',
'title': 'Test Org D',
'fts_id': '123456',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
}
Expand Down Expand Up @@ -163,7 +163,7 @@ def test_fts_is_controller(self):
'name': 'test_org_d',
'title': 'Test Org D',
'fts_id': '123456',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'save': 'save'
Expand All @@ -189,7 +189,7 @@ def test_fts_is_controller(self):
'id': org_dict.get('id'),
'name': 'test_org_d',
'title': 'Test Org E',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'save': 'save'
Expand All @@ -207,7 +207,7 @@ def test_fts_is_controller(self):
'name': 'test_org_d',
'title': 'Test Org E',
'fts_id': '789',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'save': 'save'
Expand Down Expand Up @@ -240,7 +240,7 @@ def test_create_org_api(self):
new_org_dict = {
'name': 'test_org_dd',
'title': 'Test Org D',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
}
Expand All @@ -254,7 +254,7 @@ def test_create_org_api(self):
'id': org_dict.get('id'),
'name': 'test_org_dd',
'title': 'Test Org DD',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
}
Expand All @@ -271,7 +271,7 @@ def test_user_survey_url_api(self):
'name': 'test_org_d',
'title': 'Test Org D',
'user_survey_url': self.USER_SURVEY_URL,
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
}
Expand Down Expand Up @@ -372,7 +372,7 @@ def test_user_survey_url_controller(self):
'name': 'test_org_d',
'title': 'Test Org D',
'user_survey_url': self.USER_SURVEY_URL,
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'save': 'save'
Expand All @@ -398,7 +398,7 @@ def test_user_survey_url_controller(self):
'id': org_dict.get('id'),
'name': 'test_org_d',
'title': 'Test Org E',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'save': 'save'
Expand All @@ -418,7 +418,7 @@ def test_user_survey_url_controller(self):
'name': 'test_org_d',
'title': 'Test Org E',
'user_survey_url': self.USER_SURVEY_UPDATED_URL,
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'save': 'save'
Expand Down Expand Up @@ -452,7 +452,7 @@ def test_create_org_api(self):
new_org_dict = {
'name': 'test_org_dd',
'title': 'Test Org D',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
}
Expand All @@ -467,7 +467,7 @@ def test_create_org_api(self):
'id': org_dict.get('id'),
'name': 'test_org_dd',
'title': 'Test Org DD',
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
}
Expand All @@ -486,7 +486,7 @@ def test_closed_organization_api(self):
'name': 'test_org_d',
'title': 'Test Org D',
'closed_organization': True,
'org_url': 'www.exampleorganization.org',
'org_url': 'https://www.exampleorganization.org',
'description': 'just a simple description',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ def test_request_organization(self, _mail_new_membership_request, _check_request
new_wrong_org_dict['data_already_available_link'] = 'www.no.com123'
result = app.post(url, data=new_wrong_org_dict, extra_environ=auth_user, follow_redirects=True)
assert result.status_code == 200
assert result.body.count('Please provide a valid URL') == 2
assert result.body.count('Please provide a valid URL') == 0

new_wrong_org_dict['website'] = 'http://www.no.com'
new_wrong_org_dict['data_already_available_link'] = 'http://www.no.com'
result = app.post(url, data=new_wrong_org_dict, extra_environ=auth_user, follow_redirects=True)
assert result.status_code == 200
assert result.body.count('Please provide a valid URL') == 2
assert result.body.count('Please provide a valid URL') == 0

new_wrong_org_dict['website'] = 'no.com'
new_wrong_org_dict['data_already_available_link'] = 'no.com'
result = app.post(url, data=new_wrong_org_dict, extra_environ=auth_user, follow_redirects=True)
assert result.status_code == 200
assert result.body.count('Please provide a valid URL') == 2
assert result.body.count('Please provide a valid URL') == 0
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'title': 'Hdx Test Org',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'org_acronym': 'HTO',
'org_url': 'http://test-org.test',
'org_url': 'https://test-org.test',
'description': 'This is a test organization',
'users': [{'name': 'testsysadmin'}, {'name': 'janedoe3'}]
}
Expand Down Expand Up @@ -130,7 +130,7 @@ def test_create_with_group(self):

def test_create_dataset_as_normal_user(self):
normal_user = factories.User()
org = factories.Organization(user=normal_user, org_url='http://test.local/', hdx_org_type='donor')
org = factories.Organization(user=normal_user, org_url='https://test.local/', hdx_org_type='donor')

package = {
'package_creator': 'test function',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'title': 'Hdx Test Org',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'org_acronym': 'HTO',
'org_url': 'http://test-org.test',
'org_url': 'https://test-org.test',
'description': 'This is a test organization',
'users': [{'name': 'testsysadmin', 'capacity': 'admin'}, {'name': 'joeadmin', 'capacity': 'admin'}]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
'title': 'Hdx Test Org',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'org_acronym': 'HTO',
'org_url': 'http://test-org.test',
'org_url': 'https://test-org.test',
'description': 'This is a test organization',
'users': [{'name': 'testsysadmin'}, {'name': 'tester', 'capacity': 'member'}]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _create_package_by_user(cls, pkg_name, user, create_org_and_group=True):
:rtype: str
'''
if create_org_and_group:
factories.Organization(name='test_owner_org', org_url='http://example.org/',
factories.Organization(name='test_owner_org', org_url='https://example.org/',
hdx_org_type=ORGANIZATION_TYPE_LIST[0][1],
users=[{'name': 'testsysadmin', 'capacity': 'admin'}]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _create_test_data(cls):
'title': 'Hdx Test Org',
'hdx_org_type': ORGANIZATION_TYPE_LIST[0][1],
'org_acronym': 'HTO',
'org_url': 'http://test-org.test',
'org_url': 'https://test-org.test',
'description': 'This is a test organization',
'users': [{'name': 'testsysadmin'}, {'name': 'janedoe3'}]
}
Expand Down
16 changes: 15 additions & 1 deletion ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/admin/carousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,22 @@
background: #1ebfb3;
}
#carousel-config-main .carousel-item .thumbnail-preview .thumbnail-container .sub-item {
width: 215px;
width: calc(100% - 50px);
margin: auto;
float: none;
}
#carousel-config-main .carousel-item .thumbnail-preview .thumbnail-container .sub-item .sub-item-image {
height: auto;
}
#carousel-config-main .carousel-item .thumbnail-preview .thumbnail-container .sub-item .sub-item-image .graphic {
width: 100%;
height: auto;
aspect-ratio: 1.5;
border-radius: 6px;
}
#carousel-config-main .carousel-item .thumbnail-preview .thumbnail-container .sub-item .sub-item-action {
border-radius: 6px;
}
#carousel-config-main .carousel-item .sub-item {
width: 215px;
margin-right: 40px;
Expand Down Expand Up @@ -116,6 +128,8 @@
#carousel-config-main .carousel-item .sub-item .sub-item-caption {
text-align: left;
color: #fff;
height: 40px;
overflow: hidden;
}
#carousel-config-main .carousel-item .sub-item .sub-item-caption .description {
font-family: 'Gotham-Book', sans-serif;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
var html = this.template(template_data);

this.$el.html(html);
this.$el.attr("class", this.model.attributes.tab_open ? 'col-12' : 'col-4');
this.$el.attr("class", this.model.attributes.tab_open ? 'col-12' : 'col-6');
this.$el.find("select").select2();

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
display: block;
}
.hdxLogo .logo .logo-img {
background-image: url("/images/homepage/logo-hdx.svg");
background-image: url("/images/homepage/logo-hdx-accr-blk.svg");
background-repeat: no-repeat;
background-size: 126px 31px;
background-position: left center;
width: 126px;
height: 31px;
min-width: 126px;
min-height: 31px;
height: 30px;
margin-top: 1px;
}
/* END HDX Version display */
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,11 @@ ul.dataset-resources li + li.label-icons {
font-weight: 400;
font-size: 14px;
}
.sspRegular16 {
font-family: 'Source Sans Pro', sans-serif;
font-weight: 400;
font-size: 16px;
}
.sspBold16 {
font-family: 'Source Sans Pro', sans-serif;
font-weight: 700;
Expand Down Expand Up @@ -1454,6 +1459,16 @@ ul.dataset-resources li + li.label-icons {
#homepage-alerts .flash-messages {
background-color: transparent;
}
#homepage-alerts .paddingRowHack {
margin-left: 0;
margin-right: 0;
}
#homepage-alerts .paddingRowHack .paddingLeftHack {
padding-left: 0;
}
#homepage-alerts .paddingRowHack .paddingRightHack {
padding-right: 0;
}
/* END Style Bootstrap Flash messages*/
/* Common Classes */
.mTop60 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
font-weight: 400;
font-size: 14px;
}
.sspRegular16 {
font-family: 'Source Sans Pro', sans-serif;
font-weight: 400;
font-size: 16px;
}
.sspBold16 {
font-family: 'Source Sans Pro', sans-serif;
font-weight: 700;
Expand Down Expand Up @@ -96,6 +101,16 @@
#homepage-alerts .flash-messages {
background-color: transparent;
}
#homepage-alerts .paddingRowHack {
margin-left: 0;
margin-right: 0;
}
#homepage-alerts .paddingRowHack .paddingLeftHack {
padding-left: 0;
}
#homepage-alerts .paddingRowHack .paddingRightHack {
padding-right: 0;
}
/* END Style Bootstrap Flash messages*/
/* Common Classes */
.mTop60 {
Expand Down
6 changes: 3 additions & 3 deletions ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/base/footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@
line-height: 20px;
}
.hdx-footer .logo-gray {
height: 40px;
height: 30px;
margin-bottom: 10px;
}
.hdx-footer .match-logo-margin {
margin-top: 50px;
margin-top: 40px;
}
@media (max-width: 768px) {
.hdx-footer .match-logo-margin {
margin-top: 30px;
}
}
.hdx-footer .other-services img {
max-height: 40px;
max-height: 30px;
max-width: 100%;
}
.hdx-footer .other-services img.logo-hdx {
Expand Down
Loading

0 comments on commit 412d655

Please sign in to comment.