Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamic panel editor enhancements #358

Merged
merged 1 commit into from
Jul 29, 2024
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
3 changes: 1 addition & 2 deletions public/StorylinesSlideSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@
"description": "The panels to display dynamically.",
"items": {
"$ref": "#/$defs/dynamicChildItem"
},
"minItems": 1
}
},
"type": {
"type": "string",
Expand Down
20 changes: 16 additions & 4 deletions src/components/dynamic-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@
<td>{{ determineEditorType(item.panel) }}</td>
<td>
<span @click="() => switchSlide(idx)">{{ $t('editor.chart.label.edit') }}</span> |
<span @click="() => removeSlide(item, idx)">{{ $t('editor.remove') }}</span>
<span @click="$vfm.open(`delete-item-${idx}`)">{{ $t('editor.remove') }}</span>
</td>

<confirmation-modal
:name="`delete-item-${idx}`"
:message="$t('dynamic.panel.remove')"
@ok="() => removeSlide(item as any, idx)"
/>
</tr>
<tr class="table-add-row">
<th class="flex flex-col items-center">
Expand All @@ -54,7 +60,11 @@
</option>
</select>
</th>
<th><button class="editor-button" @click="createNewSlide" :disabled="idUsed">Add New</button></th>
<th>
<button class="editor-button" @click="createNewSlide" :disabled="idUsed || !newSlideName">
{{ $t('dynamic.panel.add') }}
</button>
</th>
</tr>
</table>

Expand Down Expand Up @@ -105,6 +115,7 @@ import TextEditorV from './text-editor.vue';
import MapEditorV from './map-editor.vue';
import VideoEditorV from './video-editor.vue';
import SlideshowEditorV from './slideshow-editor.vue';
import ConfirmationModalV from './helpers/confirmation-modal.vue';

@Options({
components: {
Expand All @@ -114,7 +125,8 @@ import SlideshowEditorV from './slideshow-editor.vue';
'slideshow-editor': SlideshowEditorV,
'dynamic-editor': DynamicEditorV,
'map-editor': MapEditorV,
'video-editor': VideoEditorV
'video-editor': VideoEditorV,
'confirmation-modal': ConfirmationModalV
}
})
export default class DynamicEditorV extends Vue {
Expand Down Expand Up @@ -252,7 +264,7 @@ export default class DynamicEditorV extends Vue {
}
}

if (index) {
if (index !== undefined) {
// Remove the panel itself.
this.panel.children = this.panel.children.filter((panel: DynamicChildItem, idx: number) => idx !== index);

Expand Down
4 changes: 3 additions & 1 deletion src/lang/lang.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ dynamic.panel.collection,Panel Collection,1,Collection de panneaux,1
dynamic.panel.id,Panel ID,1,No d’identification du panneau,1
dynamic.panel.type,Panel Type,1,Type de panneaux,1
dynamic.panel.actions,Panel Actions,1,Actions du panneau,1
dynamic.panel.idTaken,Panel ID is already,1,Le nom du panneau est déjà utilisé,1
dynamic.panel.idTaken,Panel ID is already in use,1,Le nom du panneau est déjà utilisé,1
dynamic.panel.editor,Panel Editor:,1,Éditeur de panneaux:,1
dynamic.panel.remove,Are you sure you want to remove this panel?,1,Etes-vous sûr de vouloir supprimer ce panneau?,0
dynamic.panel.add,Add New,1,Ajouter un nouveau,0
timeslider.expand,Expand,1,Développer,1
timeslider.minimize,Minimize,1,Réduire,1
timeslider.play,Play,1,Lecture,1
Expand Down
Loading