Skip to content

Commit

Permalink
Merge branch 'canada-v2.10' into feature/split-ds-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JVickery-TBS committed Dec 16, 2024
2 parents 3ed81b6 + 7074987 commit a72c1a9
Show file tree
Hide file tree
Showing 24 changed files with 733 additions and 439 deletions.
23 changes: 16 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ orbs:
jobs:
build:
docker:
- image: openknowledge/ckan-dev:2.9 # primary executor
- image: ckan/ckan-dev:2.10.4 # primary executor
name: ckan
environment:
PGHOST: postgres
Expand All @@ -39,7 +39,7 @@ jobs:
CKAN_REDIS_URL: redis://redis:6379/1
- image: opendatacanada/solr # dependency service
name: solr
- image: postgres:9.6 # dependency service
- image: postgres:13.14 # dependency service
name: postgres
environment:
POSTGRES_USER: postgres
Expand All @@ -54,23 +54,32 @@ jobs:
- "f2:9a:75:b8:82:b3:08:63:3d:9c:71:1d:14:2a:fa:18"
- checkout
- run:
name: Set CKAN to open-data/ckan@canada-py3
name: Set Python Version to 3.9
command: |
apk add --no-cache python3=3.9.18-r0 --repository=https://dl-cdn.alpinelinux.org/alpine/v3.15/main
ln -sf python3 /usr/local/bin/python
python3 -m ensurepip
pip3 install --no-cache --upgrade pip setuptools
python3 --version
- run:
name: Set CKAN to open-data/ckan@canada-v2.10
command: |
pip uninstall -y ckan
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ remote add canada https://github.com/open-data/ckan.git
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ fetch canada canada-py3
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ checkout -b canada-py3 canada/canada-py3
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ fetch canada canada-v2.10
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ checkout -b canada-v2.10 canada/canada-v2.10
git --git-dir=\/srv\/app\/src\/ckan\/.git --work-tree=\/srv\/app\/src\/ckan\/ pull
- run:
name: Install requirements
command: |
pip install setuptools==44.1.0
pip install --upgrade setuptools==70.0.0
pip install --upgrade pip==23.2.1
pip install cython
pip install -e \/srv\/app\/src\/ckan\/ -r \/srv\/app\/src\/ckan\/requirements.txt -r \/srv\/app\/src\/ckan\/dev-requirements.txt
pip install -e . -r .\/requirements.txt -r .\/test-requirements.txt
find \/srv\/app\/ -name '*.pyc' -delete
- run:
name: Setup extension (CKAN 2.9 PY3)
name: Setup extension (CKAN 2.10 PY3.9)
command: |
ln -s \/srv\/app\/src\/ckan\/test-core.ini .\/links\/test-core.ini
ln -s \/srv\/app\/src\/ckan\/who.ini .\/links\/who.ini
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/change_log.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fullfile=$(ls ./changes/${{ github.event.number }}.*)
filename=$(basename -- "$fullfile")
extension="${filename##*.}"
allowed_types='[ "fix", "bugfix", "hotfix", "feature", "misc", "changes", "migration", "removal" ]'
allowed_types='[ "fix", "bugfix", "hotfix", "feature", "misc", "changes", "migration", "removal", "release" ]'
if [[ $allowed_types =~ "\"$extension\"" ]]; then
echo -e "\n"
echo -e "\033[0;36mINFO: extension ${extension} accepted.\033[0;0m"
Expand Down
1 change: 1 addition & 0 deletions changes/130.changes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`max_chars` schema field argument now displays in Data Dictionaries as `Character Limit`
1 change: 1 addition & 0 deletions changes/v210.release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Released CKAN 2.10 compatible code.
38 changes: 38 additions & 0 deletions ckanext/recombinant/assets/css/recombinant.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#api-access-accordion figure{
display: none;
}
#api-access-accordion figure.python{
display: none;
}
/* Default cURL display */
#api-access-accordion figure.curl{
display: block;
}
#api-access-accordion figure.powershell{
display: none;
}
#api-access-example-code-control label::after{
content: none !important;
}
#api-access-example-code-control input[type="radio"]{
cursor: pointer !important;
}
#api-access-accordion figure{
margin-bottom: 12px !important;
}
#api-access-accordion pre{
margin-bottom: 0 !important;
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
}
#api-access-accordion figure figcaption{
padding: 4px 8px;
background-color: #335075;
color: white;
font-weight: 700 !important;
font-size: 14px;
line-height: 1.5 !important;
border-bottom-left-radius: 4px !important;
border-bottom-right-radius: 4px !important;
text-align: right !important;
}
76 changes: 76 additions & 0 deletions ckanext/recombinant/assets/js/code_block_buttons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
window.addEventListener('load', function(){
$(document).ready(function() {

// Code example switching
let codeExampleControl = $('#api-access-example-code-control');
let codeBlocks = $('#api-access-accordion').find('figure');

if( codeExampleControl.length > 0 ){

let controlButtons = $(codeExampleControl).find('input[name="api-access-example-code"]');

if( controlButtons.length > 0 ){

$(controlButtons).on('change', function(_event){

let selectedCode = $(codeExampleControl).find('input[name="api-access-example-code"]:checked').val();

$(codeBlocks).each(function(_index, _codeBlock){

if( $(_codeBlock).hasClass(selectedCode) ){

$(_codeBlock).show();

}else{

$(_codeBlock).hide();

}

});

});

}

}

// Activity tab link
let activityTab = $('#activity-lnk');

if( activityTab.length > 0 ){

let link = $('#activity').find('a').first().attr('href');

if( link && link.length > 0 ){

$(activityTab).attr('href', link);
$(activityTab).removeAttr('aria-controls');
$(activityTab).attr('tabindex', 0);

$(activityTab).off('click');
$(activityTab).off('keyup');

function _goto_activity(){
window.location = link;
}

$(activityTab).on('click.Link', function(_event){
_event.preventDefault();
_goto_activity();
});
$(activityTab).on('keyup.Link', function(_event){
let keyCode = _event.keyCode ? _event.keyCode : _event.which;
// space and enter keys required for a11y
if( keyCode == 32 || keyCode == 13 ){
_event.preventDefault();
_goto_activity();
}
});

}

}

});
});
9 changes: 9 additions & 0 deletions ckanext/recombinant/assets/webassets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
code_block_buttons:
contents:
- js/code_block_buttons.js
output: recombinant/%(version)s_code_block_buttons.js

main_css:
contents:
- css/recombinant.css
output: recombinant/%(version)s_recombinant.css
Loading

0 comments on commit a72c1a9

Please sign in to comment.