diff --git a/app/locales/locale-en.json b/app/locales/locale-en.json index 843160ea..6d74d528 100644 --- a/app/locales/locale-en.json +++ b/app/locales/locale-en.json @@ -1218,7 +1218,11 @@ "HINT1_TITLE": "Did you know you can import and export projects?", "HINT1_TEXT": "This allow you to extract all your data from one Taiga and move it to another one.", "HINT2_TITLE": "Did you know you can create custom fields?", - "HINT2_TEXT": "This will provide teams with a flexible input to fit in their workflow." + "HINT2_TEXT": "Teams can now create custom fields as a flexible means to enter specific data useful for their particular workflow", + "HINT3_TITLE": "Reorder your projects to feature those most relevant to you", + "HINT3_TEXT": "The top 10 project will be in your top bar direct access", + "HINT4_TITLE": "Did you forgot what were you working on?", + "HINT4_TEXT": "Don't worry, on your dashboard you'll find your open tasks issues and user stories in the order you worked on them." }, "TIMELINE": { "UPLOAD_ATTACHMENT": "{{username}} has uploaded a new attachment in {{obj_name}}", diff --git a/app/modules/profile/profile-hints/profile-hints.controller.coffee b/app/modules/profile/profile-hints/profile-hints.controller.coffee index 657656b1..ffd2e4f4 100644 --- a/app/modules/profile/profile-hints/profile-hints.controller.coffee +++ b/app/modules/profile/profile-hints/profile-hints.controller.coffee @@ -1,19 +1,28 @@ class ProfileHints - maxHints: 2 - supportUrls: [ - "https://taiga.io/support/import-export-projects/", - "https://taiga.io/support/custom-fields/" + HINTS: [ + { #hint1 + url: "https://taiga.io/support/import-export-projects/" + }, + { #hint2 + url: "https://taiga.io/support/custom-fields/" + }, + { #hint3 + }, + { #hint4 + } ] constructor: (@translate) -> - hintKey = Math.floor(Math.random() * @.maxHints) + 1 + hintKey = Math.floor(Math.random() * @.HINTS.length) + 1 - @.url = @.supportUrls[hintKey - 1] + @.hint = @.HINTS[hintKey - 1] + + @.hint.linkText = @.hint.linkText || 'HINTS.LINK' @translate("HINTS.HINT#{hintKey}_TITLE").then (text) => - @.title = text + @.hint.title = text @translate("HINTS.HINT#{hintKey}_TEXT").then (text) => - @.text = text + @.hint.text = text ProfileHints.$inject = [ "$translate" diff --git a/app/modules/profile/profile-hints/profile-hints.controller.spec.coffee b/app/modules/profile/profile-hints/profile-hints.controller.spec.coffee index e9428308..f1c3557f 100644 --- a/app/modules/profile/profile-hints/profile-hints.controller.spec.coffee +++ b/app/modules/profile/profile-hints/profile-hints.controller.spec.coffee @@ -24,26 +24,13 @@ describe "ProfileHints", -> $controller = _$controller_ it "random hint generator", (done) -> - - returned = { - then: () -> - } - - mocks.translateService.withArgs("HINTS.HINT1_TITLE").promise().resolve("title_1") - mocks.translateService.withArgs("HINTS.HINT1_TEXT").promise().resolve("text_1") - - mocks.translateService.withArgs("HINTS.HINT2_TITLE").promise().resolve("title_2") - mocks.translateService.withArgs("HINTS.HINT2_TEXT").promise().resolve("text_2") + mocks.translateService.promise().resolve("fill") ctrl = $controller("ProfileHints") setTimeout ( -> - if ctrl.url == "https://taiga.io/support/custom-fields/" - expect(ctrl.title).to.be.equal("title_2") - expect(ctrl.text).to.be.equal("text_2") - done() - else if ctrl.url == "https://taiga.io/support/import-export-projects/" - expect(ctrl.title).to.be.equal("title_1") - expect(ctrl.text).to.be.equal("text_1") + expect(ctrl.hint.title).to.be.equal("fill") + expect(ctrl.hint.text).to.be.equal("fill") + expect(ctrl.hint.linkText).to.have.length.above(1) done() ) diff --git a/app/modules/profile/profile-hints/profile-hints.jade b/app/modules/profile/profile-hints/profile-hints.jade index f5057393..fceb5fd9 100644 --- a/app/modules/profile/profile-hints/profile-hints.jade +++ b/app/modules/profile/profile-hints/profile-hints.jade @@ -2,7 +2,7 @@ h4 span.icon.icon-help span(translate="HINTS.SECTION_NAME") -p {{::vm.title}} -p {{::vm.text}} +p {{::vm.hint.title}} +p {{::vm.hint.text}} |   - a(target="_blank", ng-href="{{::vm.url}}", title="{{'HINTS.LINK_TITLE' | translate}}", translate="HINTS.LINK") + a(ng-if="::vm.hint.url", target="_blank", ng-href="{{::vm.hint.url}}", title="{{'HINTS.LINK_TITLE' | translate}}", translate="{{::vm.hint.linkText}}")