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

tags: add ability to copy tags from another family #8757

Merged
merged 2 commits into from
Dec 19, 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
30 changes: 30 additions & 0 deletions .ci/tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,22 @@
<button class="join-item btn btn-xs">Add</button>
</div>
</form>
<div class="divider"></div>
<form @submit.prevent="copyFamily">
<div class="label lavel-xs">
<span class="label-text label-xs">Copy tags from a family</span>
</div>
<div class="join">
<input class="join-item input input-xs input-bordered" list="items" v-model="fromFamily" required placeholder="From Family">
<input class="join-item input input-xs input-bordered" list="items" v-model="toFamily" required placeholder="To Family">
<datalist id="items">
<option v-for="family in uniqueFamilies" :value="family">
</datalist>
<button class="join-item btn btn-xs">Copy</button>
</div>
</form>
</div>

<div class="divider"></div>

<div class="panel-tile" style="max-height: 100px; overflow: scroll;">
Expand Down Expand Up @@ -154,6 +169,8 @@
newTag: "",
newFamily: '',
newWeight: '',
fromFamily: "",
toFamily: "",
CurrentCategory: "/Expressive/Calm",
Categories: new Set(),
Families: [],
Expand Down Expand Up @@ -317,6 +334,19 @@

this.history.push(`+ ${newFamily.Family},${newFamily["Group/Tag"]},${newFamily.Weight}`);
},
copyFamily() {
this.isEdited = true;
let fromTags = this.Families.filter(family => family.Family === this.fromFamily);
if (fromTags.length === 0) {
alert(`No tags found for Family "${this.toFamily}"`);
return;
}
fromTags.forEach((tag) => {
let newTag = {Family: this.toFamily, "Group/Tag": tag["Group/Tag"], Weight: tag.Weight};
this.Families.push(newTag);
this.history.push(`+ ${newTag.Family},${newTag["Group/Tag"]},${newTag.Weight}`);
})
},
AddPlaceHolderTags() {
this.isEdited = true;
const existingTags = this.sortedFamilies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
python-version: ['3.10']
os: [windows-latest, macos-13, ubuntu-latest]
os: [windows-latest, macos-13, ubuntu-22.04]
steps:
- name: Cancel previous
uses: styfle/[email protected]
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:

diffenator:
name: Diffenate fonts
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
continue-on-error: true

steps:
Expand Down
Loading