diff --git a/extensions/package-manager/js/dist/admin.js b/extensions/package-manager/js/dist/admin.js index 9882e4612..478eb9c17 100755 --- a/extensions/package-manager/js/dist/admin.js +++ b/extensions/package-manager/js/dist/admin.js @@ -643,28 +643,29 @@ var Updater = /*#__PURE__*/function (_Component) { }; _proto.updateCoreMinor = function updateCoreMinor() { + var _this5 = this; + if (confirm(flarum_admin_app__WEBPACK_IMPORTED_MODULE_1___default.a.translator.trans('flarum-package-manager.admin.minor_update_confirmation.content'))) { flarum_admin_app__WEBPACK_IMPORTED_MODULE_1___default.a.modal.show(flarum_admin_components_LoadingModal__WEBPACK_IMPORTED_MODULE_6___default.a); this.isLoading = 'minor-update'; - /*app - .request({ - method: 'POST', - url: `${app.forum.attribute('apiUrl')}/package-manager/minor-update`, - errorHandler, - }) - .then(() => { - app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.update_successful')); - window.location.reload(); - }) - .finally(() => { - this.isLoading = null; - m.redraw(); - });*/ + flarum_admin_app__WEBPACK_IMPORTED_MODULE_1___default.a.request({ + method: 'POST', + url: flarum_admin_app__WEBPACK_IMPORTED_MODULE_1___default.a.forum.attribute('apiUrl') + "/package-manager/minor-update", + errorHandler: _utils_errorHandler__WEBPACK_IMPORTED_MODULE_8__["default"] + }).then(function () { + flarum_admin_app__WEBPACK_IMPORTED_MODULE_1___default.a.alerts.show({ + type: 'success' + }, flarum_admin_app__WEBPACK_IMPORTED_MODULE_1___default.a.translator.trans('flarum-package-manager.admin.update_successful')); + window.location.reload(); + })["finally"](function () { + _this5.isLoading = null; + m.redraw(); + }); } }; _proto.updateExtension = function updateExtension(extension) { - var _this5 = this; + var _this6 = this; flarum_admin_app__WEBPACK_IMPORTED_MODULE_1___default.a.modal.show(flarum_admin_components_LoadingModal__WEBPACK_IMPORTED_MODULE_6___default.a); this.isLoading = 'extension-update'; @@ -680,13 +681,13 @@ var Updater = /*#__PURE__*/function (_Component) { })); window.location.reload(); })["finally"](function () { - _this5.isLoading = null; + _this6.isLoading = null; m.redraw(); }); }; _proto.updateGlobally = function updateGlobally() { - var _this6 = this; + var _this7 = this; flarum_admin_app__WEBPACK_IMPORTED_MODULE_1___default.a.modal.show(flarum_admin_components_LoadingModal__WEBPACK_IMPORTED_MODULE_6___default.a); this.isLoading = 'global-update'; @@ -700,7 +701,7 @@ var Updater = /*#__PURE__*/function (_Component) { }, flarum_admin_app__WEBPACK_IMPORTED_MODULE_1___default.a.translator.trans('flarum-package-manager.admin.updater.global_update_successful')); window.location.reload(); })["finally"](function () { - _this6.isLoading = null; + _this7.isLoading = null; m.redraw(); }); }; diff --git a/extensions/package-manager/js/dist/admin.js.map b/extensions/package-manager/js/dist/admin.js.map index ac922d289..3eff47418 100755 --- a/extensions/package-manager/js/dist/admin.js.map +++ b/extensions/package-manager/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@flarum/package-manager/webpack/bootstrap","webpack://@flarum/package-manager/./admin.js","webpack://@flarum/package-manager/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/package-manager/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/package-manager/./src/admin/components/ComposerFailureModal.tsx","webpack://@flarum/package-manager/./src/admin/components/Installer.tsx","webpack://@flarum/package-manager/./src/admin/components/MajorUpdater.tsx","webpack://@flarum/package-manager/./src/admin/components/Updater.tsx","webpack://@flarum/package-manager/./src/admin/index.tsx","webpack://@flarum/package-manager/./src/admin/utils/errorHandler.ts","webpack://@flarum/package-manager/external \"flarum.core.compat['admin/app']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['admin/components/LoadingModal']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['admin/utils/isExtensionEnabled']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/Component']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/Alert']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/extend']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/utils/classList']\""],"names":["_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","setPrototypeOf","_setPrototypeOf","o","p","__proto__","ComposerFailureModal","oninit","vnode","attrs","error","guessed_cause","alertAttrs","type","content","app","translator","trans","className","title","output","Modal","Installer","packageName","isLoading","Stream","view","extiverse","onsubmit","bind","data","modal","show","LoadingModal","request","method","url","forum","attribute","body","errorHandler","then","response","extensionId","id","alerts","extension","window","location","href","reload","m","redraw","Component","MajorUpdater","version","coreUpdate","update","dryRun","Updater","lastUpdateCheck","packageUpdates","extensions","getExtensionUpdates","getCoreUpdate","core","settings","icon","backgroundImage","extra","keys","length","humanTime","checkedAt","checkForUpdates","updateGlobally","extensionItem","map","isCore","classList","name","updateCoreMinor","updateExtension","v","replace","updates","installed","filter","composerPackage","safeToUpdate","includes","values","pop","confirm","initializers","add","extensionData","registerSetting","isRequiredDirectoriesWritable","extend","ExtensionPage","items","isExtensionEnabled","close","e","errors","code"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QA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;;;;;ACAA,iE;;;;;;;;;;;ACAA,qD;;;;;;;;;;;ACAA,gE;;;;;;;;;;;ACAA,2D;;;;;;;;;;;ACAA,2D;;;;;;;;;;;ACAA,8D","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./admin.js\");\n","export * from './src/admin';","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport { ComponentAttrs } from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport Mithril from 'mithril';\n\ninterface Attrs extends ComponentAttrs {\n output: string;\n}\n\nexport default class ComposerFailureModal extends Modal {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (this.attrs.error.guessed_cause) {\n this.alertAttrs = {\n type: 'error',\n content: app.translator.trans(`flarum-package-manager.admin.failure_modal.guessed_cause.${this.attrs.error.guessed_cause}`),\n };\n }\n }\n\n className() {\n return 'Modal--large ComposerFailureModal';\n }\n\n title() {\n return app.translator.trans('flarum-package-manager.admin.failure_modal.title');\n }\n\n content() {\n return (\n
\n
\n {app.translator.trans('flarum-package-manager.admin.failure_modal.show_composer_output')}\n
{this.attrs.error.output}
\n
\n
\n );\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport ComposerFailureModal from './ComposerFailureModal';\nimport errorHandler from '../utils/errorHandler';\n\nexport default class Installer extends Component {\n packageName!: Stream;\n isLoading: boolean = false;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.packageName = Stream('');\n }\n\n view(): Mithril.Children {\n return (\n
\n \n

\n {app.translator.trans('flarum-package-manager.admin.extensions.install_help', {\n extiverse: extiverse.com,\n })}\n

\n
\n \n \n
\n
\n );\n }\n\n data(): any {\n return {\n package: this.packageName(),\n };\n }\n\n onsubmit(): void {\n this.isLoading = true;\n app.modal.show(LoadingModal);\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions`,\n body: {\n data: this.data(),\n },\n errorHandler,\n })\n .then((response) => {\n const extensionId = response.id;\n app.alerts.show(\n { type: 'success' },\n app.translator.trans('flarum-package-manager.admin.extensions.successful_install', { extension: extensionId })\n );\n window.location.href = `${app.forum.attribute('adminUrl')}#/extension/${extensionId}`;\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = false;\n m.redraw();\n });\n }\n}\n","import app from 'flarum/admin/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Mithril from 'mithril';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { UpdatedPackage } from './Updater';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport errorHandler from '../utils/errorHandler';\n\ninterface MajorUpdaterAttrs extends ComponentAttrs {\n coreUpdate: UpdatedPackage;\n}\n\nexport default class MajorUpdater extends Component {\n isLoading: string | null = null;\n\n view(vnode: Mithril.Vnode): Mithril.Children {\n return (\n
\n \"flarum\n \n

{app.translator.trans('flarum-package-manager.admin.major_updater.description')}

\n
\n \n \n \n \n
\n
\n );\n }\n\n update(dryRun: boolean) {\n this.isLoading = `update-${dryRun ? 'dry-run' : 'run'}`;\n app.modal.show(LoadingModal);\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/major-update`,\n body: {\n data: { dryRun },\n },\n errorHandler,\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.update_successful'));\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n}\n","import Mithril from \"mithril\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Button from 'flarum/common/components/Button';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport errorHandler from '../utils/errorHandler';\nimport classList from 'flarum/common/utils/classList';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport MajorUpdater from './MajorUpdater';\nimport {Extension} from \"flarum/admin/AdminApplication\";\nimport MinorUpdateWarningModal from \"./MinorUpdateWarningModal\";\n\nexport type UpdatedPackage = {\n name: string;\n version: string;\n latest: string;\n 'latest-minor': string | null;\n 'latest-major': string | null;\n 'latest-status': string;\n description: string;\n};\n\nexport type ComposerUpdates = {\n installed: UpdatedPackage[];\n};\n\nexport type LastUpdateCheck = {\n checkedAt: Date;\n updates: ComposerUpdates;\n};\n\nexport default class Updater extends Component {\n isLoading: string | null = null;\n lastUpdateCheck: LastUpdateCheck = (app.data.lastUpdateCheck as LastUpdateCheck) || {};\n packageUpdates: Record = {};\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n view() {\n const extensions: any = this.getExtensionUpdates();\n const coreUpdate: UpdatedPackage | undefined = this.getCoreUpdate();\n let core: any = null;\n\n if (coreUpdate) {\n core = {\n id: \"flarum-core\",\n version: app.data.settings.version,\n icon: {\n backgroundImage: `url(${app.forum.attribute('baseUrl')}/assets/extensions/flarum-package-manager/flarum.svg`,\n },\n extra: {\n 'flarum-extension': {\n title: app.translator.trans('flarum-package-manager.admin.updater.flarum'),\n }\n }\n };\n\n this.packageUpdates['flarum-core'] = coreUpdate;\n }\n\n return [\n
\n \n

{app.translator.trans('flarum-package-manager.admin.updater.updater_help')}

\n {Object.keys(this.lastUpdateCheck).length ? (\n

\n \n {app.translator.trans('flarum-package-manager.admin.updater.last_update_checked_at')}\n \n {humanTime(this.lastUpdateCheck?.checkedAt)}\n

\n ) : null}\n
\n \n {app.translator.trans('flarum-package-manager.admin.updater.check_for_updates')}\n \n \n {app.translator.trans('flarum-package-manager.admin.updater.run_global_update')}\n \n
\n {this.isLoading !== null ? (\n
\n \n
\n ) : extensions.length || core ? (\n
\n
\n {core ? this.extensionItem(core, true) : null}\n {extensions.map((extension: any) => this.extensionItem(extension))}\n
\n
\n ) : null}\n
,\n coreUpdate && coreUpdate['latest-major'] ? : null,\n ];\n }\n\n extensionItem(extension: Extension, isCore: boolean = false) {\n return (\n \n
\n {extension.icon ? icon(extension.icon.name) : ''}\n
\n
\n
{extension.extra['flarum-extension'].title}
\n
\n {this.version(extension.version)}\n {this.packageUpdates[extension.id]['latest-minor'] ? (\n \n {this.version(this.packageUpdates[extension.id]['latest-minor']!)}\n \n ) : null}\n {this.packageUpdates[extension.id]['latest-major'] && !isCore ? (\n \n {this.version(this.packageUpdates[extension.id]['latest-major']!)}\n \n ) : null}\n
\n
\n
\n \n \n \n
\n \n );\n }\n\n version(v: string) {\n return 'v' + v.replace('v', '');\n }\n\n getExtensionUpdates() {\n this.lastUpdateCheck?.updates?.installed?.filter((composerPackage: UpdatedPackage) => {\n const extension = app.data.extensions[composerPackage.name.replace('/', '-').replace(/(flarum-ext-)|(flarum-)/, '')];\n const safeToUpdate = ['semver-safe-update', 'update-possible'].includes(composerPackage['latest-status']);\n\n if (extension && safeToUpdate) {\n this.packageUpdates[extension.id] = composerPackage;\n }\n\n return extension && safeToUpdate;\n });\n\n return Object.values(app.data.extensions).filter((extension: any) => this.packageUpdates[extension.id]);\n }\n\n getCoreUpdate(): UpdatedPackage | undefined {\n return this.lastUpdateCheck?.updates?.installed?.filter((composerPackage: UpdatedPackage) => composerPackage.name === 'flarum/core').pop();\n }\n\n checkForUpdates() {\n this.isLoading = 'check';\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/check-for-updates`,\n errorHandler,\n })\n .then((response) => {\n this.lastUpdateCheck = response as LastUpdateCheck;\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n\n updateCoreMinor() {\n if (confirm(app.translator.trans('flarum-package-manager.admin.minor_update_confirmation.content'))) {\n app.modal.show(LoadingModal);\n this.isLoading = 'minor-update';\n\n /*app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/minor-update`,\n errorHandler,\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.update_successful'));\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });*/\n }\n }\n\n updateExtension(extension: any) {\n app.modal.show(LoadingModal);\n this.isLoading = 'extension-update';\n\n app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions/${extension.id}`,\n errorHandler,\n })\n .then(() => {\n app.alerts.show(\n { type: 'success' },\n app.translator.trans('flarum-package-manager.admin.extensions.successful_update', { extension: extension.extra['flarum-extension'].title })\n );\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n\n updateGlobally() {\n app.modal.show(LoadingModal);\n this.isLoading = 'global-update';\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/global-update`,\n errorHandler,\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.updater.global_update_successful'));\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\nimport Alert from 'flarum/common/components/Alert';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport Installer from './components/Installer';\nimport Updater from './components/Updater';\nimport isExtensionEnabled from 'flarum/admin/utils/isExtensionEnabled';\n\napp.initializers.add('flarum-package-manager', (app) => {\n app.extensionData\n .for('flarum-package-manager')\n .registerSetting(() => {\n if (!app.data.isRequiredDirectoriesWritable) {\n return (\n
\n \n {app.translator.trans('flarum-package-manager.admin.file_permissions')}\n \n
\n );\n }\n\n return null;\n })\n .registerSetting(() => {\n if (app.data.isRequiredDirectoriesWritable) {\n return ;\n }\n\n return null;\n })\n .registerSetting(() => {\n if (app.data.isRequiredDirectoriesWritable) {\n return ;\n }\n\n return null;\n });\n\n extend(ExtensionPage.prototype, 'topItems', function (items) {\n if (this.extension.id === 'flarum-package-manager' || isExtensionEnabled(this.extension.id)) {\n return;\n }\n\n items.add(\n 'remove',\n {\n app.modal.show(LoadingModal);\n\n app\n .request({\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions/${this.extension.id}`,\n method: 'DELETE',\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.extensions.successful_remove'));\n window.location = app.forum.attribute('adminUrl');\n })\n .finally(() => {\n app.modal.close();\n });\n }}\n >\n Remove\n \n );\n });\n});\n","import app from 'flarum/admin/app';\nimport ComposerFailureModal from '../components/ComposerFailureModal';\n\nexport default function (e: any) {\n const error = e.response.errors[0];\n\n if (!['composer_command_failure', 'extension_already_installed', 'extension_not_installed'].includes(error.code)) {\n throw e;\n }\n\n switch (error.code) {\n case 'composer_command_failure':\n app.modal.show(ComposerFailureModal, { error });\n break;\n\n case 'extension_already_installed':\n app.alerts.show({ type: 'error' }, app.translator.trans('flarum-package-manager.admin.exceptions.extension_already_installed'));\n app.modal.close();\n break;\n\n case 'extension_not_installed':\n app.alerts.show({ type: 'error' }, app.translator.trans('flarum-package-manager.admin.exceptions.extension_not_installed'));\n app.modal.close();\n }\n}\n","module.exports = flarum.core.compat['admin/app'];","module.exports = flarum.core.compat['admin/components/ExtensionPage'];","module.exports = flarum.core.compat['admin/components/LoadingModal'];","module.exports = flarum.core.compat['admin/utils/isExtensionEnabled'];","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['common/components/Alert'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['common/components/LoadingIndicator'];","module.exports = flarum.core.compat['common/components/Modal'];","module.exports = flarum.core.compat['common/components/Tooltip'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/helpers/humanTime'];","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['common/utils/Stream'];","module.exports = flarum.core.compat['common/utils/classList'];"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/package-manager/webpack/bootstrap","webpack://@flarum/package-manager/./admin.js","webpack://@flarum/package-manager/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/package-manager/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/package-manager/./src/admin/components/ComposerFailureModal.tsx","webpack://@flarum/package-manager/./src/admin/components/Installer.tsx","webpack://@flarum/package-manager/./src/admin/components/MajorUpdater.tsx","webpack://@flarum/package-manager/./src/admin/components/Updater.tsx","webpack://@flarum/package-manager/./src/admin/index.tsx","webpack://@flarum/package-manager/./src/admin/utils/errorHandler.ts","webpack://@flarum/package-manager/external \"flarum.core.compat['admin/app']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['admin/components/LoadingModal']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['admin/utils/isExtensionEnabled']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/Component']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/Alert']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/extend']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/package-manager/external \"flarum.core.compat['common/utils/classList']\""],"names":["_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","setPrototypeOf","_setPrototypeOf","o","p","__proto__","ComposerFailureModal","oninit","vnode","attrs","error","guessed_cause","alertAttrs","type","content","app","translator","trans","className","title","output","Modal","Installer","packageName","isLoading","Stream","view","extiverse","onsubmit","bind","data","modal","show","LoadingModal","request","method","url","forum","attribute","body","errorHandler","then","response","extensionId","id","alerts","extension","window","location","href","reload","m","redraw","Component","MajorUpdater","version","coreUpdate","update","dryRun","Updater","lastUpdateCheck","packageUpdates","extensions","getExtensionUpdates","getCoreUpdate","core","settings","icon","backgroundImage","extra","keys","length","humanTime","checkedAt","checkForUpdates","updateGlobally","extensionItem","map","isCore","classList","name","updateCoreMinor","updateExtension","v","replace","updates","installed","filter","composerPackage","safeToUpdate","includes","values","pop","confirm","initializers","add","extensionData","registerSetting","isRequiredDirectoriesWritable","extend","ExtensionPage","items","isExtensionEnabled","close","e","errors","code"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;Q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J,CAAWb,IAAX,CAAgB;AAAEnB,YAAI,EAAE;AAAR,OAAhB,EAAmCE,uDAAG,CAACC,UAAJ,CAAeC,KAAf,CAAqB,qEAArB,CAAnC;AACAF,6DAAG,CAACgB,KAAJ,CAAUwE,KAAV;AACA;;AAEF,SAAK,yBAAL;AACExF,6DAAG,CAAC8B,MAAJ,CAAWb,IAAX,CAAgB;AAAEnB,YAAI,EAAE;AAAR,OAAhB,EAAmCE,uDAAG,CAACC,UAAJ,CAAeC,KAAf,CAAqB,iEAArB,CAAnC;AACAF,6DAAG,CAACgB,KAAJ,CAAUwE,KAAV;AAZJ;AAcD,C;;;;;;;;;;;ACxBD,iD;;;;;;;;;;;ACAA,sE;;;;;;;;;;;ACAA,qE;;;;;;;;;;;ACAA,sE;;;;;;;;;;;ACAA,wD;;;;;;;;;;;ACAA,+D;;;;;;;;;;;ACAA,gE;;;;;;;;;;;ACAA,0E;;;;;;;;;;;ACAA,+D;;;;;;;;;;;ACAA,iE;;;;;;;;;;;ACAA,qD;;;;;;;;;;;ACAA,gE;;;;;;;;;;;ACAA,2D;;;;;;;;;;;ACAA,2D;;;;;;;;;;;ACAA,8D","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./admin.js\");\n","export * from './src/admin';","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport { ComponentAttrs } from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport Mithril from 'mithril';\n\ninterface Attrs extends ComponentAttrs {\n output: string;\n}\n\nexport default class ComposerFailureModal extends Modal {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (this.attrs.error.guessed_cause) {\n this.alertAttrs = {\n type: 'error',\n content: app.translator.trans(`flarum-package-manager.admin.failure_modal.guessed_cause.${this.attrs.error.guessed_cause}`),\n };\n }\n }\n\n className() {\n return 'Modal--large ComposerFailureModal';\n }\n\n title() {\n return app.translator.trans('flarum-package-manager.admin.failure_modal.title');\n }\n\n content() {\n return (\n
\n
\n {app.translator.trans('flarum-package-manager.admin.failure_modal.show_composer_output')}\n
{this.attrs.error.output}
\n
\n
\n );\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport ComposerFailureModal from './ComposerFailureModal';\nimport errorHandler from '../utils/errorHandler';\n\nexport default class Installer extends Component {\n packageName!: Stream;\n isLoading: boolean = false;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.packageName = Stream('');\n }\n\n view(): Mithril.Children {\n return (\n
\n \n

\n {app.translator.trans('flarum-package-manager.admin.extensions.install_help', {\n extiverse: extiverse.com,\n })}\n

\n
\n \n \n
\n
\n );\n }\n\n data(): any {\n return {\n package: this.packageName(),\n };\n }\n\n onsubmit(): void {\n this.isLoading = true;\n app.modal.show(LoadingModal);\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions`,\n body: {\n data: this.data(),\n },\n errorHandler,\n })\n .then((response) => {\n const extensionId = response.id;\n app.alerts.show(\n { type: 'success' },\n app.translator.trans('flarum-package-manager.admin.extensions.successful_install', { extension: extensionId })\n );\n window.location.href = `${app.forum.attribute('adminUrl')}#/extension/${extensionId}`;\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = false;\n m.redraw();\n });\n }\n}\n","import app from 'flarum/admin/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Mithril from 'mithril';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport { UpdatedPackage } from './Updater';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport errorHandler from '../utils/errorHandler';\n\ninterface MajorUpdaterAttrs extends ComponentAttrs {\n coreUpdate: UpdatedPackage;\n}\n\nexport default class MajorUpdater extends Component {\n isLoading: string | null = null;\n\n view(vnode: Mithril.Vnode): Mithril.Children {\n return (\n
\n \"flarum\n \n

{app.translator.trans('flarum-package-manager.admin.major_updater.description')}

\n
\n \n \n \n \n
\n
\n );\n }\n\n update(dryRun: boolean) {\n this.isLoading = `update-${dryRun ? 'dry-run' : 'run'}`;\n app.modal.show(LoadingModal);\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/major-update`,\n body: {\n data: { dryRun },\n },\n errorHandler,\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.update_successful'));\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n}\n","import Mithril from \"mithril\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Button from 'flarum/common/components/Button';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport errorHandler from '../utils/errorHandler';\nimport classList from 'flarum/common/utils/classList';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport MajorUpdater from './MajorUpdater';\nimport {Extension} from \"flarum/admin/AdminApplication\";\n\nexport type UpdatedPackage = {\n name: string;\n version: string;\n latest: string;\n 'latest-minor': string | null;\n 'latest-major': string | null;\n 'latest-status': string;\n description: string;\n};\n\nexport type ComposerUpdates = {\n installed: UpdatedPackage[];\n};\n\nexport type LastUpdateCheck = {\n checkedAt: Date;\n updates: ComposerUpdates;\n};\n\nexport default class Updater extends Component {\n isLoading: string | null = null;\n lastUpdateCheck: LastUpdateCheck = (app.data.lastUpdateCheck as LastUpdateCheck) || {};\n packageUpdates: Record = {};\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n view() {\n const extensions: any = this.getExtensionUpdates();\n const coreUpdate: UpdatedPackage | undefined = this.getCoreUpdate();\n let core: any = null;\n\n if (coreUpdate) {\n core = {\n id: \"flarum-core\",\n version: app.data.settings.version,\n icon: {\n backgroundImage: `url(${app.forum.attribute('baseUrl')}/assets/extensions/flarum-package-manager/flarum.svg`,\n },\n extra: {\n 'flarum-extension': {\n title: app.translator.trans('flarum-package-manager.admin.updater.flarum'),\n }\n }\n };\n\n this.packageUpdates['flarum-core'] = coreUpdate;\n }\n\n return [\n
\n \n

{app.translator.trans('flarum-package-manager.admin.updater.updater_help')}

\n {Object.keys(this.lastUpdateCheck).length ? (\n

\n \n {app.translator.trans('flarum-package-manager.admin.updater.last_update_checked_at')}\n \n {humanTime(this.lastUpdateCheck?.checkedAt)}\n

\n ) : null}\n
\n \n {app.translator.trans('flarum-package-manager.admin.updater.check_for_updates')}\n \n \n {app.translator.trans('flarum-package-manager.admin.updater.run_global_update')}\n \n
\n {this.isLoading !== null ? (\n
\n \n
\n ) : extensions.length || core ? (\n
\n
\n {core ? this.extensionItem(core, true) : null}\n {extensions.map((extension: any) => this.extensionItem(extension))}\n
\n
\n ) : null}\n
,\n coreUpdate && coreUpdate['latest-major'] ? : null,\n ];\n }\n\n extensionItem(extension: Extension, isCore: boolean = false) {\n return (\n \n
\n {extension.icon ? icon(extension.icon.name) : ''}\n
\n
\n
{extension.extra['flarum-extension'].title}
\n
\n {this.version(extension.version)}\n {this.packageUpdates[extension.id]['latest-minor'] ? (\n \n {this.version(this.packageUpdates[extension.id]['latest-minor']!)}\n \n ) : null}\n {this.packageUpdates[extension.id]['latest-major'] && !isCore ? (\n \n {this.version(this.packageUpdates[extension.id]['latest-major']!)}\n \n ) : null}\n
\n
\n
\n \n \n \n
\n \n );\n }\n\n version(v: string) {\n return 'v' + v.replace('v', '');\n }\n\n getExtensionUpdates() {\n this.lastUpdateCheck?.updates?.installed?.filter((composerPackage: UpdatedPackage) => {\n const extension = app.data.extensions[composerPackage.name.replace('/', '-').replace(/(flarum-ext-)|(flarum-)/, '')];\n const safeToUpdate = ['semver-safe-update', 'update-possible'].includes(composerPackage['latest-status']);\n\n if (extension && safeToUpdate) {\n this.packageUpdates[extension.id] = composerPackage;\n }\n\n return extension && safeToUpdate;\n });\n\n return Object.values(app.data.extensions).filter((extension: any) => this.packageUpdates[extension.id]);\n }\n\n getCoreUpdate(): UpdatedPackage | undefined {\n return this.lastUpdateCheck?.updates?.installed?.filter((composerPackage: UpdatedPackage) => composerPackage.name === 'flarum/core').pop();\n }\n\n checkForUpdates() {\n this.isLoading = 'check';\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/check-for-updates`,\n errorHandler,\n })\n .then((response) => {\n this.lastUpdateCheck = response as LastUpdateCheck;\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n\n updateCoreMinor() {\n if (confirm(app.translator.trans('flarum-package-manager.admin.minor_update_confirmation.content'))) {\n app.modal.show(LoadingModal);\n this.isLoading = 'minor-update';\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/minor-update`,\n errorHandler,\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.update_successful'));\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n }\n\n updateExtension(extension: any) {\n app.modal.show(LoadingModal);\n this.isLoading = 'extension-update';\n\n app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions/${extension.id}`,\n errorHandler,\n })\n .then(() => {\n app.alerts.show(\n { type: 'success' },\n app.translator.trans('flarum-package-manager.admin.extensions.successful_update', { extension: extension.extra['flarum-extension'].title })\n );\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n\n updateGlobally() {\n app.modal.show(LoadingModal);\n this.isLoading = 'global-update';\n\n app\n .request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/global-update`,\n errorHandler,\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.updater.global_update_successful'));\n window.location.reload();\n })\n .finally(() => {\n this.isLoading = null;\n m.redraw();\n });\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\nimport Alert from 'flarum/common/components/Alert';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport Installer from './components/Installer';\nimport Updater from './components/Updater';\nimport isExtensionEnabled from 'flarum/admin/utils/isExtensionEnabled';\n\napp.initializers.add('flarum-package-manager', (app) => {\n app.extensionData\n .for('flarum-package-manager')\n .registerSetting(() => {\n if (!app.data.isRequiredDirectoriesWritable) {\n return (\n
\n \n {app.translator.trans('flarum-package-manager.admin.file_permissions')}\n \n
\n );\n }\n\n return null;\n })\n .registerSetting(() => {\n if (app.data.isRequiredDirectoriesWritable) {\n return ;\n }\n\n return null;\n })\n .registerSetting(() => {\n if (app.data.isRequiredDirectoriesWritable) {\n return ;\n }\n\n return null;\n });\n\n extend(ExtensionPage.prototype, 'topItems', function (items) {\n if (this.extension.id === 'flarum-package-manager' || isExtensionEnabled(this.extension.id)) {\n return;\n }\n\n items.add(\n 'remove',\n {\n app.modal.show(LoadingModal);\n\n app\n .request({\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions/${this.extension.id}`,\n method: 'DELETE',\n })\n .then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('flarum-package-manager.admin.extensions.successful_remove'));\n window.location = app.forum.attribute('adminUrl');\n })\n .finally(() => {\n app.modal.close();\n });\n }}\n >\n Remove\n \n );\n });\n});\n","import app from 'flarum/admin/app';\nimport ComposerFailureModal from '../components/ComposerFailureModal';\n\nexport default function (e: any) {\n const error = e.response.errors[0];\n\n if (!['composer_command_failure', 'extension_already_installed', 'extension_not_installed'].includes(error.code)) {\n throw e;\n }\n\n switch (error.code) {\n case 'composer_command_failure':\n app.modal.show(ComposerFailureModal, { error });\n break;\n\n case 'extension_already_installed':\n app.alerts.show({ type: 'error' }, app.translator.trans('flarum-package-manager.admin.exceptions.extension_already_installed'));\n app.modal.close();\n break;\n\n case 'extension_not_installed':\n app.alerts.show({ type: 'error' }, app.translator.trans('flarum-package-manager.admin.exceptions.extension_not_installed'));\n app.modal.close();\n }\n}\n","module.exports = flarum.core.compat['admin/app'];","module.exports = flarum.core.compat['admin/components/ExtensionPage'];","module.exports = flarum.core.compat['admin/components/LoadingModal'];","module.exports = flarum.core.compat['admin/utils/isExtensionEnabled'];","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['common/components/Alert'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['common/components/LoadingIndicator'];","module.exports = flarum.core.compat['common/components/Modal'];","module.exports = flarum.core.compat['common/components/Tooltip'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/helpers/humanTime'];","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['common/utils/Stream'];","module.exports = flarum.core.compat['common/utils/classList'];"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/package-manager/js/src/admin/components/Updater.tsx b/extensions/package-manager/js/src/admin/components/Updater.tsx index 9dfb6db61..0dbca8351 100755 --- a/extensions/package-manager/js/src/admin/components/Updater.tsx +++ b/extensions/package-manager/js/src/admin/components/Updater.tsx @@ -198,7 +198,7 @@ export default class Updater extends Component { app.modal.show(LoadingModal); this.isLoading = 'minor-update'; - /*app + app .request({ method: 'POST', url: `${app.forum.attribute('apiUrl')}/package-manager/minor-update`, @@ -211,7 +211,7 @@ export default class Updater extends Component { .finally(() => { this.isLoading = null; m.redraw(); - });*/ + }); } } diff --git a/extensions/package-manager/less/admin.less b/extensions/package-manager/less/admin.less index d2f660bbf..2f4fc32af 100755 --- a/extensions/package-manager/less/admin.less +++ b/extensions/package-manager/less/admin.less @@ -119,12 +119,3 @@ grid-area: helpText; } } - -.MinorUpdateWarningModal { - .Modal-footer { - display: flex; - align-items: center; - justify-content: center; - gap: 4px; - } -}