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

album tag counter #887

Merged
merged 8 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixed lint
ToMaarton committed Oct 15, 2024
commit acf65a9720a9ba0de0bdc6c421bac7a9af91852f
8 changes: 4 additions & 4 deletions app/components/cards/photo-album-card.hbs
Original file line number Diff line number Diff line change
@@ -12,10 +12,10 @@
<h3 class='card-subtitle'>{{moment-format album.date 'DD-MM-YYYY'}}</h3>
</div>
{{#if album.amountOfTags}}
<span class='album-tag-counter badge bg-info bottom-0 end-0'>
<FaIcon @icon='tag' />
{{album.amountOfTaggedPhotos}}/{{album.amountOfPhotos}}
</span>
<span class='album-tag-counter badge bg-info bottom-0 end-0'>
<FaIcon @icon='tag' />
{{album.amountOfTaggedPhotos}}/{{album.amountOfPhotos}}
</span>
{{/if}}
</div>
</div>
26 changes: 14 additions & 12 deletions app/models/photo-album.js
Original file line number Diff line number Diff line change
@@ -36,21 +36,23 @@
}

get amountOfTags() {
var counter = 0
for(var photo of this.photos._objects){
counter += photo.amountOfTags
}
return counter
var counter = 0;
for (var photo of this.photos._objects) {
counter += photo.amountOfTags;

Check warning on line 41 in app/models/photo-album.js

Codecov / codecov/patch

app/models/photo-album.js#L39-L41

Added lines #L39 - L41 were not covered by tests
}
return counter;

Check warning on line 43 in app/models/photo-album.js

Codecov / codecov/patch

app/models/photo-album.js#L43

Added line #L43 was not covered by tests
}
get amountOfTaggedPhotos() {
var counter = 0
for(var photo of this.photos._objects){
counter += photo.amountOfTags>0? 1 : 0
}
return counter

get amountOfTaggedPhotos() { //not used anymore

Check failure on line 46 in app/models/photo-album.js

GitHub Actions / Lint

Insert `⏎···`
var counter = 0;
for (var photo of this.photos._objects) {
counter += photo.amountOfTags>0? 1 : 0;

Check failure on line 49 in app/models/photo-album.js

GitHub Actions / Lint

Replace `>0` with `·>·0·`

Check warning on line 49 in app/models/photo-album.js

Codecov / codecov/patch

app/models/photo-album.js#L47-L49

Added lines #L47 - L49 were not covered by tests
}
return counter;

Check warning on line 51 in app/models/photo-album.js

Codecov / codecov/patch

app/models/photo-album.js#L51

Added line #L51 was not covered by tests
}

get amountOfPhotos() {
return this.photos.length
return this.photos.length;

Check warning on line 55 in app/models/photo-album.js

Codecov / codecov/patch

app/models/photo-album.js#L55

Added line #L55 was not covered by tests
}

// Methods
2 changes: 1 addition & 1 deletion app/styles/components/cards/photo-album-card.scss
Original file line number Diff line number Diff line change
@@ -23,8 +23,8 @@
.album-tag-counter {
position: absolute;
bottom: 0;
margin-bottom: 1rem;
margin-right: 15px;
margin-bottom: 1rem;
padding-left: 5px;
}
}
1 change: 0 additions & 1 deletion app/styles/routes/photos.scss
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
bottom: 0;
margin-bottom: 1rem;
margin-left: 15px;
margin-right: 15px;
padding-left: 5px;
}


Unchanged files with check annotations Beta

import Component from '@ember/component';

Check warning on line 1 in app/components/advertisement-tool.js

GitHub Actions / Lint

Use Glimmer components(@glimmer/component) instead of classic components(@ember/component)
import { inject as service } from '@ember/service';
import { computed } from '@ember/object';
export default Component.extend({

Check warning on line 5 in app/components/advertisement-tool.js

GitHub Actions / Lint

Native JS classes should be used instead of classic classes

Check warning on line 5 in app/components/advertisement-tool.js

GitHub Actions / Lint

Please switch to a tagless component by setting `tagName: ''` or converting to a Glimmer component
classNames: ['advertisement-tool'],
media: service(),
advertisements: computed(
import Component from '@ember/component';

Check warning on line 1 in app/components/boolean-tag.js

GitHub Actions / Lint

Use Glimmer components(@glimmer/component) instead of classic components(@ember/component)
import { computed } from '@ember/object';
const BooleanTagComponent = Component.extend({

Check warning on line 4 in app/components/boolean-tag.js

GitHub Actions / Lint

Native JS classes should be used instead of classic classes
tagName: 'span',

Check warning on line 5 in app/components/boolean-tag.js

GitHub Actions / Lint

Please switch to a tagless component by setting `tagName: ''` or converting to a Glimmer component
classNames: ['badge'],
classNameBindings: ['value:bg-success:bg-danger'],
label: computed('value', function () {
import Component from '@ember/component';

Check warning on line 1 in app/components/cards/activity-card.js

GitHub Actions / Lint

Use Glimmer components(@glimmer/component) instead of classic components(@ember/component)
const ActivityCardComponent = Component.extend({

Check warning on line 3 in app/components/cards/activity-card.js

GitHub Actions / Lint

Native JS classes should be used instead of classic classes

Check warning on line 3 in app/components/cards/activity-card.js

GitHub Actions / Lint

Please switch to a tagless component by setting `tagName: ''` or converting to a Glimmer component
moreInfo: false,
});
import { inject as service } from '@ember/service';
import Component from '@ember/component';

Check warning on line 2 in app/components/cards/article-card.js

GitHub Actions / Lint

Use Glimmer components(@glimmer/component) instead of classic components(@ember/component)
const ArticleCardComponent = Component.extend({
session: service('session'),