MCPcopy
hub / github.com/webpack/webpack / _showFormButtons

Function _showFormButtons

test/configCases/inner-graph/issue-11678/module.js:2703–2828  ·  view source on GitHub ↗
(manualSetEvent)

Source from the content-addressed store, hash-verified

2701 await _saveForm(false);
2702}
2703function _showFormButtons(manualSetEvent) {
2704 const p = {
2705 create: privileges.getPrivilege(_staticData, privileges.PRIVILEGE.CREATE),
2706 modify: privileges.getPrivilege(_staticData, privileges.PRIVILEGE.MODIFY),
2707 delete: privileges.getPrivilege(_staticData, privileges.PRIVILEGE.DELETE)
2708 };
2709 if (_getModuleName() === ModuleNameEnum.SIHEADER) {
2710 p.create = privileges.getPrivilege(
2711 _staticData,
2712 privileges.PRIVILEGE.SIPOSNEW
2713 );
2714 }
2715 const s = {
2716 canBeCreated: false,
2717 editable: false,
2718 canBeDeleted: false
2719 };
2720 if (manualSetEvent) {
2721 _formEvent = manualSetEvent;
2722 }
2723 s.canBeCreated = _positionSettings.settings[SETTINGS.CREATABLE];
2724 s.canBeDeleted = _positionSettings.settings[SETTINGS.DELETABLE];
2725 if (
2726 _formData &&
2727 _formEvent !== buttons.STATE.new &&
2728 _formEvent !== buttons.STATE.initialize &&
2729 _formEvent !== buttons.STATE.multipleInitialize &&
2730 _formEvent !== buttons.STATE.delete
2731 ) {
2732 s.editable = _formData.settings[SETTINGS.MODIFIABLE];
2733
2734
2735 if (!s.editable) {
2736
2737 console.log(
2738 "entry not editable: set _formEvent from",
2739 _formEvent,
2740 "to",
2741 buttons.STATE.show
2742 );
2743
2744 _formEvent = buttons.STATE.show;
2745 }
2746 }
2747 console.log("_showFormButtons: ", _formEvent);
2748 console.log("privileges", p);
2749 console.log("settings", s);
2750 let toolbar;
2751 if (_isFormInDialog) {
2752 toolbar = new SplitViewMenu.Toolbar("showFormOnly");
2753 } else {
2754 toolbar = new SplitViewMenu.Toolbar("form");
2755 }
2756 switch (_formEvent) {
2757
2758 case buttons.STATE.initialize:
2759 if (p.create && s.canBeCreated) {
2760 toolbar.add(_buttonNewPositions());

Callers 7

onClickTableFunction · 0.85
_removeDetailsFunction · 0.85
_showFormFunction · 0.85
deleteEntryJobFunction · 0.85
onCancelInDialogFunction · 0.85
renderFormInDialogFunction · 0.85

Calls 6

_getModuleNameFunction · 0.85
_buttonNewPositionsFunction · 0.85
_buttonDeleteCiPositionsFunction · 0.85
logMethod · 0.80
addMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected