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

Duration unit validation does not respect the custom locale units #8497

Open
ghulamghousdev opened this issue Feb 7, 2024 · 1 comment
Open
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer

Comments

@ghulamghousdev
Copy link
Member

ghulamghousdev commented Feb 7, 2024

Forum post

Add customLocale.js file in advanced demo with following config:

import LocaleHelper from '../../lib/Core/localization/LocaleHelper.js';
import '../../lib/Gantt/localization/De.js';

const locale = {
    localeName : 'De',
    localeDesc : 'Deutsch',
    localeCode : 'de-DE',
    DateHelper : {
        locale         : 'de-DE',
        unitNames : [
            { single : 'Tag', plural : 'Tage', abbrev : 't' },
            { single : 'Woche', plural : 'Wochen', abbrev : 'w' },
        ]
    }
};

export default LocaleHelper.publishLocale(locale);

Use this config in the advanced demo:

import '../_shared/shared.js'; // not required, our example styling etc.
import Gantt from '../../lib/Gantt/view/Gantt.js';
import '../../lib/Gantt/column/AllColumns.js';
import '../../lib/Scheduler/feature/TimeRanges.js';
import '../../lib/SchedulerPro/feature/DependencyEdit.js';
import '../../lib/Gantt/feature/Baselines.js';
import '../../lib/Scheduler/feature/RowResize.js';
import '../../lib/Grid/feature/Filter.js';
import '../../lib/Gantt/feature/Labels.js';
import '../../lib/Gantt/feature/ParentArea.js';
import '../../lib/Gantt/feature/ProjectLines.js';
import '../../lib/Gantt/feature/ProgressLine.js';
import '../../lib/Gantt/feature/Rollups.js';
import '../../lib/Gantt/feature/TaskEdit.js';
import '../../lib/Grid/feature/CellCopyPaste.js';
import '../../lib/Grid/feature/FillHandle.js';
import './customLocal.js';
import LocaleManager from '../../lib/Core/localization/LocaleManager.js';

import './lib/GanttToolbar.js';
import Task from './lib/Task.js';
import './lib/StatusColumn.js';

const gantt = new Gantt({
    appendTo : 'container',

    dependencyIdField : 'wbsCode',

    selectionMode : {
        cell       : true,
        dragSelect : true,
        rowNumber  : true
    },

    project : {
        // Let the Project know we want to use our own Task model with custom fields / methods
        taskModelClass : Task,
        transport      : {
            load : {
                url : '../_datasets/launch-saas.json'
            }
        },
        autoLoad  : true,
        taskStore : {
            wbsMode : 'auto'
        },
        // The State TrackingManager which the UndoRedo widget in the toolbar uses
        stm : {
            autoRecord : true
        },
        // Reset Undo / Redo after each load
        resetUndoRedoQueuesAfterLoad : true
    },

    startDate                     : '2019-01-12',
    endDate                       : '2019-03-24',
    resourceImageFolderPath       : '../_shared/images/users/',
    scrollTaskIntoViewOnCellClick : true,

    columns : [
        { type : 'wbs' },
        { type : 'name', width : 250 },
        { type : 'startdate' },
        { type : 'duration' },
        { type : 'resourceassignment', width : 120, showAvatars : true },
        { type : 'percentdone', showCircle : true, width : 70 },
        {
            type  : 'predecessor',
            width : 112
        },
        {
            type  : 'successor',
            width : 112
        },
        { type : 'schedulingmodecolumn' },
        { type : 'calendar' },
        { type : 'constrainttype' },
        { type : 'constraintdate' },
        { type : 'statuscolumn' },
        { type : 'deadlinedate' },
        { type : 'addnew' }
    ],

    subGridConfigs : {
        locked : {
            flex : 3
        },
        normal : {
            flex : 4
        }
    },

    columnLines : false,

    // Shows a color field in the task editor and a color picker in the task menu.
    // Both lets the user select the Task bar's background color
    showTaskColorPickers : true,

    features : {
        baselines : {
            disabled : true
        },
        dependencies : {
            showLagInTooltip : true,
            // Soften up dependency line corners
            radius           : 3,
            // Make dependencies easier to reach using the mouse
            clickWidth       : 5
        },
        dependencyEdit : true,
        filter         : true,
        labels         : {
            left : {
                field  : 'name',
                editor : {
                    type : 'textfield'
                }
            }
        },
        parentArea : {
            disabled : true
        },
        progressLine : {
            disabled   : true,
            statusDate : new Date(2019, 0, 25)
        },
        rollups : {
            disabled : true
        },
        rowResize : {
            cellSelector : '.b-rownumber-cell'
        },
        rowReorder : {
            showGrip        : true,
            preserveSorters : true
        },
        timeRanges : {
            showCurrentTimeLine : true
        },
        fillHandle    : true,
        cellCopyPaste : true,
        taskCopyPaste : {
            useNativeClipboard : true
        }
    },

    tbar : {
        type : 'gantttoolbar'
    }
});

LocaleManager.applyLocale('De');

Trying adding 2 Tag and it will throw error that field value invalid.

Screen.Recording.2024-02-07.at.8.05.11.PM.mov

Note

Also check for task editor fields such as duration and effort etc.

@ghulamghousdev ghulamghousdev added bug Something isn't working forum Issues from forum large-account Reported by large customer labels Feb 7, 2024
@ghulamghousdev
Copy link
Member Author

reported here as well https://forum.bryntum.com/viewtopic.php?p=142198#p142198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer
Projects
None yet
Development

No branches or pull requests

1 participant