~launchpad-pqm/launchpad/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
Answer Contacts
===============

Each product and distros can have answer contacts. Answer contacts
receive notifications for new questions as well as changes to existing
ones.

The list of answer contacts is displayed in the 'Answer Contact' portlet
which is available on the 'Answers' facet of the product or
distribution.

    >>> browser.addHeader('Authorization', 'Basic test@canonical.com:test')
    >>> browser.addHeader('Accept-Language', 'en, es')
    >>> browser.open('http://launchpad.dev/ubuntu/+questions')
    >>> print extract_text(
    ...     find_tag_by_id(browser.contents, 'portlet-answer-contacts-ubuntu'))
    Answer contacts for Ubuntu

Anybody can become an answer contact. To register as an answer contact,
the user clicks on the 'Set answer Contact' link:

    >>> browser.getLink('Set answer contact').click()
    >>> print browser.title
    Answer contact for...

    >>> description = find_main_content(browser.contents).p
    >>> print extract_text(description)
    An answer contact...will receive changes related to all questions
    (written in one of your preferred languages)...

That page displays a series of checkboxes. One for the user and one for
each team that user is an administrator of.

    >>> browser.getControl(
    ...     name='field.answer_contact_teams').options
    ['landscape-developers', 'launchpad-users']

The user can select any of these checkboxes to register as an answer
contact himself or one of the team for which he's an administrator. In
our case, the user decides to register himself and the Landscape
Developers team.

    >>> browser.getControl(
    ...     "I want to be an answer contact for Ubuntu").selected = True
    >>> browser.getControl("Landscape Developers").selected = True
    >>> browser.getControl('Continue').click()

Answer contacts must tell Launchpad which languages they provide help
in. As a convenience, the Answer Tracker will set the Person's preferred
languages for him. The browser languages are used for a Person. In the
case of a Team, only English is added. Sample Person reads the notice
that his preferred languages were set, and uses the link to in the
notice to review the changes. Sample Person's browser sends the accept-
languages header with English and Spanish.

    >>> browser.getLink('Your preferred languages').click()
    >>> print browser.title
    Language preferences...

    >>> browser.getControl('English', index=0).selected
    True

    >>> browser.getControl('Spanish').selected
    True

To remove oneself from the answer contacts, the user uses the same 'Set
answer contact' link and uncheck himself or the team he want to remove
from the answer contact list.

    >>> browser.open('http://launchpad.dev/ubuntu/+questions')
    >>> browser.getLink('Set answer contact').click()
    >>> browser.getControl(
    ...     "I want to be an answer contact for Ubuntu").selected
    True

    >>> browser.getControl("Landscape Developers").selected
    True

    >>> browser.getControl("Landscape Developers").selected = False
    >>> browser.getControl('Continue').click()

A confirmation message is displayed:

    >>> for tag in find_tags_by_class(browser.contents, 'message'):
    ...     print tag.renderContents()
    Landscape Developers has been removed as an answer contact for Ubuntu.


Product Answer Contacts
-----------------------

The 'Set answer contact' action is also available on products:

    >>> browser.open('http://answers.launchpad.dev/firefox')
    >>> browser.getLink('Set answer contact').click()
    >>> print browser.title
    Answer contact for...

    >>> print browser.url
    http://answers.launchpad.dev/firefox/+answer-contact


Answer Contact teams and preferred languages
--------------------------------------------

Answer contacts support questions written in their preferred languages.
Team, may have preferred languages, but do not normally configure them.
So teams are given English language by default when a team becomes an
answer contact. Team admins may configure a team's preferred languages
to set exactly which languages the team supports.

Sample Person visits the Answers facet of Ubuntu as described in the
main story above. He wants Landscape Developers team to be answer
contacts for Ubuntu, but only for Spanish questions to keep the email
traffic to a manageable volume.

    >>> browser.open('http://answers.launchpad.dev/ubuntu/')
    >>> print browser.title
    Questions : Ubuntu

    >>> browser.getLink('Set answer contact').click()
    >>> browser.getControl("Landscape Developers").selected = True
    >>> browser.getControl('Continue').click()
    >>> for message in find_tags_by_class(browser.contents, 'message'):
    ...     print extract_text(message)
    Landscape Developers has been added as an answer contact for Ubuntu.

Sample Person navigates to the team page to set it's preferred
languages. He must add Spanish to the team's preferred languages.

    >>> browser.open('http://launchpad.dev/~landscape-developers')
    >>> browser.title
    'Landscape Developers in Launchpad'

    >>> browser.getLink('Set preferred languages').click()
    >>> print browser.title
    Language preferences...

Sample Person may be surprised to see English is already selected. Per
the notification issued in the first example above, English was added to
the team's preferred languages. We did not see the notification this
time since the languages are set. Sample Person unselects English, and
selects Spanish.

    >>> browser.getControl('English', index=0).selected
    True

    >>> browser.getControl('English', index=0).selected = False
    >>> browser.getControl('Spanish').selected = True
    >>> browser.getControl('Save').click()