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

Features Icons in features panel #284

Open
wants to merge 172 commits into
base: develop
Choose a base branch
from

Conversation

LiranCaduri
Copy link
Contributor

@LiranCaduri LiranCaduri commented Feb 14, 2021

Icons for Features in Feature Panel.

The icons provided by Ionicons.

With every change to Feature Panel branch this branch will update as well.

Please comment on icons related things only.
if you want to comment on features panel related things there is a PR for that.

Thank you all!

FRONT (by @aviadamar):

  • Adding a Feature.html page.
  • Managing Add and remove features from panel using JS.
  • Adding a feature search box for feature panel.
  • CSS & HTML bug fixing and changes in calendar/month view.

This panel allows you to view optional add-ons. Add, remove or customize features to your liking by clicking on the features icon in the navigation bar.

…tests according to the new objects, Changing front to get information from Day objects, Re-arranging calendar.html grid stracture to be render by weeks, adding js functionality for day view section, adding css effects on daily event display
Copy link
Member

@yammesicka yammesicka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are all the tests? :)

app/main.py Outdated Show resolved Hide resolved
app/routers/features.py Show resolved Hide resolved
app/static/js/features.js Outdated Show resolved Hide resolved
app/static/js/grid_scripts.js Outdated Show resolved Hide resolved
app/templates/calendar_monthly_view.html Outdated Show resolved Hide resolved
app/templates/partials/base.html Outdated Show resolved Hide resolved
@LiranCaduri
Copy link
Contributor Author

Where are all the tests? :)

Tests are included and modified in the test_feature_panel.py, because it's an extension to the features panel :)

Comment on lines +104 to +108
if (!infoBox.classList.contains('info-box')) {
infoBox.classList.add('info-box');
} else {
infoBox.classList.remove('info-box');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

classList.toggle

@@ -116,7 +126,7 @@ async def is_access_allowd(request: Request, route: str) -> bool:
& (UserFeature.user_id == user.user_id),
),
).scalar()

print(user_feature)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

content='No additional settings for this one :)')

template = templates.get_template(
"partials/features_panels/" + template + '.html'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use fstrings & precommit hooks

@@ -384,6 +404,8 @@ main {
color: var(--primary);
}

.text-red {color: var(--negative)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use prettify

Comment on lines +5 to +9
if (elementsArray.includes(row)) {
return row.classList.remove("invisible");
} else {
return row.classList.add("invisible");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use classList.toggle

function searchFeature(searchValue, elements) {
const elementsArray = Array.from(elements);
const result = elementsArray.filter(element => {
return element.getElementsByClassName("row-feature-name")[0].innerHTML.toLowerCase().includes(searchValue);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Prefer innerText
  2. Split to lines

Comment on lines +24 to +33
'input', function (evt) {
const rows = document.getElementsByClassName("feature-row");
const value = evt.target.value.trim().toLowerCase();
if (!value) {
Array.from(rows).map(element => element.classList.remove("invisible"));
} else {
const result = searchFeature(value, rows);
displayResult(rows, result);
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Export the function to external function

Comment on lines +64 to +67
if (action === "ADD") {
return new URL('/features/add', url);
}
return new URL('/features/delete', url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move all the strings here to be constants


function appandFeatures(){
const baseURL = window.location.origin;
const route = new URL('/features/installed', baseURL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String should be a const

@@ -1,8 +1,9 @@
import pytest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests to achieve 100% coverage for this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants