Merge pull request #510 from taigaio/issue/2837/update-hints

Update hint texts
stable
Alejandro 2015-06-14 23:35:29 -07:00
commit cc7cb9dc79
4 changed files with 29 additions and 29 deletions

View File

@ -1218,7 +1218,11 @@
"HINT1_TITLE": "Did you know you can import and export projects?", "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.", "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_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": { "TIMELINE": {
"UPLOAD_ATTACHMENT": "{{username}} has uploaded a new attachment in {{obj_name}}", "UPLOAD_ATTACHMENT": "{{username}} has uploaded a new attachment in {{obj_name}}",

View File

@ -1,19 +1,28 @@
class ProfileHints class ProfileHints
maxHints: 2 HINTS: [
supportUrls: [ { #hint1
"https://taiga.io/support/import-export-projects/", url: "https://taiga.io/support/import-export-projects/"
"https://taiga.io/support/custom-fields/" },
{ #hint2
url: "https://taiga.io/support/custom-fields/"
},
{ #hint3
},
{ #hint4
}
] ]
constructor: (@translate) -> 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) => @translate("HINTS.HINT#{hintKey}_TITLE").then (text) =>
@.title = text @.hint.title = text
@translate("HINTS.HINT#{hintKey}_TEXT").then (text) => @translate("HINTS.HINT#{hintKey}_TEXT").then (text) =>
@.text = text @.hint.text = text
ProfileHints.$inject = [ ProfileHints.$inject = [
"$translate" "$translate"

View File

@ -24,26 +24,13 @@ describe "ProfileHints", ->
$controller = _$controller_ $controller = _$controller_
it "random hint generator", (done) -> it "random hint generator", (done) ->
mocks.translateService.promise().resolve("fill")
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")
ctrl = $controller("ProfileHints") ctrl = $controller("ProfileHints")
setTimeout ( -> setTimeout ( ->
if ctrl.url == "https://taiga.io/support/custom-fields/" expect(ctrl.hint.title).to.be.equal("fill")
expect(ctrl.title).to.be.equal("title_2") expect(ctrl.hint.text).to.be.equal("fill")
expect(ctrl.text).to.be.equal("text_2") expect(ctrl.hint.linkText).to.have.length.above(1)
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")
done() done()
) )

View File

@ -2,7 +2,7 @@ h4
span.icon.icon-help span.icon.icon-help
span(translate="HINTS.SECTION_NAME") span(translate="HINTS.SECTION_NAME")
p {{::vm.title}} p {{::vm.hint.title}}
p {{::vm.text}} 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}}")