MCPcopy
hub / github.com/webpack/webpack / getSortDialog

Function getSortDialog

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

Source from the content-addressed store, hash-verified

2084 await dialog.open();
2085}
2086async function getSortDialog() {
2087 let sortOrder = 1;
2088 const NAME = "sortPosition";
2089 const elements = {
2090 radio: new UiElementRadio({
2091 name: "sortOrder",
2092 value: sortOrder,
2093 selectOptions: [
2094 {
2095 id: "1",
2096 name: TC.sortByCategory
2097 },
2098 {
2099 id: "2",
2100 name: TC.sortByGroup
2101 }
2102 ]
2103 })
2104 };
2105 const html = `<div class=${NAME}>
2106 <table class="Q_form formlike">
2107 <tr>
2108 <td>${elements.radio.getHTML()}</td>
2109 </tr>
2110 </table>
2111 </div>`;
2112 if (_parentTableSelection === null) {
2113 throw new Error("No row selected");
2114 }
2115 const dialog = new UiDialog({
2116 autoClose: true,
2117 html,
2118 title: pageTC.confirmation,
2119 onClose(ok) {
2120 if (ok) {
2121 return sendSortCommandToBE(_parentTableSelection, sortOrder);
2122 }
2123 return Promise.resolve(true);
2124 }
2125 });
2126 elements.radio.onChange(element => {
2127 sortOrder = element.getValueAsNumber();
2128 });
2129 elements.radio.bindEvents();
2130 $("." + NAME + " table").attr("style", "width: 100%");
2131 $("." + NAME + " table td").attr("style", "text-align: center");
2132 const isClosed = await dialog.open();
2133 if (isClosed) {
2134 await _updateTableContent();
2135 }
2136}
2137async function sendSortCommandToBE(currentRow, sortOrder) {
2138 const moduleName = _getModuleName();
2139 switch (moduleName) {

Callers 1

onSortPositionFunction · 0.85

Calls 2

$Function · 0.85
_updateTableContentFunction · 0.85

Tested by

no test coverage detected