-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from krumIO/feat/APPLAUNCHER-28__global_card_c…
…luster_name feat: for APPLAUNCHER-28 various data fixes
- Loading branch information
Showing
6 changed files
with
458 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
<script> | ||
export default { | ||
name: 'ClusterActions', | ||
props: { | ||
searchQuery: { | ||
type: String, | ||
required: true, | ||
}, | ||
isGridView: { | ||
type: Boolean, | ||
required: true, | ||
}, | ||
sortOrder: { | ||
type: String, | ||
required: true, | ||
}, | ||
selectedCluster: { | ||
type: String, | ||
required: true, | ||
}, | ||
clusterOptions: { | ||
type: Array, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
aToZorZtoA() { | ||
console.log(this.$store.getters['i18n/t']('appLauncher.aToZ')); | ||
return this.sortOrder === 'asc' ? this.$store.getters['i18n/t']('appLauncher.aToZ') : this.$store.getters['i18n/t']('appLauncher.zToA'); | ||
}, | ||
}, | ||
emits: ['update:search-query', 'toggle-sort', 'update:selected-cluster', 'set-view'], | ||
}; | ||
</script> | ||
|
||
<template> | ||
<div class="cluster-actions"> | ||
<div class="search-input"> | ||
<input :value="searchQuery" :placeholder="$store.getters['i18n/t']('appLauncher.filter')" @input="$emit('update:search-query', $event.target.value)" /> | ||
</div> | ||
<div class="sort-buttons" v-if="isGridView" @click="$emit('toggle-sort')"> | ||
<div class="sort-button" :class="{ active: sortOrder === 'asc' }" :disabled="sortOrder === 'asc'"> | ||
<i class="icon-chevron-up"></i> | ||
</div> | ||
<div class="sort-label"> | ||
<p>{{ aToZorZtoA }}</p> | ||
</div> | ||
<div class="sort-button" :class="{ active: sortOrder === 'desc' }" :disabled="sortOrder === 'desc'"> | ||
<i class="icon-chevron-down"></i> | ||
</div> | ||
</div> | ||
<div class="select-wrapper"> | ||
<select :value="selectedCluster" class="cluster-select" @change="$emit('update:selected-cluster', $event.target.value)"> | ||
<option v-for="option in clusterOptions" :key="option.value" :value="option.value"> | ||
{{ option.label }} | ||
</option> | ||
</select> | ||
</div> | ||
<button class="icon-button" @click="$emit('set-view', 'grid')"> | ||
<i class="icon icon-apps" /> | ||
</button> | ||
<button class="icon-button" @click="$emit('set-view', 'list')"> | ||
<i class="icon icon-list-flat" /> | ||
</button> | ||
</div> | ||
</template> | ||
|
||
|
||
<style scoped> | ||
.cluster-actions { | ||
display: flex; | ||
align-items: center; | ||
gap: 1rem; | ||
position: fixed; | ||
right: 5.8%; | ||
top: 4.3rem; | ||
z-index: 2; | ||
padding-bottom: 0.425rem; | ||
padding-right: 4.4rem; | ||
background: inherit; | ||
border-bottom: var(--header-border-size) solid var(--header-border); | ||
} | ||
.icon-button { | ||
background: none; | ||
border: none; | ||
cursor: pointer; | ||
padding: 0; | ||
color: var(--primary); | ||
font-size: 1.8rem; | ||
} | ||
.sort-button { | ||
background: none; | ||
border: none; | ||
cursor: pointer; | ||
padding: none; | ||
color: #555555; | ||
font-size: 1.3rem; | ||
display: flex; | ||
align-items: center; | ||
} | ||
.sort-label { | ||
color: var(--primary); | ||
font-size: 1rem; | ||
cursor: pointer; | ||
} | ||
.sort-buttons { | ||
display: flex; | ||
gap: 1rem; | ||
align-items: center; | ||
} | ||
.sort-button:hover { | ||
color: var(--primary-hover); | ||
} | ||
.sort-button.active { | ||
color: var(--primary); | ||
} | ||
.search-input { | ||
text-align: right; | ||
justify-content: flex-end; | ||
display: flex; | ||
input { | ||
width: 190px; | ||
padding: 11px; | ||
font-size: 1rem; | ||
border: 1px solid var(--border); | ||
border-radius: 4px; | ||
} | ||
} | ||
.select-wrapper select { | ||
padding: 0.8rem; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<script> | ||
import AppLauncherCard from './AppLauncherCard.vue'; | ||
export default { | ||
name: 'ClusterGridView', | ||
components: { | ||
AppLauncherCard, | ||
}, | ||
props: { | ||
clusterData: { | ||
type: Object, | ||
required: true, | ||
}, | ||
favoritedApps: { | ||
type: Array, | ||
required: true, | ||
}, | ||
}, | ||
emits: ['toggle-favorite'], | ||
}; | ||
</script> | ||
|
||
<template> | ||
<div class="cluster-grid-view"> | ||
<div class="cluster-header"> | ||
<h1> | ||
{{ clusterData.name }} | ||
</h1> | ||
</div> | ||
<div class="services-by-cluster-grid"> | ||
<AppLauncherCard | ||
v-for="app in clusterData.filteredApps" | ||
:key="`${app.clusterId}-${app.id}-${app.kind}`" | ||
:app="app" :isInGlobalView="false" :favorited-apps="favoritedApps" | ||
@toggle-favorite="$emit('toggle-favorite', $event)" | ||
/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="scss"> | ||
.services-by-cluster-grid { | ||
display: grid; | ||
grid-gap: 1rem; | ||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | ||
} | ||
.cluster-header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
margin: 1rem 0; | ||
background: var(--header-bg); | ||
border-bottom: var(--header-border-size) solid var(--header-border); | ||
height: var(--header-height); | ||
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
.favorite-icon { | ||
margin-right: 1rem; | ||
} | ||
</style> |
Oops, something went wrong.