Skip to content
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: 7 additions & 1 deletion src/components/admin/ClassificationAdmin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
</td>
<td>
<LpiCheckbox
data-test="classification-switch-for-skills"
v-if="type === 'skills'"
class="as-button min-width"
:model-value="classification.is_enabled_for_skills"
Expand All @@ -49,6 +50,7 @@
/>

<LpiCheckbox
data-test="classification-switch-for-projects"
v-if="type === 'projects'"
class="as-button min-width"
:model-value="classification.is_enabled_for_projects"
Expand All @@ -65,13 +67,15 @@
<td>
<div class="actions">
<ContextActionButton
data-test="edit-classification-button"
secondary
no-border
action-icon="Pen"
@click="classificationToEdit = classification"
:disabled="!isCustomClassification(classification)"
/>
<ContextActionButton
data-test="delete-classification-button"
secondary
no-border
action-icon="TrashCanOutline"
Expand All @@ -86,19 +90,21 @@
</div>

<ConfirmModal
data-test="confirm-delete-classification-modal"
v-if="classificationToDelete"
:asyncing="isDeletingClassification"
@cancel="classificationToDelete = null"
@confirm="deleteClassification"
:title="$t('admin.classifications.delete-classification.title')"
:content="
$t('admin.classifications.delete-classification.content', {
title: classification?.title,
title: classificationToDelete?.title,
})
"
/>
</div>
<EditClassification
data-test="edit-classification-drawer"
:classification="classificationToEdit"
:is-open="classificationToEdit || createClassificationIsOpen"
@close="closeEditClassification"
Expand Down
10 changes: 9 additions & 1 deletion src/components/admin/DefaultSkillsAdmin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const deleteOrganizationTag = async () => {

<div class="tags-ctn">
<FilterValue
data-test="default-skill"
v-for="tag in organizationTags"
:key="tag.id"
:label="tagTexts.title(tag)"
Expand All @@ -84,9 +85,15 @@ const deleteOrganizationTag = async () => {
</div>

<div class="rel-ctn">
<LpiButton btn-icon="Plus" :label="t('common.add')" @click="tagSearchIsOpened = true" />
<LpiButton
data-test="add-default-skills"
btn-icon="Plus"
:label="t('common.add')"
@click="tagSearchIsOpened = true"
/>
</div>
<BaseDrawer
data-test="add-default-skills-drawer"
:confirm-action-name="t('common.confirm')"
:confirm-action-disabled="!newTags.length"
:is-opened="tagSearchIsOpened"
Expand All @@ -103,6 +110,7 @@ const deleteOrganizationTag = async () => {
/>
</BaseDrawer>
<ConfirmModal
data-test="confirm-delete-default-skill"
v-if="tagToDelete"
:title="$t('common.confirm-delete')"
content=""
Expand Down
10 changes: 9 additions & 1 deletion src/components/admin/DefaultTagsAdmin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const deleteOrganizationTag = async () => {

<div class="tags-ctn">
<FilterValue
data-test="default-tag"
v-for="tag in organizationTags"
:key="tag.id"
:label="tagTexts.title(tag)"
Expand All @@ -83,9 +84,15 @@ const deleteOrganizationTag = async () => {
</div>

<div class="rel-ctn">
<LpiButton btn-icon="Plus" :label="t('common.add')" @click="tagSearchIsOpened = true" />
<LpiButton
data-test="add-default-tags"
btn-icon="Plus"
:label="t('common.add')"
@click="tagSearchIsOpened = true"
/>
</div>
<BaseDrawer
data-test="add-default-tags-drawer"
:confirm-action-name="t('common.confirm')"
:confirm-action-disabled="!newTags.length"
:is-opened="tagSearchIsOpened"
Expand All @@ -102,6 +109,7 @@ const deleteOrganizationTag = async () => {
/>
</BaseDrawer>
<ConfirmModal
data-test="confirm-delete-default-tag"
v-if="tagToDelete"
:title="$t('common.confirm-delete')"
content=""
Expand Down
10 changes: 7 additions & 3 deletions src/components/admin/TagClassificationAdmin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ref, watch, computed, nextTick } from 'vue'
import debounce from 'lodash.debounce'
import { getOrgClassificationTags, deleteClassificationTag } from '@/api/tag-classification.service'
import useOrganizationsStore from '@/stores/useOrganizations.ts'
import { refreshTokenGrantRequest } from '@panva/oauth4webapi'
import FilterSearchInput from '@/components/search/Filters/FilterSearchInput.vue'
import PaginationButtons from '@/components/base/navigation/PaginationButtons.vue'
import { axios } from '@/api/api.config'
Expand Down Expand Up @@ -104,7 +103,7 @@ const fetchTagStats = async () => {
}

const getTags = debounce(async function () {
isLoading.value = refreshTokenGrantRequest
isLoading.value = true
try {
//await new Promise((resolve) => setTimeout(resolve, 300 * 1000))
const axiosReq = await getOrgClassificationTags(
Expand Down Expand Up @@ -219,7 +218,7 @@ watch(() => [props.classification.value, search.value], getTags, { immediate: tr
</div>
</td>
</tr>
<tr v-else v-for="tag in tagResults" :key="tag.id">
<tr v-else v-for="tag in tagResults" :key="tag.id" data-test="tag-entry">
<td>
<strong>{{ tagTexts.title(tag) }}</strong>
</td>
Expand All @@ -230,19 +229,22 @@ watch(() => [props.classification.value, search.value], getTags, { immediate: tr
@click="editTag(tag)"
class="small"
action-icon="Pen"
data-test="edit-tag-button"
/>
<ContextActionButton
@click="tagToDelete = tag"
secondary
class="small"
action-icon="TrashCanOutline"
data-test="delete-tag-button"
/>
</div>
</td>
</tr>
</tbody>
</table>
<div
v-if="pagination.total > 1"
:style="{ visibility: (!isLoading && pagination.total > 1 && 'visible') || 'hidden' }"
class="pagination-container"
>
Expand All @@ -254,6 +256,7 @@ watch(() => [props.classification.value, search.value], getTags, { immediate: tr
/>
</div>
<EditTagModal
data-test="edit-tag-modal"
:is-open="editTagIsOpen"
:tag="editedTag"
:classification="classification"
Expand All @@ -262,6 +265,7 @@ watch(() => [props.classification.value, search.value], getTags, { immediate: tr
/>

<ConfirmModal
data-test="confirm-tag-delete-modal"
v-if="showConfirmTagDelete"
:asyncing="isDeletingTag"
@cancel="tagToDelete = null"
Expand Down
Loading