User Tools

Site Tools


newdevs:code:save-grid-settings

New Developers Working Group

Save Grid Settings

This example added a workstation setting for the Monograph Parts Grid Preferences grid: https://bugs.launchpad.net/evergreen/+bug/1975852

Make the Save Grid Settings Option Visible

If the Save Grid Settings option doesn't appear at all, it likely needs to have a persistKey assigned to the grid.

<eg-grid #partsGrid idlClass="bmp" [dataSource]="gridDataSource" [sortable]="true"
    persistKey="catalog.record.parts"
    hideFields="label_sortkey,deleted,record"
    class="mt-3">

Determine the Setting Name

As above, you can identify the persistKey in the code to determine what the name of the new setting should be.

You can also tell via the browser console. The error you see when clicking on Save Grid Settings should should say something like:

Error saving columns: No user or workstation setting type
exists for: "eg.grid.catalog.record.parts".

Create Seed Data for New Installs

Update file: Open-ILS/src/sql/Pg/950.data.seed-values.sql

INSERT into config.workstation_setting_type (name, grp, datatype, label)
VALUES (
    'eg.grid.catalog.record.parts', 'gui', 'object',
    oils_i18n_gettext(
        'eg.grid.catalog.record.parts',
        'Grid Config: catalog.record.parts',
        'cwst', 'label'
       )
);

Create Upgrade Script for Existing Installs

New file: Open-ILS/src/sql/Pg/upgrade/XXXX.data.monograph_parts_grid.sql

Don't worry about trying to predict what the next sequential script number will be, just use "XXXX" and the core committer will update it at commit time.

BEGIN;

-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);

INSERT into config.workstation_setting_type (name, grp, datatype, label)
VALUES (
    'eg.grid.catalog.record.parts', 'gui', 'object',
    oils_i18n_gettext(
        'eg.grid.catalog.record.parts',
        'Grid Config: catalog.record.parts',
        'cwst', 'label'
       )
);

COMMIT;
newdevs/code/save-grid-settings.txt · Last modified: 2025/06/12 13:31 by tmccanna

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.