Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algunas configuraciones #1

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open

Algunas configuraciones #1

wants to merge 38 commits into from

Conversation

germankay
Copy link
Collaborator

@germankay germankay commented Feb 14, 2025

related https://github.com/okfn/ckan-bcie/issues/60

missing to add to install-extensions.sh:

echo "Installing ckanext-dashboard extension"
pip install -q git+https://github.com/okfn/ckanext-dashboard.git@main#egg=ckanext-dashboard

@germankay germankay requested a review from avdata99 February 17, 2025 16:31

class DatasetDashboard(toolkit.BaseModel, ActiveRecordMixin):
"""Modelo de datos para almacenar la configuración de un dashboard por dataset"""
__tablename__ = "ndx_dataset_dashboard"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
__tablename__ = "ndx_dataset_dashboard"
__tablename__ = "dashboard_package"

ndx?

{% block content_primary_nav %}
{{ super() }}
{{ h.build_nav_icon('dashboard_bp.dashboard_list', _('Dashboards'), icon='icon-list') }}
{{ h.build_nav_icon('dashboard_bp.dashboard_new', _('New Dashboard'), icon='icon-plus') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The New dashboard link is better to be included at the top of the dashboard list page

Suggested change
{{ h.build_nav_icon('dashboard_bp.dashboard_new', _('New Dashboard'), icon='icon-plus') }}


{% block content_primary_nav %}
{{ super() }}
{{ h.build_nav_icon('dashboard_bp.dashboard_list', _('Dashboards'), icon='icon-list') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{{ h.build_nav_icon('dashboard_bp.dashboard_list', _('Dashboards'), icon='icon-list') }}
{{ h.build_nav_icon('dashboard_bp.dashboard_list', _('External dashboards'), icon='icon-list') }}

<script type="module" src="https://public.tableau.com/javascripts/api/tableau.embedding.3.latest.min.js"></script>

<!-- Se inserta el componente web de Tableau -->
<tableau-viz id="tableauViz"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering we are going to use this for tableau, power bi and others, it will be a good idea not to use tableau in the element name

Should this be an <iframe>? What's <tableau-viz>?

@germankay germankay requested a review from avdata99 February 20, 2025 19:41
dashboards = p.toolkit.get_action('dataset_dashboard_list')(context, {})
except Exception as e:
log.error("Failed to load dashboards: %s", e)
flash("An error occurred while retrieving the dashboards.", "error")
Copy link
Member

@avdata99 avdata99 Feb 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CKAN have a own flash messages (toolkit.h.flash_success + toolkit.h.flash_error)
Example: https://github.com/ckan/ckan/blob/master/ckan/views/user.py#L827
Do not use flask version

Copy link
Member

@pdelboca pdelboca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good @germankay ! I added some comments :)

Copy link
Member

@pdelboca pdelboca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there @germankay ! I couple of extra comments :D

Comment on lines 121 to 122
if not dashboard_id:
raise ValueError("The 'id' parameter is required to update the dashboard.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to toolkit.get_or_bust('id') will raise a ValidationError if it does not exist so there is no need to double check it here.

Suggested change
if not dashboard_id:
raise ValueError("The 'id' parameter is required to update the dashboard.")

Comment on lines 158 to 160
dashboard_id = data_dict.get('id')
if not dashboard_id:
raise ValueError("The 'id' parameter is required to delete the dashboard.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dashboard_id = data_dict.get('id')
if not dashboard_id:
raise ValueError("The 'id' parameter is required to delete the dashboard.")
dashboard_id = toolkit.get_or_bust('id')


log = logging.getLogger(__name__)

dashboard_bp = Blueprint('dashboard_bp', __name__, url_prefix='/dashboard-external')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dashboard_bp = Blueprint('dashboard_bp', __name__, url_prefix='/dashboard-external')
dashboard_bp = Blueprint('embeded_dashboard', __name__, url_prefix='/embeded-dashboard')

Since dashboard is already taken in CKAN core, as @avdata99 mentioned, I will suggest to use embeded_dashboard and /embeded-dashboard since it is more explicit than external.

Embeded Dashboards is a common terminology in the BI and Analytics world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants