Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imp: consistent delete Buttons #76

Merged
merged 6 commits into from
Nov 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/dashboard/src/routes/project/[projectId]/keys.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Tag,
Pagination
} from 'carbon-components-svelte';
import TrashCan32 from 'carbon-icons-svelte/lib/TrashCan32';
import Delete16 from 'carbon-icons-svelte/lib/Delete16';
import TranslationModal from '$lib/components/modals/TranslationModal.svelte';
import { projectStore } from '$lib/stores/projectStore';
import CreateKeyModal from '$lib/components/modals/CreateKeyModal.svelte';
Expand Down Expand Up @@ -141,8 +141,10 @@
deleteKeyModal.show({ key: row.key });
}}
iconDescription="Delete translation"
icon={TrashCan32}
kind="danger-ghost"
kind="ghost"
icon={Delete16}
tooltipAlignment="start"
tooltipPosition="left"
/>
</row>
{:else}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import DeleteLanguageModal from '$lib/components/modals/DeleteLanguageModal.svelte';
import RadioButton16 from 'carbon-icons-svelte/lib/RadioButton16';
import RadioButtonChecked16 from 'carbon-icons-svelte/lib/RadioButtonChecked16';
<<<<<<< HEAD
import Add16 from 'carbon-icons-svelte/lib/Add16';
=======
>>>>>>> 34ef389815516e2c2e9798d3bf0a667f480cd5eb

// all modals are interacted with as object which alllows to pass
// values such as a language that should be deleted along.
Expand Down Expand Up @@ -163,7 +160,7 @@
{:else if cell.key === 'actions'}
<row class="justify-end">
<Button
kind="danger-ghost"
kind="ghost"
disabled={row.isDefaultLanguage}
icon={Delete16}
iconDescription="Delete language"
Expand Down
15 changes: 9 additions & 6 deletions packages/dashboard/src/routes/project/[projectId]/members.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { TextInput, Button, DataTable, Loading } from 'carbon-components-svelte';
import SendAlt24 from 'carbon-icons-svelte/lib/SendAlt32';
import Delete24 from 'carbon-icons-svelte/lib/Delete24';
import Delete16 from 'carbon-icons-svelte/lib/Delete16';
import type { definitions } from '@inlang/database';
import { database } from '$lib/services/database';
import { DatabaseResponse } from '$lib/types/databaseResponse';
Expand Down Expand Up @@ -79,7 +79,7 @@
if (userId.error) {
alert(userId.error.message);
} else if (userId.data === null) {
alert(inputEmail + " is not a user of inlang yet")
alert(inputEmail + ' is not a user of inlang yet');
} else {
const memberUpsert = await database.from<definitions['member']>('member').insert({
organization_id: organization_id,
Expand All @@ -98,7 +98,7 @@
await loadUsers();
} else {
if (memberUpsert.error) {
alert(memberUpsert.error.message)
alert(memberUpsert.error.message);
} else {
alert('An unknown error occurred');
}
Expand Down Expand Up @@ -144,11 +144,12 @@
</row>
<br />
<DataTable {headers} rows={rows()}>
<span slot="cell" let:row let:cell class="cursor-pointer">
<span slot="cell" let:row let:cell>
{#if cell.key === 'email'}
<row class="items-center space-x-2">
<p class="text-sm">{cell.value}</p>
</row>

<!-- {:else if cell.key === 'role'}
<row class="items-center space-x-2">
<p class="text-sm">{cell.value}</p>
Expand All @@ -157,8 +158,10 @@
<row class="justify-end items-center">
<Button
disabled={isOwner(row.id)}
kind="danger-ghost"
icon={Delete24}
kind="ghost"
icon={Delete16}
tooltipAlignment="start"
tooltipPosition="left"
iconDescription="Remove member"
on:click={() => {
deleteMemberModal.show({
Expand Down