summaryrefslogtreecommitdiffstats
path: root/documentation/components/original-drawings/tooltip-plain-withpointer.svg
blob: 81097e53071c83aeca5921d0caa384de51c2cd86 (plain)
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
151
152
153
154
155
156
157
158
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="210mm"
   height="297mm"
   id="svg1901"
   sodipodi:version="0.32"
   inkscape:version="0.48.2 r9819"
   sodipodi:docname="tooltip-plain-withpointer.svg"
   inkscape:output_extension="org.inkscape.output.svg.inkscape"
   version="1.1">
  <defs
     id="defs1903">
    <inkscape:perspective
       sodipodi:type="inkscape:persp3d"
       inkscape:vp_x="0 : 526.18109 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_z="744.09448 : 526.18109 : 1"
       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
       id="perspective7" />
    <inkscape:perspective
       id="perspective2444"
       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
       inkscape:vp_z="744.09448 : 526.18109 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_x="0 : 526.18109 : 1"
       sodipodi:type="inkscape:persp3d" />
    <linearGradient
       y2="471.38400"
       y1="45.132561"
       xlink:href="#linearGradient7601"
       x2="1370.5586"
       x1="-526.86133"
       spreadMethod="reflect"
       inkscape:collect="always"
       id="linearGradient10877"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(8.892150e-2,0.000000,0.000000,0.155616,635.7169,9.380527)" />
    <linearGradient
       y2="471.38400"
       y1="45.132561"
       xlink:href="#linearGradient7601"
       x2="1370.5586"
       x1="-526.86133"
       spreadMethod="reflect"
       inkscape:collect="always"
       id="linearGradient10869"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.323979,0.000000,0.000000,0.566975,399.6324,14.15086)" />
    <linearGradient
       y2="471.38400"
       y1="45.132561"
       xlink:href="#linearGradient7601"
       x2="1370.5586"
       x1="-526.86133"
       spreadMethod="reflect"
       inkscape:collect="always"
       id="linearGradient7607"
       gradientUnits="userSpaceOnUse"
       gradientTransform="matrix(0.755921,0,0,1.32289,-36,0)" />
    <linearGradient
       inkscape:collect="always"
       id="linearGradient7601">
      <stop
         style="stop-color:#000000;stop-opacity:1;"
         offset="0"
         id="stop7603" />
      <stop
         style="stop-color:#000000;stop-opacity:0;"
         offset="1"
         id="stop7605" />
    </linearGradient>
    <inkscape:perspective
       id="perspective2581"
       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
       inkscape:vp_z="744.09448 : 526.18109 : 1"
       inkscape:vp_y="0 : 1000 : 0"
       inkscape:vp_x="0 : 526.18109 : 1"
       sodipodi:type="inkscape:persp3d" />
  </defs>
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="2.7777778"
     inkscape:cx="323.26669"
     inkscape:cy="909.70837"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     gridtolerance="10000"
     inkscape:window-width="1342"
     inkscape:window-height="819"
     inkscape:window-x="0"
     inkscape:window-y="0"
     showgrid="false"
     inkscape:window-maximized="0" />
  <metadata
     id="metadata1906">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Taso 1"
     inkscape:groupmode="layer"
     id="layer1"
     style="opacity:1">
    <image
       sodipodi:absref="/home/magi/itmill/book-7/manual/original-drawings/components/../../img/components/tooltip-plain.png"
       xlink:href="../../img/components/tooltip-plain.png"
       height="50.32"
       width="129.39429"
       id="image2446"
       x="271.5"
       y="152.36218" />
    <g
       style="display:inline"
       inkscape:label="Layer 1"
       id="g2590"
       transform="matrix(0.02617234,0,0,0.02617234,309.56235,171.43915)">
      <g
         id="g1317">
        <path
           style="fill:url(#linearGradient7607);fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
           id="path6080"
           d="m 70.29035,24.82601 0,602.34375 35.4375,0 0,-35.4375 35.4375,0 0,-35.40625 35.40625,0 0,-35.4375 35.4375,0 35.4375,0 0,70.84375 35.4375,0 0,70.875 35.4375,0 0,70.875 35.4375,0 0,35.4375 70.84375,0 0,-35.4375 35.4375,0 0,-70.875 -35.4375,0 0,-70.875 -35.40625,0 0,-70.84375 -35.4375,0 0,-70.875 141.71875,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.40625,0 0,-35.40625 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.437499 -35.40625,0 0,-35.406251 -35.4375,0 0,-35.4375 -35.4375,0 z"
           inkscape:connector-curvature="0" />
        <path
           style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
           id="rect1430"
           d="m 35.4375,24.8125 0,602.34375 35.4375,0 0,-35.4375 35.4375,0 0,-35.40625 -35.4375,0 0,-460.65625 35.4375,0 0,-35.40625 -35.4375,0 0,-35.4375 -35.4375,0 z m 70.875,70.84375 0,35.4375 35.40625,0 0,-35.4375 -35.40625,0 z m 35.40625,35.4375 0,35.4375 35.4375,0 0,-35.4375 -35.4375,0 z m 35.4375,35.4375 0,35.4375 35.4375,0 0,-35.4375 -35.4375,0 z m 35.4375,35.4375 0,35.4375 35.4375,0 0,-35.4375 -35.4375,0 z m 35.4375,35.4375 0,35.4375 35.4375,0 0,-35.4375 -35.4375,0 z m 35.4375,35.4375 0,35.4375 35.4375,0 0,-35.4375 -35.4375,0 z m 35.4375,35.4375 0,35.40625 35.4375,0 0,-35.40625 -35.4375,0 z m 35.4375,35.40625 0,35.4375 35.40625,0 0,-35.4375 -35.40625,0 z m 35.40625,35.4375 0,35.4375 -106.28125,0 0,35.4375 0,70.875 35.4375,0 0,-70.875 141.71875,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.4375,0 z m -70.84375,141.75 0,70.84375 35.4375,0 0,-70.84375 -35.4375,0 z m 35.4375,70.84375 0,70.875 35.40625,0 0,-70.875 -35.40625,0 z m 35.40625,70.875 0,70.875 35.4375,0 0,-70.875 -35.4375,0 z m 0,70.875 -70.84375,0 0,35.4375 70.84375,0 0,-35.4375 z m -70.84375,0 0,-70.875 -35.4375,0 0,70.875 35.4375,0 z m -35.4375,-70.875 0,-70.875 -35.4375,0 0,70.875 35.4375,0 z m -35.4375,-70.875 0,-70.84375 -35.4375,0 0,70.84375 35.4375,0 z m -35.4375,-70.84375 0,-70.875 -35.4375,0 0,35.4375 -35.4375,0 0,35.4375 35.4375,0 35.4375,0 z m -70.875,0 -35.40625,0 0,35.4375 35.40625,0 0,-35.4375 z"
           inkscape:connector-curvature="0" />
        <path
           style="fill:#ffffff;fill-opacity:1;stroke:none"
           id="rect3779"
           d="m 70.875,95.65625 0,460.65625 35.4375,0 0,-35.4375 35.40625,0 0,-35.4375 35.4375,0 0,-35.4375 35.4375,0 0,70.875 35.4375,0 0,70.84375 35.4375,0 0,70.875 35.4375,0 0,70.875 35.4375,0 35.40625,0 0,-70.875 -35.40625,0 0,-70.875 -35.4375,0 0,-70.84375 -35.4375,0 0,-106.3125 35.4375,0 35.4375,0 35.40625,0 0,-35.4375 -35.40625,0 0,-35.4375 -35.4375,0 0,-35.40625 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.4375,0 0,-35.4375 -35.40625,0 0,-35.4375 -35.4375,0 z"
           inkscape:connector-curvature="0" />
      </g>
    </g>
  </g>
</svg>
>backport/47933/stable29 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/cypress/e2e/settings/usersUtils.ts
blob: 7d8ea55d35ba35bb58bde6d542bcbf21fb1a3dd8 (plain)
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
/**
 * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

import type { User } from '@nextcloud/cypress'

/**
 * Assert that `element` does not exist or is not visible
 * Useful in cases such as when NcModal is opened/closed rapidly
 * @param element Element that is inspected
 */
export function assertNotExistOrNotVisible(element: JQuery<HTMLElement>) {
	const doesNotExist = element.length === 0
	const isNotVisible = !element.is(':visible')

	// eslint-disable-next-line no-unused-expressions
	expect(doesNotExist || isNotVisible, 'does not exist or is not visible').to.be.true
}

/**
 * Get the settings users list
 * @return Cypress chainable object
 */
export function getUserList() {
	return cy.get('[data-cy-user-list]')
}

/**
 * Get the row entry for given userId within the settings users list
 *
 * @param userId the user to query
 * @return Cypress chainable object
 */
export function getUserListRow(userId: string) {
	return getUserList().find(`[data-cy-user-row="${userId}"]`)
}

export function waitLoading(selector: string) {
	// We need to make sure the element is loading, otherwise the "done loading" will succeed even if we did not start loading.
	// But Cypress might also be simply too slow to catch the loading phase. Thats why we need to wait in this case.
	// eslint-disable-next-line cypress/no-unnecessary-waiting
	cy.get(`${selector}[data-loading]`).if().should('exist').else().wait(1000)
	// https://github.com/NoriSte/cypress-wait-until/issues/75#issuecomment-572685623
	cy.waitUntil(() => Cypress.$(selector).length > 0 && !Cypress.$(selector).attr('data-loading')?.length, { timeout: 10000 })
}

/**
 * Toggle the edit button of the user row
 * @param user The user row to edit
 * @param toEdit True if it should be switch to edit mode, false to switch to read-only
 */
export function toggleEditButton(user: User, toEdit = true) {
	// see that the list of users contains the user
	getUserListRow(user.userId).should('exist')
		// toggle the edit mode for the user
		.find('[data-cy-user-list-cell-actions]')
		.find(`[data-cy-user-list-action-toggle-edit="${!toEdit}"]`)
		.if()
		.click({ force: true })
		.else()
		// otherwise ensure the button is already in edit mode
		.then(() => getUserListRow(user.userId)
			.find(`[data-cy-user-list-action-toggle-edit="${toEdit}"]`)
			.should('exist'),
		)
}

/**
 * Handle the confirm password dialog (if needed)
 * @param adminPassword The admin password for the dialog
 */
export function handlePasswordConfirmation(adminPassword = 'admin') {
	const handleModal = (context: Cypress.Chainable) => {
		return context.contains('.modal-container', 'Confirm your password')
			.if()
			.within(() => {
				cy.get('input[type="password"]').type(adminPassword)
				cy.get('button').contains('Confirm').click()
			})
	}

	return cy.get('body')
		.if()
		.then(() => handleModal(cy.get('body')))
		.else()
		// Handle if inside a cy.within
		.root().closest('body')
		.then(($body) => handleModal(cy.wrap($body)))
}