Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Hermanek committed Dec 13, 2024
1 parent 0a31d86 commit f3e0fc8
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ NOTIFICATION_WEBSOCKET_URL=ws://notification-server.anzusystems.local/ws
COOKIES_REFRESH_TOKEN_EXISTS_NAME=anz_rte
COOKIES_JWT_PAYLOAD_NAME=anz_jp
LOGOUT_CORE_DAM_URL=http://core-dam.anzusystems.local/api/auth/logout
DAM_AUTHOR_CLEAN_PHRASE_TEST_SAMPLE="photo: Author Name / AgencyA - Photograph"
DAM_AUTHOR_CLEAN_PHRASE_TEST_SAMPLE=photo: Author Name / AgencyA - Photograph
5 changes: 5 additions & 0 deletions src/locales/en/breadcrumb.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
"job": {
"list": "Jobs",
"detail": "Job"
},
"authorCleanPhrase": {
"list": "Phrases",
"detail": "Phrase",
"edit": "Phrase"
}
},
"anzuUser": {
Expand Down
41 changes: 41 additions & 0 deletions src/locales/en/coreDam/authorCleanPhrase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"model": {
"id": "ID",
"phrase": "Phrase",
"authorReplacement": "Replace by author",
"type": "Type",
"mode": "Mode",
"position": "Position",
"flags": {
"wordBoundary": "Separate word"
}
},
"filter": {
"id": "ID",
"phrase": "Phrase",
"type": "Type",
"mode": "Mode"
},
"button": {
"create": "Create",
"playground": "Playground"
},
"meta": {
"playground": "Phrase testing",
"test": "Test"
},
"dto": {
"name": "Name",
"authorNames": "Author strings",
"authors": "Authors"
},
"mode": {
"split": "Split",
"remove": "Remove",
"replace": "Replace"
},
"type": {
"word": "Word",
"regex": "Regular expression"
}
}
3 changes: 2 additions & 1 deletion src/locales/en/error/apiValidation.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"error_invalid_key": "error_invalid_key error",
"error_invalid_licence": "error_invalid_licence error"
"error_invalid_licence": "error_invalid_licence error",
"error_invalid_ext_system": "error_invalid_ext_system error"
}
3 changes: 2 additions & 1 deletion src/locales/en/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"distributionCategorySelect": "Distribution Categories Selects",
"log": "Logs",
"beta": "Beta",
"job": "System jobs"
"job": "System jobs",
"authorCleanPhrase": "Author clean"
}
}
4 changes: 3 additions & 1 deletion src/locales/sk/coreDam/authorCleanPhrase.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
},
"filter": {
"id": "ID",
"phrase": "Fráza"
"phrase": "Fráza",
"type": "Typ frázy",
"mode": "Operácia frázy"
},
"button": {
"create": "Vytvoriť",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/sk/error/apiValidation.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"error_invalid_key": "Neplatný kľúč.",
"error_invalid_licence": "Neplatná licencia."
"error_invalid_licence": "Neplatná licencia.",
"error_invalid_ext_system": "Neplatný externý systém"
}
6 changes: 6 additions & 0 deletions src/model/coreDam/filter/AuthorCleanPhraseFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ const filter = reactive({
phrase: {
...makeFilter({ name: 'phrase' }),
},
mode: {
...makeFilter({ name: 'mode' }),
},
type: {
...makeFilter({ name: 'type' }),
},
})

export function useAuthorCleanPhraseListFilter() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<script lang="ts" setup>
import { ARow } from '@anzusystems/common-admin'
import { ABooleanValue, ACopyText, ARow, AUserAndTimeTrackingFields } from '@anzusystems/common-admin'
import { useI18n } from 'vue-i18n'
import { storeToRefs } from 'pinia'
import { useRouter } from 'vue-router'
import { useAuthorCleanPhraseOneStore } from '@/stores/coreDam/authorCleanPhraseStore'
import AuthorRemoteAutocompleteCachedAuthorChip
from '@/views/coreDam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue'
import AuthorCleanPhraseModeChip from '@/views/coreDam/authorCleanPhrase/components/AuthorCleanPhraseModeChip.vue'
import AuthorCleanPhraseTypeChip from '@/views/coreDam/authorCleanPhrase/components/AuthorCleanPhraseTypeChip.vue'
const { authorCleanPhrase } = storeToRefs(useAuthorCleanPhraseOneStore())
Expand All @@ -26,23 +28,37 @@ const router = useRouter()
>
<AuthorRemoteAutocompleteCachedAuthorChip :id="authorCleanPhrase.authorReplacement"/>
</ARow>

<ARow
:title="t('coreDam.authorCleanPhrase.model.type')"
:value="authorCleanPhrase.type"
/>
>
<AuthorCleanPhraseTypeChip
:type="authorCleanPhrase.type"
/>
</ARow>
<ARow
:title="t('coreDam.authorCleanPhrase.model.mode')"
:value="authorCleanPhrase.mode"
/>
<ARow
:title="t('coreDam.authorCleanPhrase.model.flags.wordBoundary')"
:value="authorCleanPhrase.flags.wordBoundary"
/>
>
<AuthorCleanPhraseModeChip
:mode="authorCleanPhrase.mode"
/>
</ARow>
<ARow :title="t('coreDam.authorCleanPhrase.model.flags.wordBoundary')">
<ABooleanValue
chip
:value="authorCleanPhrase.flags.wordBoundary"
/>
</ARow>
<ARow
:title="t('coreDam.authorCleanPhrase.model.position')"
:value="authorCleanPhrase.position"
/>
</VCol>

<VCol cols="4">
<ARow :title="t('coreDam.authorCleanPhrase.model.id')">
<ACopyText :value="authorCleanPhrase.id" />
</ARow>
<AUserAndTimeTrackingFields :data="authorCleanPhrase" />
</VCol>
</VRow>
</template>
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script lang="ts" setup>
import { useAuthorCleanPhraseListFilter } from '@/model/coreDam/filter/AuthorCleanPhraseFilter'
import { AFilterString, AFilterWrapper } from '@anzusystems/common-admin'
import { AFilterString, AFilterValueObjectOptionsSelect, AFilterWrapper } from '@anzusystems/common-admin'
import { ref } from 'vue'
import { useAuthorCleanPhraseTypeTypes } from '@/model/coreDam/valueObject/AuthorCleanPhraseType'
import { useAuthorCleanPhraseModeTypes } from '@/model/coreDam/valueObject/AuthorCleanPhraseMode'
const emit = defineEmits<{
(e: 'submitFilter'): void
Expand All @@ -24,6 +26,9 @@ const resetFilter = () => {
const onAnyFilterUpdate = () => {
touched.value = true
}
const { authorCleanPhraseTypeOptions } = useAuthorCleanPhraseTypeTypes()
const { authorCleanPhraseModeOptions } = useAuthorCleanPhraseModeTypes()
</script>

<template>
Expand All @@ -36,18 +41,32 @@ const onAnyFilterUpdate = () => {
@reset-filter="resetFilter"
>
<VRow align="start">
<VCol cols="4">
<VCol cols="3">
<AFilterString
v-model="filter.id"
@update:model-value="onAnyFilterUpdate"
/>
</VCol>
<VCol cols="4">
<VCol cols="3">
<AFilterString
v-model="filter.phrase"
@update:model-value="onAnyFilterUpdate"
/>
</VCol>
<VCol cols="3">
<AFilterValueObjectOptionsSelect
v-model="filter.type"
:items="authorCleanPhraseTypeOptions"
@update:model-value="onAnyFilterUpdate"
/>
</VCol>
<VCol cols="3">
<AFilterValueObjectOptionsSelect
v-model="filter.mode"
:items="authorCleanPhraseModeOptions"
@update:model-value="onAnyFilterUpdate"
/>
</VCol>
</VRow>
</AFilterWrapper>
</VForm>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { AChipNoLink } from '@anzusystems/common-admin'
import {
type AuthorCleanPhraseModeType,
useAuthorCleanPhraseModeTypes
} from '@/model/coreDam/valueObject/AuthorCleanPhraseMode'
const props = withDefaults(
defineProps<{
mode: AuthorCleanPhraseModeType
}>(),
{}
)
const { getAuthorCleanPhraseModeOption } = useAuthorCleanPhraseModeTypes()
const statusOption = computed(() => {
return getAuthorCleanPhraseModeOption(props.mode)
})
</script>

<template>
<AChipNoLink v-if="statusOption">
{{ statusOption.title }}
</AChipNoLink>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script lang="ts" setup>
import { computed } from 'vue'
import { AChipNoLink } from '@anzusystems/common-admin'
import {
type AuthorCleanPhraseTypeType,
useAuthorCleanPhraseTypeTypes
} from '@/model/coreDam/valueObject/AuthorCleanPhraseType'
const props = withDefaults(
defineProps<{
type: AuthorCleanPhraseTypeType
}>(),
{}
)
const { getAuthorCleanPhraseTypeOption } = useAuthorCleanPhraseTypeTypes()
const statusOption = computed(() => {
return getAuthorCleanPhraseTypeOption(props.type)
})
</script>

<template>
<AChipNoLink v-if="statusOption">
{{ statusOption.title }}
</AChipNoLink>
</template>

0 comments on commit f3e0fc8

Please sign in to comment.