Skip to content

Commit

Permalink
fix: fixed code style
Browse files Browse the repository at this point in the history
  • Loading branch information
slaveeks committed Feb 23, 2024
1 parent 879eccf commit eb7a541
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
9 changes: 6 additions & 3 deletions src/application/services/useMarketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface UseMarketplaceComposable {
/**
* Get list of all tools with user binding
*/
tools: Ref<EditorToolWithUserBinding[]>
tools: Ref<EditorToolWithUserBinding[]>;
}

/**
Expand Down Expand Up @@ -39,7 +39,10 @@ export default function (): UseMarketplaceComposable {
onMounted(async () => {
availableTools.value = await marketplaceService.getAllTools();

toolsWithUserBindings.value = marketplaceService.getToolsWithUserBindings(userEditorTools.value, availableTools.value);
toolsWithUserBindings.value = marketplaceService.getToolsWithUserBindings(
userEditorTools.value,
availableTools.value
);
});

/**
Expand All @@ -55,4 +58,4 @@ export default function (): UseMarketplaceComposable {
return {
tools: toolsWithUserBindings,
};
};
}
5 changes: 2 additions & 3 deletions src/application/services/useUserSettings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { userService } from '@/domain';
import { useAppState } from './useAppState';
import EditorTool from '@/domain/entities/EditorTool';

/**
* User settings hook state
Expand All @@ -9,12 +8,12 @@ interface UseUserSettingsComposableState {
/**
* Add tool to the user settings
*/
addTool(id: string): Promise<void>
addTool(id: string): Promise<void>;

/**
* Remove tool from the user settings
*/
removeTool(id: string): Promise<void>
removeTool(id: string): Promise<void>;
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/domain/marketplace.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type MarketplaceRepository from '@/domain/marketplace.repository.interface';
import type EditorTool from './entities/EditorTool';
import { EditorToolWithUserBinding } from './entities/EditorTool';
import type EditorTool from './entities/EditorTool';
import type { EditorToolWithUserBinding } from './entities/EditorTool';

/**
* Business logic working with Marketplace
Expand All @@ -14,9 +14,7 @@ export default class MarketplaceService {
/**
* Service constructor
*
* @param eventBus - Common domain event bus
* @param marketplaceRepository - repository instance
* @param marketplaceRepositoryRepository
*/
constructor(marketplaceRepository: MarketplaceRepository) {
this.repository = marketplaceRepository;
Expand Down
12 changes: 6 additions & 6 deletions src/presentation/components/marketplace/EditorToolElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ const { addTool, removeTool } = useUserSettings();
const { t } = useI18n();
const props = defineProps<{
tool: EditorToolWithUserBinding
tool: EditorToolWithUserBinding;
}>();
const canBeUninstalled = computed(() => !props.tool.isDefault && props.tool.isInstalled);
const canBeInstalled = computed(() => !props.tool.isDefault && !props.tool.isInstalled);
</script>

<style scoped lang="postcss">
.marketplace__tool {
display: flex;
align-items: center;
gap: var(--spacing-very-x);
}
.marketplace__tool {
display: flex;
align-items: center;
gap: var(--spacing-very-x);
}
</style>
8 changes: 2 additions & 6 deletions src/presentation/pages/Marketplace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@
v-for="tool in tools"
:key="tool.id"
>
<EditorToolElement
:tool="tool"
/>
<EditorToolElement :tool="tool" />
</ul>
</div>
</template>

<script setup lang="ts">
import useMarketplace from '@/application/services/useMarketplace';
import useMarketplace from '@/application/services/useMarketplace';
import EditorToolElement from '../components/marketplace/EditorToolElement.vue';
const { tools } = useMarketplace();
</script>

<style setup lang="postcss" scoped>
Expand Down

0 comments on commit eb7a541

Please sign in to comment.