Closed igorsimb closed 3 months ago
Would be nice to have an easy ability for user to give feedback.
is_demo_user
) to track demo users.
demo_user_UUID
.is_demo_user
to True for the demo user.is_demo_user
to True
.
demo_user
.
is_demo_user=False
.We can create a separate view that creates a user and logs in, something like in Ez2Task (except creating a user first)
def demo_user_login_view(request):
demo_user = authenticate(email=str(os.getenv('LOGIN_DEMO_KEYS')), password=str(os.getenv('PASSWORD_DEMO_KEYS')))
login(request, demo_user)
return redirect('main')
For arrows we can use these: https://devsnap.me/css-arrows https://freefrontend.com/css-arrows/
Use onboarding tooltips to explain the interface: https://userpilot.com/blog/onboarding-tooltips-saas/ Seems to be the one to go: https://useronboarding.academy/post/tooltip
https://shepherdjs.dev/ is my favorite out of them.
static
folderbase.html
, e.g. <script src="{% static 'js/shepherd.min.js' %}"></script>
Example of use of highlightClass
: https://github.com/search?q=repo%3Ashepherd-pro%2Fshepherd+highlightClass&type=code (change highlightClass
to anything to see use examples)
https://docs.celeryq.dev/en/stable/userguide/periodic-tasks.html#entries For example, celery.py:
from datetime import timedelta
...
def setup_periodic_tasks(sender, **kwargs):
# Calls say_hi every 10 seconds
sender.add_periodic_task(timedelta(seconds=10), say_hi, name='say hi every 10')
@app.task
def say_hi():
print("Hello from Celery to Igor!")
And the actual task could be something like this:
@app.task
def check_expired_demo_users():
users_to_check = user.objects.filter(is_demo_user=True)
for user_to_check in users_to_check:
if not user_to_check.is_active_demo_user:
user_to_check.is_demo_active = False
# setting user to inactive will log them out - useful for prod
# user_to_check.is_active = False
user_to_check.save()
print(f"{user_to_check.is_demo_active=} ({user_to_check=})")
else:
print(f"Demo not yet expired for {user_to_check}")
How to display tour only once: https://yonkov.github.io/post/display-shepherd-only-once/
Добро пожаловать в Демо! Здесь мы ознакомимся с основными элементами интерфейса, запустим наш первый парсинг и создадим автоматическое расписание. Демо имеет определенные ограничения.
+
Тут мы можем добавить новые товары для парсинга. Нужен артикул товара. Например, добавить эти
<...>
или можете добавить любые свои. Максимум 10. После этого нажмите на "Добавить" (proceed after clicking)
Здесь видны все ваши товары, а также их текущая цена на Wildberries, разница с предыдущим парсингом (на данный разницы нет, т.к. это наш первый парсинг) и время последнего обновления.
Здесь переключаемся между ручным обновлением и созданием автоматического расписания (об этом чуть позже).
(просим выделить несколько товаров и кликнуть "Обновить вручную") - proceed after clicking.
Отлично! Мы видим, что дата последнего обновления изменилась.
(выделить несколько товаров и запустить расписание (proceed after clicking).
Отлично! Здесь видно текущее расписание, а также дата следующего парсинга.
На этом мы закончим наш тур. Вы можете кликнуть на любой артикул и получить более подробную информацию о товаре, например, историю цен, которые вы парсили.
You can achieve this by using session storage or cookies to track the state of the tour across page reloads. Here's a simple example of how you might do it with session storage:
// Initialize the tour
var tour = new Shepherd.Tour({
defaultStepOptions: {
cancelIcon: {
enabled: true
}
}
});
// Add your steps
tour.addSteps([
{
id: 'step1',
text: 'This is step 1',
// other options...
},
{
id: 'step2',
text: 'This is step 2',
// other options...
},
{
id: 'step3',
text: 'This is step 3',
// other options...
}
]);
// Check session storage to see where to start the tour
var currentStep = sessionStorage.getItem('currentStep');
if (currentStep) {
tour.show(currentStep);
} else {
tour.start();
}
// Listen for the 'complete' event and clear the session storage
tour.on('complete', function() {
sessionStorage.removeItem('currentStep');
});
// Listen for the 'show' event and update the session storage
tour.on('show', function() {
sessionStorage.setItem('currentStep', tour.getCurrentStep().id);
});
In this example, the currentStep
is stored in the session storage every time a new step is shown. If the page is reloaded, the tour will start from the step stored in the session storage. If the tour is completed, the currentStep
is removed from the session storage.
Please note that this is a simple example and might not cover all edge cases. You might need to adjust it to fit your specific needs. Also, be aware that session storage is cleared when the page session ends. If you need to persist the tour state across multiple sessions, consider using cookies or localStorage instead.
I hope this helps! Let me know if you have any other questions. 😊
TaskForm
for the user (max 10-50 SKUs)ScrapeIntervalForm
for the user: