Skip to content

Commit

Permalink
show orgs to non devs
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Oct 21, 2024
1 parent abb6dce commit aac2284
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
3 changes: 0 additions & 3 deletions frontend/src/lib/layout/AppMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import type {LexAuthUser} from '$lib/user';
import Icon from '$lib/icons/Icon.svelte';
import { helpLinks } from '$lib/components/help';
import DevContent from './DevContent.svelte';
export let serverVersion: string;
export let apiVersion: string | null;
Expand Down Expand Up @@ -46,14 +45,12 @@
</a>
</li>

<DevContent>
<li>
<a href="/org/list" data-sveltekit-preload-data="tap">
{$t('appmenu.orgs')}
<Icon icon="i-mdi-account-group-outline" size="text-2xl" />
</a>
</li>
</DevContent>

<li>
<a href="/user" data-sveltekit-preload-data="tap">
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/lib/layout/Layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@
{$t('appmenu.help')}
<Icon icon="i-mdi-open-in-new" size="text-lg" />
</a>
<DevContent>
<a href="/org/list" class="btn btn-sm btn-secondary hidden lg:flex">
{$t('appmenu.orgs')}
<Icon icon="i-mdi-account-group-outline" size="text-xl" />
</a>
</DevContent>
<a href="/" class="btn btn-sm btn-primary">
<span class="max-sm:hidden">
{$t('user_dashboard.title')}
Expand Down
34 changes: 14 additions & 20 deletions frontend/src/routes/(authenticated)/project/create/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import { concatAll } from '$lib/util/array';
import { browser } from '$app/environment';
import { ProjectConfidentialityCombobox } from '$lib/components/Projects';
import DevContent from '$lib/layout/DevContent.svelte';
import { isDev } from '$lib/layout/DevContent.svelte';
import { _getProjectsByLangCodeAndOrg, _getProjectsByNameAndOrg } from './+page';
import Markdown from 'svelte-exmarkdown';
import { NewTabLinkRenderer } from '$lib/components/Markdown';
Expand Down Expand Up @@ -145,10 +143,8 @@
if (urlValues.description) form.description = urlValues.description;
if (urlValues.type) form.type = urlValues.type;
if (urlValues.orgId) form.orgId = urlValues.orgId;
if ($isDev === true) {
if (!form.orgId && !user.isAdmin && myOrgs?.[0]) {
form.orgId = myOrgs[0].id;
}
if (!form.orgId && !user.isAdmin && myOrgs?.[0]) {
form.orgId = myOrgs[0].id;
}
if (urlValues.retentionPolicy && (urlValues.retentionPolicy !== RetentionPolicy.Dev || user.isAdmin)) form.retentionPolicy = urlValues.retentionPolicy;
if (urlValues.isConfidential === 'true') form.isConfidential = true;
Expand Down Expand Up @@ -209,20 +205,18 @@

<ProjectTypeSelect bind:value={$form.type} error={$errors.type} />

<DevContent>
<Select
id="org"
label={$t('project.create.org')}
bind:value={$form.orgId}
error={$errors.orgId}
on:change
>
<option value={''} >{$t('project_page.organization.placeholder')}</option>
{#each myOrgs as org}
<option value={org.id}>{org.name}</option>
{/each}
</Select>
</DevContent>
<Select
id="org"
label={$t('project.create.org')}
bind:value={$form.orgId}
error={$errors.orgId}
on:change
>
<option value={''} >{$t('project_page.organization.placeholder')}</option>
{#each myOrgs as org}
<option value={org.id}>{org.name}</option>
{/each}
</Select>

<AdminContent>
<div class="form-control">
Expand Down

0 comments on commit aac2284

Please sign in to comment.