@hyvor/design 2.0.7 → 2.0.8-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
let { selectedUserId = $bindable(undefined) }: Props = $props();
|
|
18
18
|
|
|
19
|
-
const { instance, organization } = getCloudContext();
|
|
19
|
+
const { instance, organization, deployment } = getCloudContext();
|
|
20
20
|
|
|
21
21
|
let search = $state('');
|
|
22
22
|
let role = $derived(organization?.role);
|
|
@@ -138,16 +138,18 @@
|
|
|
138
138
|
</div>
|
|
139
139
|
{/if}
|
|
140
140
|
</div>
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
141
|
+
{#if deployment === 'cloud'}
|
|
142
|
+
<div class="invite-note">
|
|
143
|
+
Looking for a user outside your organization?
|
|
144
|
+
{#if role === 'admin' || role === 'manager'}
|
|
145
|
+
<a href={instance + '/account/org/members?invite'} target="_blank" class="hds-link">
|
|
146
|
+
Invite them
|
|
147
|
+
</a>
|
|
148
|
+
{:else}
|
|
149
|
+
Ask an admin to invite them
|
|
150
|
+
{/if} to your organization first.
|
|
151
|
+
</div>
|
|
152
|
+
{/if}
|
|
151
153
|
{/if}
|
|
152
154
|
|
|
153
155
|
<style>
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { getCloudContext } from '../CloudContext/cloudContextState.svelte.js';
|
|
2
2
|
export async function searchMembers(search) {
|
|
3
|
-
const { instance, organization } = getCloudContext();
|
|
3
|
+
const { instance, organization, deployment } = getCloudContext();
|
|
4
4
|
const query = new URLSearchParams({
|
|
5
5
|
organization_id: organization?.id.toString() || '',
|
|
6
6
|
search
|
|
7
7
|
});
|
|
8
|
-
|
|
8
|
+
let url;
|
|
9
|
+
if (deployment === 'cloud') {
|
|
10
|
+
url = instance + '/api/v2/cloud/members/search?' + query.toString();
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
url = '/api/oidc/search?' + query.toString();
|
|
14
|
+
}
|
|
15
|
+
const response = await fetch(url, {
|
|
9
16
|
method: 'GET',
|
|
10
17
|
credentials: 'include'
|
|
11
18
|
});
|
|
@@ -8,10 +8,12 @@ export interface Footer {
|
|
|
8
8
|
*/
|
|
9
9
|
cancel?: false | {
|
|
10
10
|
text?: string;
|
|
11
|
+
disabled?: boolean;
|
|
11
12
|
props?: ComponentProps<typeof Button>;
|
|
12
13
|
};
|
|
13
14
|
confirm?: false | {
|
|
14
15
|
danger?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
15
17
|
text?: string;
|
|
16
18
|
props?: ComponentProps<typeof Button>;
|
|
17
19
|
};
|