Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

173 Custom Fields when modifying organisation #32

Merged

Conversation

A-Souhei
Copy link
Contributor

@A-Souhei A-Souhei commented Sep 25, 2024

Description

Removes custom fields from organization's new and edit pages.

image

Closes fjelltopp/zarr-ckan#173

Checklist

Put an x in the boxes that apply to this pull request (you can also fill these out after opening the pull request).
You may not need to check all boxes.

  • The Jira ticket for this issue has been updated to "Ready to Review" or equivalent.
  • I have developed these changes in discussion with the appropriate project manager.
  • My code follows the general Fjelltopp documentation (see Confluence).
  • I have made corresponding changes to the Fjelltopp documentation (see Confluence).
  • I have rebased this branch with master.
  • New dependency changes have been committed.
  • I have added automated tests that prove my fix is effective or that my feature works.
  • New and existing tests pass locally with my changes.
  • My changes generate no new warnings.
  • I have performed a self-review of my own code.
  • I have assigned at least one reviewer.
  • I have assigned at least one label to this PR: "patch", "minor", "major".

@A-Souhei A-Souhei self-assigned this Sep 25, 2024
@A-Souhei A-Souhei added the patch label Sep 25, 2024
@A-Souhei A-Souhei force-pushed the 173-accidental-custom-fields-when-modifying-organisation branch from 014ae48 to 993243b Compare September 25, 2024 10:23
@A-Souhei A-Souhei marked this pull request as ready for review September 25, 2024 11:29
Copy link
Member

@ChasNelson1990 ChasNelson1990 left a comment

Choose a reason for hiding this comment

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

Where do those fields originally come from?

@A-Souhei
Copy link
Contributor Author

@ChasNelson1990 , the fields are in the block in zarr-ckan/ckan/ckan/templates/organization/snippets/organization_form.html:

  {% block custom_fields %}
    {% snippet 'snippets/custom_form_fields.html', extras=data.extras, errors=errors, limit=3 %}
  {% endblock %}

@ChasNelson1990
Copy link
Member

@A-Souhei - but that block is only handling formatting of the custom fields why do we have these fields in the data dictionary at all?

@A-Souhei
Copy link
Contributor Author

I will look more at it tomorrow.

@A-Souhei
Copy link
Contributor Author

A-Souhei commented Sep 26, 2024

@ChasNelson1990 , from snippets/custom_form_fields.html:

  {# Add a max of 3 empty columns #}
  {% set total_extras = extras|count %}
  {% set empty_extras = (limit or 3) - total_extras %}
  {% if empty_extras <= 0 %}{% set empty_extras = 1 %}{% endif %}

This chunk will make it that even if we set limit to 0 in previous comment code, it will add 3 customs fields by default.

Should I update this template instead?

I tried with a vanilla ckan docker compose stack :

image

@ChasNelson1990 ChasNelson1990 self-requested a review September 26, 2024 13:47
@ChasNelson1990
Copy link
Member

@A-Souhei do we know why this was added? Or when, is it recent? Is there a good reason?

@A-Souhei
Copy link
Contributor Author

A-Souhei commented Oct 2, 2024

Some interesting discussions about it :
ckan/ckan#6037

Copy link
Member

@ChasNelson1990 ChasNelson1990 left a comment

Choose a reason for hiding this comment

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

Let's get this merged

@A-Souhei A-Souhei merged commit c855e4f into main Oct 2, 2024
2 checks passed
@A-Souhei A-Souhei deleted the 173-accidental-custom-fields-when-modifying-organisation branch October 2, 2024 13:03
cooper667 pushed a commit that referenced this pull request Jan 23, 2025
cooper667 added a commit to fjelltopp/zarr-ckan that referenced this pull request Jan 23, 2025
* [ckanext-zarr] feat: create README.md

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@cf62433

* [ckanext-zarr] feat: initialise ckan extension


Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@e0dedd5

* [ckanext-zarr] fix: add .gitignore


Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@467d4f4

* [ckanext-zarr] 2- branding for homepage, search page, dataset page and resource page (fjelltopp/ckanext-zarr#3)

* _

* Adding helper functions / extended fjelltopp-theme layout

* Adding helper functions / extended fjelltopp-theme layout

* Adding helper functions / extended fjelltopp-theme layout

* _

* scaled promoted bg image

* _

* _

* Updated 'recently updated'

* Moved package item template to fjelltopp theme

* Removed a few helpers to clean code

* Added the topics section

* Updated :
fjelltopp-theme
added disclaimer
about

* Updated :
Insights

---------

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@126e8db

* [ckanext-zarr] Rename the __github to .github to effectively make the actions tests run again (fjelltopp/ckanext-zarr#4)

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@7e861cd

* [ckanext-zarr] With this commit, ZaRR should work with master branch of fjelltopp-theme without further changes (fjelltopp/ckanext-zarr#5)

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@1a083b3

* [ckanext-zarr] 10 - additional ZaRR UI enhancements (fjelltopp/ckanext-zarr#11)

* Updates copyright value

* Updates subscribe_to_updates.html subtext content

* Dataset search fa-search hover fixed

* Dataset search fa-search hover fixed

* Removed the extended subcribe_to_updates.html

* fix .fa-search color

---------

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@b2b907c

* [ckanext-zarr] 9- Dublin Core metadata standards (fjelltopp/ckanext-zarr#6)

* Added a draft schema for Dublin Core and a dcat profile to include the elements in dcat export

* Small change to doi label

* Small changes for a few help_text

* Updates to schema

* Updates to schema

* Updates to schema

* Convert Json Schema to Yaml

* Updates to UI

* Updates to UI

* Updates to schema

* Added validator for date, a few fix for UI

* Fixing multiple select

* Macro for multiple select

* Using yaml schema now

* css fix

* Small code fix

* Default metadata for resources

* Small fix for multiple_select_formatter

* wip: add file uploader (fjelltopp/ckanext-zarr#9)

* Code improvements for additional_info.html and helpers.py

* Remove excess of lines from zarr.css

* Moved the namespace with others

* Updated the language field as a single select

* Updated the language field as a single select

* Renamed schema

* Commented profiles.py as WIP

---------

Co-authored-by: toavina <[email protected]>
Co-authored-by: Chas Nelson <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@8414244

* [ckanext-zarr] 15-Updating about page (fjelltopp/ckanext-zarr#16)

* About content updated with styling

* About content updated with styling

---------

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@56486af

* [ckanext-zarr] feat: add a placeholder video to the homepage (fjelltopp/ckanext-zarr#23)

* feat: add a placeholder video to the homepage

* fix: make iframe responsive

* fix: make caption i18n friendly

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@1254dda

* [ckanext-zarr] feat: move datahub stats into footer (fjelltopp/ckanext-zarr#20)

* Removed insight section

* Removed max-width for bottom search footer button

* Updating search button

* Updating search button

* small comment

* a bit of customization for datahub stats

* fix: keep insights

---------

Co-authored-by: toavina <[email protected]>
Co-authored-by: Chas Nelson <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@da37dde

* [ckanext-zarr] feat: make Dublin Core 'types' be CKAN 'groups' and display on homepage (fjelltopp/ckanext-zarr#22)

* using groups with extra whose key is 'topic' and value is 'yes'

* Removed filtering

* Removed filtering

* Updated the name 'topic' to 'Resource Type'

---------

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@221a315

* [ckanext-zarr] feat: add small visual enhancements (fjelltopp/ckanext-zarr#24)

* Removed extra 'Learn more about the repository'

* Still under development banner color white / green background

* update grays in datasets and resource read

* changes inactive stage background color

* needs rebase

---------

Co-authored-by: toavina <[email protected]>
Co-authored-by: Chas Nelson <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@8ed195b

* [ckanext-zarr] fix: update resource type in schema to match latest dublin definitions


Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@88d5ca2

* [ckanext-zarr] feat: simplify schema (fjelltopp/ckanext-zarr#25)

* feat: simplify schema

* fix: minor improvement to subject placeholder

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@ab1212b

* [ckanext-zarr] fix: correct minor typo


Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@c811f2f

* [ckanext-zarr] Updates to font sizes (fjelltopp/ckanext-zarr#26)

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@474790f

* [ckanext-zarr] Added padding to licence (fjelltopp/ckanext-zarr#28)

replace "Licence" to "" (use an extension template)

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@de5ffc4

* [ckanext-zarr] fix: give webassets unique names (fjelltopp/ckanext-zarr#27)

* wip: remove cssrewrite

* wip: remove version in outputs

* revert: undo webassets hash changes

* wip: combine CSS assets

* wip: combine CSS assets

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@8fd2333

* [ckanext-zarr] Add Organizations to menu bar (fjelltopp/ckanext-zarr#29)

* Added organizations to facets

* refactoring

* Added organizations and renamed find data to data

* Added organizations and renamed find data to data

* Defines the top menu nav items

---------

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@e9c4d25

* [ckanext-zarr] ZaRR dataset read page to look like WHO-AFRO (fjelltopp/ckanext-zarr#30)

* draft

* Refactored in fjelltopp-theme

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@23baa7e

* [ckanext-zarr] Updating get_facet_items_dict (fjelltopp/ckanext-zarr#37)



Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@109dfe7

* [ckanext-zarr] update in project description (fjelltopp/ckanext-zarr#38)



Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@7505f73

* [ckanext-zarr] Removes custom field from organization_form.html (fjelltopp/ckanext-zarr#32)



Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@c855e4f

* [ckanext-zarr] 174 - Add mandatory check box about personally identifiable information (fjelltopp/ckanext-zarr#40)

* added a multi checkbox in schema

* added a new preset

* added a new preset

* Updated preset

* Invalidate this change

* Small update to display_snippet

* Small fix to schema

* More update

* More update

* Changed default values

* Small id change

* invalidate changes on react files

* invalidate changes on react files

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@7695951

* [ckanext-zarr] Add Zambia flag colors on promoted (fjelltopp/ckanext-zarr#41)

* flag added on promoted right

* small fix in layout1.html

* Removed dots and made the flag flat

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@18f6055

* [ckanext-zarr] 179 - Change name  (fjelltopp/ckanext-zarr#42)

* change of name

* change of name

* change of name

* small fix

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@979acce

* [ckanext-zarr] fix: relock npm from inside container (fjelltopp/ckanext-zarr#43)



Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@0aa1358

* [ckanext-zarr] feat: make group icons on homepage show their group images as icons (fjelltopp/ckanext-zarr#44)

* feat: make groups on home page show icons

* feat: make flag a bit thinner

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@b65e604

* [ckanext-zarr] 185 - Fjelltopp theme leaks through on the footer (fjelltopp/ckanext-zarr#45)

* Remove footer effects

* Remove footer effects

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@ad6d992

* [ckanext-zarr] feat: remove custom fields for groups (fjelltopp/ckanext-zarr#46)



Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@4fdc837

* [ckanext-zarr] fix: replace logo with official version


Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@5db4eab

* [ckanext-zarr] adds dataset to "resource type" group if an option is selected (fjelltopp/ckanext-zarr#48)



Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@c1a9db1

* [ckanext-zarr] 195-on-wide-screens-the-dark-green-doesnt-cover-the-full-photo-on-the-home-page - fix (fjelltopp/ckanext-zarr#50)



Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@1358106

* [ckanext-zarr] 192 - Make schema badges actually reflect groups (fjelltopp/ckanext-zarr#49)

* resource types shown as badges in promoted

* added comments

* apply styling

* apply styling (added to palette)

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@4a6274f

* [ckanext-zarr] fix:badge in dashboard dataset is not positioned in the best (fjelltopp/ckanext-zarr#51)



Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@f24e688

* [ckanext-zarr] draft can be deleted (fjelltopp/ckanext-zarr#54)

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@af3a8bb

* [ckanext-zarr] 199 fix:rename zarr dataset_type to data (fjelltopp/ckanext-zarr#52)

* fix:rename dataset_type value to data

* Simplify the dashboard datasets tab label as humanize_entity_type will return 'My Datas'

* adds a comment to explain template extension

* debugging

* A staging schema with dataset_type: dataset

---------

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@7a01670

* [ckanext-zarr] 196 email addresses are case sensitive (fjelltopp/ckanext-zarr#55)

* Adding the case insensitive feature in zarr extension

* Removed unused import

* Removed unused import

* added password verification

* added tests

* Renamed WHOAFROPlugin to ZaRRPlugin

* Added one more test

---------

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@04e3a13

* [ckanext-zarr] Increased z-index for ul.nav.nav-tabs so promoted vertical bars do not hide them (fjelltopp/ckanext-zarr#56)

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@7dfee77

* [ckanext-zarr] Some metadata fields are not responsive when viewing datasets (fjelltopp/ckanext-zarr#57)

* added a word break property so metadata td does not exceed container

* justified dataset and resource descriptions

* small update

* word break is better

* More specific selector

---------

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@dc79d62

* [ckanext-zarr] Added get package stats for google analytics in extension (fjelltopp/ckanext-zarr#58)

Co-authored-by: toavina <[email protected]>

Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@b8593f8

* [ckanext-zarr] fix: remove redundant tests that also include secrets (fjelltopp/ckanext-zarr#59)



Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@257be99

* [ckanext-zarr] chore: move all files into ckanext-zarr


Commit migrated from fjelltopp/ckanext-zarr: fjelltopp/ckanext-zarr@cbee43b

* remove submodule

---------

Co-authored-by: Chas Nelson <[email protected]>
Co-authored-by: Toavina A. <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accidental(?) Custom Fields when modifying organisation
2 participants