introduce concepts phase 1-2
This commit is contained in:
@@ -21,8 +21,10 @@ export interface Props {
|
||||
|
||||
const { tool } = Astro.props;
|
||||
|
||||
// Check if this is a method vs software
|
||||
|
||||
// Check types
|
||||
const isMethod = tool.type === 'method';
|
||||
const isConcept = tool.type === 'concept';
|
||||
|
||||
// Check if tool has a valid project URL (means we're hosting it)
|
||||
const hasValidProjectUrl = tool.projectUrl !== undefined &&
|
||||
@@ -34,7 +36,8 @@ const hasValidProjectUrl = tool.projectUrl !== undefined &&
|
||||
const hasKnowledgebase = tool.knowledgebase === true;
|
||||
|
||||
// Determine card styling based on type and hosting status
|
||||
const cardClass = isMethod ? 'card card-method tool-card' :
|
||||
const cardClass = isConcept ? 'card card-concept tool-card' :
|
||||
isMethod ? 'card card-method tool-card' :
|
||||
hasValidProjectUrl ? 'card card-hosted tool-card' :
|
||||
(tool.license !== 'Proprietary' ? 'card card-oss tool-card' : 'card tool-card');
|
||||
---
|
||||
@@ -99,9 +102,14 @@ const cardClass = isMethod ? 'card card-method tool-card' :
|
||||
))}
|
||||
</div>
|
||||
|
||||
<!-- Buttons - Fixed at Bottom -->
|
||||
<!-- Buttons - Fixed at Bottom -->
|
||||
<div class="tool-card-buttons" onclick="event.stopPropagation();">
|
||||
{isMethod ? (
|
||||
{isConcept ? (
|
||||
<!-- Concept button -->
|
||||
<a href={tool.url} target="_blank" rel="noopener noreferrer" class="btn btn-primary single-button" style="background-color: var(--color-concept); border-color: var(--color-concept);">
|
||||
Mehr erfahren
|
||||
</a>
|
||||
) : isMethod ? (
|
||||
<!-- Method button -->
|
||||
<a href={tool.projectUrl || tool.url} target="_blank" rel="noopener noreferrer" class="btn btn-primary single-button" style="background-color: var(--color-method); border-color: var(--color-method);">
|
||||
Zur Methode
|
||||
|
||||
@@ -342,35 +342,6 @@ const sortedTags = Object.entries(tagFrequency)
|
||||
return true;
|
||||
});
|
||||
|
||||
// Sort filtered results: methods first, then self-hosted, then OSS, proprietary last
|
||||
filtered.sort((a, b) => {
|
||||
const aMethod = isMethod(a);
|
||||
const bMethod = isMethod(b);
|
||||
const aHosted = isToolHosted(a);
|
||||
const bHosted = isToolHosted(b);
|
||||
const aProprietary = !aMethod && a.license === 'Proprietary';
|
||||
const bProprietary = !bMethod && b.license === 'Proprietary';
|
||||
|
||||
// Methods first
|
||||
//if (aMethod && !bMethod) return -1;
|
||||
//if (!aMethod && bMethod) return 1;
|
||||
|
||||
// If both are methods or both are tools
|
||||
if (aMethod === bMethod) {
|
||||
// Self-hosted tools first (regardless of license)
|
||||
if (aHosted && !bHosted) return -1;
|
||||
if (!aHosted && bHosted) return 1;
|
||||
|
||||
// If both have same hosting status, proprietary tools go last
|
||||
if (aHosted === bHosted) {
|
||||
if (!aProprietary && bProprietary) return -1;
|
||||
if (aProprietary && !bProprietary) return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
|
||||
// Update matrix highlighting
|
||||
updateMatrixHighlighting();
|
||||
// Emit custom event with filtered results
|
||||
@@ -417,17 +388,7 @@ const sortedTags = Object.entries(tagFrequency)
|
||||
window.dispatchEvent(new CustomEvent('viewChanged', { detail: view }));
|
||||
|
||||
if (view === 'hosted') {
|
||||
const hosted = window.toolsData.filter(tool => isToolHosted(tool));
|
||||
hosted.sort((a, b) => {
|
||||
const aProprietary = a.license === 'Proprietary';
|
||||
const bProprietary = b.license === 'Proprietary';
|
||||
|
||||
if (!aProprietary && bProprietary) return -1;
|
||||
if (aProprietary && !bProprietary) return 1;
|
||||
|
||||
return 0;
|
||||
});
|
||||
|
||||
const hosted = window.toolsData.filter(tool => isToolHosted(tool));
|
||||
window.dispatchEvent(new CustomEvent('toolsFiltered', { detail: hosted }));
|
||||
} else {
|
||||
filterTools();
|
||||
|
||||
@@ -24,6 +24,7 @@ domains.forEach((domain: any) => {
|
||||
matrix[domain.id] = {};
|
||||
phases.forEach((phase: any) => {
|
||||
matrix[domain.id][phase.id] = tools.filter((tool: any) =>
|
||||
tool.type !== 'concept' && // Exclude concepts from matrix
|
||||
tool.domains && tool.domains.includes(domain.id) &&
|
||||
tool.phases && tool.phases.includes(phase.id)
|
||||
);
|
||||
@@ -407,6 +408,11 @@ domains.forEach((domain: any) => {
|
||||
|
||||
// Re-populate with filtered tools based on domains × phases
|
||||
filtered.forEach(tool => {
|
||||
// Skip concepts - they don't belong in matrix
|
||||
if (tool.type === 'concept') {
|
||||
return;
|
||||
}
|
||||
|
||||
const isMethod = tool.type === 'method';
|
||||
const hasValidProjectUrl = tool.projectUrl !== undefined &&
|
||||
tool.projectUrl !== null &&
|
||||
|
||||
Reference in New Issue
Block a user