Skip to content

Commit 3bf88f5

Browse files
Merge branch 'master' into 455-code-splitting
Signed-off-by: Marcel Robitaille <[email protected]>
2 parents c482b21 + 37270f8 commit 3bf88f5

17 files changed

+520
-440
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
- Create build script for GitHub pages with GitHub actions to allow for custom building
55
[#1203](https://github.com/nextcloud/cookbook/pull/1203) @christianlupus
66
- Added a new client and badges to the readme @TheMBeat
7+
- Replace native alert and confirm dialogs with custom ones from nextcloud vue
8+
[#1261](https://github.com/nextcloud/cookbook/pull/1261) @MarcelRobitaille
79

810
### Fixed
911
- Added new public page styling in preparation for NC25

docs/Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ GEM
212212
jekyll-feed (~> 0.9)
213213
jekyll-seo-tag (~> 2.1)
214214
minitest (5.16.3)
215-
nokogiri (1.13.8)
215+
nokogiri (1.13.9)
216216
mini_portile2 (~> 2.8.0)
217217
racc (~> 1.4)
218218
octokit (4.25.1)

package-lock.json

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"vue": "^2.6.11",
4242
"vue-i18n": "^8.17.1",
4343
"vue-material-design-icons": "^5.1.2",
44+
"vue-modal-dialogs": "3.0.0",
4445
"vue-router": "^3.1.6",
4546
"vue-showdown": "^2.4.1",
4647
"vuex": "^3.1.3"

src/components/AppControls/AppControls.vue

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@
153153
</template>
154154

155155
<script>
156-
import helpers from "cookbook/js/helper"
157-
158156
import Actions from "@nextcloud/vue/dist/Components/Actions"
159157
import ActionButton from "@nextcloud/vue/dist/Components/ActionButton"
160158
// Cannot use `Button` else get `vue/no-reserved-component-names` eslint errors
@@ -165,6 +163,12 @@ import LoadingIcon from "icons/Loading.vue"
165163
import CheckmarkIcon from "icons/Check.vue"
166164
import PrinterIcon from "icons/Printer.vue"
167165
166+
import helpers from "cookbook/js/helper"
167+
import {
168+
showSimpleAlertModal,
169+
showSimpleConfirmModal,
170+
} from "cookbook/js/modals"
171+
168172
import Location from "./Location.vue"
169173
import ModeIndicator from "./ModeIndicator.vue"
170174
import ActionInput from "../SimpleActionInput.vue"
@@ -254,29 +258,28 @@ export default {
254258
},
255259
},
256260
methods: {
257-
deleteRecipe() {
261+
async deleteRecipe() {
258262
// Confirm delete
259263
if (
260-
// eslint-disable-next-line no-alert
261-
!window.confirm(
264+
!(await showSimpleConfirmModal(
262265
// prettier-ignore
263-
t("cookbook","Are you sure you want to delete this recipe?")
264-
)
266+
t("cookbook", "Are you sure you want to delete this recipe?")
267+
))
265268
) {
266269
return
267270
}
268-
this.$store
269-
.dispatch("deleteRecipe", { id: this.$store.state.recipe.id })
270-
.then(() => {
271-
helpers.goTo("/")
272-
})
273-
.catch((e) => {
274-
// eslint-disable-next-line no-alert
275-
alert(t("cookbook", "Delete failed"))
276-
if (e && e instanceof Error) {
277-
throw e
278-
}
271+
272+
try {
273+
await this.$store.dispatch("deleteRecipe", {
274+
id: this.$store.state.recipe.id,
279275
})
276+
helpers.goTo("/")
277+
} catch (e) {
278+
await showSimpleAlertModal(t("cookbook", "Delete failed"))
279+
if (e && e instanceof Error) {
280+
throw e
281+
}
282+
}
280283
},
281284
printRecipe() {
282285
window.print()

src/components/AppMain.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
@click="closeNavigation"
1616
/>
1717
</AppContent>
18+
<dialogs-wrapper></dialogs-wrapper>
1819
</Content>
1920
</template>
2021

0 commit comments

Comments
 (0)