diff --git a/frappe/public/build.json b/frappe/public/build.json
index 9756cf7628..15dc9e313b 100755
--- a/frappe/public/build.json
+++ b/frappe/public/build.json
@@ -88,9 +88,7 @@
"public/js/frappe/form/controls/read_only.js",
"public/js/frappe/form/controls/button.js",
"public/js/frappe/form/controls/html.js",
- "public/js/frappe/form/controls/heading.js",
- "public/js/frappe/form/user_progress_dialog.js",
- "public/js/frappe/form/user_progress_slide.html"
+ "public/js/frappe/form/controls/heading.js"
],
"css/desk.min.css": [
"public/js/lib/datepicker/datepicker.min.css",
diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css
index baf9449f12..2049e0a170 100644
--- a/frappe/public/css/desk.css
+++ b/frappe/public/css/desk.css
@@ -1126,3 +1126,42 @@ input[type="checkbox"]:checked:before {
color: #fff;
border-color: #b1bdca;
}
+.cards-container .card-container {
+ background-color: #fff;
+ margin: 10px 7px;
+ border: 1px solid #e5e5e5;
+ border-radius: 3px;
+ display: flex;
+}
+.cards-container .card-container.done {
+ background-color: #fafbfc;
+}
+.cards-container .card-container.done .title {
+ color: #8D99A6;
+}
+.cards-container .card-container.single_action {
+ cursor: pointer;
+}
+.cards-container .title {
+ margin-top: 0px;
+}
+.cards-container .content {
+ font-size: 12px;
+}
+.cards-container img {
+ width: 195px;
+}
+.cards-container img.clip {
+ margin: -15px 0px;
+ clip-path: inset(15px 0px 15px 0px);
+}
+.cards-container .content-container {
+ padding: 10px;
+ width: 516px;
+}
+.cards-container .actions {
+ margin-top: 15px;
+}
+.cards-container .actions button:not(:first-child) {
+ margin-left: 15px;
+}
diff --git a/frappe/public/js/frappe/misc/help.js b/frappe/public/js/frappe/misc/help.js
index f67628142b..754bc25185 100644
--- a/frappe/public/js/frappe/misc/help.js
+++ b/frappe/public/js/frappe/misc/help.js
@@ -24,7 +24,7 @@ frappe.help.show_video = function(youtube_id, title) {
var dialog = frappe.msgprint('' + (frappe.help_feedback_link || ""),
- title || __("Help"));
+ title || __("Help"));
dialog.$wrapper.find(".modal-content").addClass("video-modal");
}
diff --git a/frappe/public/js/frappe/ui/slides.js b/frappe/public/js/frappe/ui/slides.js
index 20c9468c99..a14702c111 100644
--- a/frappe/public/js/frappe/ui/slides.js
+++ b/frappe/public/js/frappe/ui/slides.js
@@ -35,7 +35,7 @@ frappe.ui.Slide = class Slide {
this.$form = this.$body.find(".form");
this.$primary_btn = this.slides_footer.find('.btn-primary').addClass('primary');
- if(this.help) this.$content.append($(`
-
-
-
${__("Completed!")}
-
-
`).appendTo(this.$body);
+
+ this.$actions = this.$done_state.find('.actions');
+ this.action_cards.map(this.add_card.bind(this));
}
- bind_done_state() {
- if(this.doctype) {
- this.$body.find('.doctype-actions').removeClass("hide");
- this.$list = this.$body.find('.list-btn')
- .html("Go to " + this.name)
- .on('click', () => {
- frappe.set_route("List", this.doctype);
- });
- if(this.sec_doctype) {
- this.$sec_list = this.$body.find('.sec-list-btn')
- .removeClass("hide")
- .html("Go to " + this.sec_doctype + "s")
- .on('click', () => {
- frappe.set_route("List", this.sec_doctype);
- });
- }
- this.$import = this.$body.find('.import-btn')
- .html("Import " + this.name)
- .on('click', () => {
- frappe.set_route("data-import-tool");
- });
- } else if (this.route) {
- this.$body.find('.doc-actions').removeClass("hide");
- this.$doc = this.$body.find('.doc-btn').on('click', () => {
- frappe.set_route(this.route);
- });
- }
+ add_card(data) {
+ let card = new frappe.ui.ActionCard({
+ data: data
+ });
+
+ card.container.appendTo(this.$actions);
}
before_show() {
@@ -97,6 +176,10 @@ frappe.setup.UserProgressSlide = class UserProgressSlide extends frappe.ui.Slide
});
}
}
+
+ mark_as_done() {
+ // most hard
+ }
};
frappe.setup.UserProgressDialog = class UserProgressDialog {
@@ -104,6 +187,11 @@ frappe.setup.UserProgressDialog = class UserProgressDialog {
slides = []
}) {
this.slides = slides;
+ // Add a progress bar
+ // show the last visited slide
+ // Add a mark as done button
+ // this.progress_state_dict = this.slides.map();
+
this.setup();
}
@@ -130,6 +218,18 @@ frappe.setup.UserProgressDialog = class UserProgressDialog {
this.make_dismiss_button();
}
+ listen_for_updates() {
+ // on every notif 30 sec event
+ this.update_progress_state();
+ }
+
+ update_progress_state() {
+ // update states of slides and cards and refresh them
+ // Update the progress bar in both the toolbar and the dialog
+
+ // remove on_update from original slides container
+ }
+
make_dismiss_button() {
this.dialog.set_primary_action(__('Dismiss'), () => {
$('.user-progress').addClass('hide');
@@ -140,11 +240,11 @@ frappe.setup.UserProgressDialog = class UserProgressDialog {
this.$dismiss_button.addClass('hide');
$(document).on("user-initial-setup-complete", () => {
- this.show_dismiss_button();
+ this.add_finish_slide_and_make_dismissable();
});
}
- show_dismiss_button() {
+ add_finish_slide_and_make_dismissable() {
this.$dismiss_button.removeClass('hide');
}
diff --git a/frappe/public/less/desk.less b/frappe/public/less/desk.less
index b829110422..1ed397a3bf 100644
--- a/frappe/public/less/desk.less
+++ b/frappe/public/less/desk.less
@@ -1074,3 +1074,65 @@ input[type="checkbox"] {
}
}
}
+
+// Action Cards
+.cards-container {
+ .card-container {
+ background-color: #fff;
+ margin: 10px 7px;
+ border: 1px solid #e5e5e5;
+ border-radius: 3px;
+ display: flex;
+
+ &.done {
+ background-color: #fafbfc;
+
+ .title {
+ color: #8D99A6;
+ }
+ }
+
+ &.single_action {
+ cursor: pointer;
+
+ // .title {
+ // color: blue;
+ // }
+
+ // emphasize image overlay
+ }
+ }
+
+ .title {
+ margin-top: 0px;
+ }
+
+ .content {
+ font-size: 12px;
+ }
+ // .img-container {
+
+ // }
+
+ img {
+ width: 195px;
+
+ &.clip {
+ margin: -15px 0px;
+ clip-path: inset(15px 0px 15px 0px);
+ }
+ }
+
+ .content-container {
+ padding: 10px;
+ width: 516px;
+ }
+
+ .actions {
+ margin-top: 15px;
+
+ button:not(:first-child) {
+ margin-left: 15px;
+ }
+ }
+}