من المستحيل إضافة القيمة “-1” لأنها لا تسجل “-”.
إعجاب واحد (1)
يمكنني تكرار هذا. كانت هناك مشكلة مماثلة مع إعداد آخر في اليوم الآخر. دعني أرى ما إذا كان بإمكاني جعل شخص ما يلقي نظرة.
يبدو أن المشكلة تم تقديمها هنا:
main ← dev/integer-site-setting-fields
opened 02:48PM - 06 Oct 23 UTC
### What is this change?
Currently, if you set an integer site setting in the… admin interface and include thousands separators, you will silently configure the wrong value.
**Example:**
```
1,000 == 1
1.000 == 1
1 000 == 1
```
This PR replaces `TextField` inputs for integer site settings with `NumberField`.
It also cleans the numeric input of any non-digits in the backend in case any separators make it through.
### Not in this PR
- The actual value that is set in the back-end is not sent back to the front-end. We probably should.
- We should probably change the latter to use [native number input](https://caniuse.com/input-number) in a separate PR.
- The `SiteSettingsController#update` method is pretty big. I'm considering extracting the logic into a Ruby object that can be tested in isolation, but not in this PR.
ومن المحتمل أن تكون مرتبطة بعدم توفير @min= هنا:
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/admin/addon/components/site-settings/integer.hbs
تم اختبار هذا ويبدو أن هناك مشكلة في إدخال النص لسطح المكتب، لسبب ما لن يكتب “-” في تلك الإعدادات، ولكنه يعمل بشكل جيد على تطبيق الهاتف المحمول ويمكن ببساطة نسخ/لصق “-” في الإعداد لذلك ويعمل حينها.
استخدمت 0 وكان ذلك ناجحًا أيضًا.
حسنًا، إذا كان الإعداد عند الصفر، فهل هذا يعني أنه لا يزال بإمكان الحسابات حذف نفسها طالما لا توجد منشورات؟ سالب واحد يختلف عن الصفر.
نعم، بعد استخدامي لـ “0” تم تعطيل حذف الحسابات ذاتية الخدمة لجميع المستخدمين.
بالنسبة لي، لا يزال هناك خيار للمستخدم لحذف حسابه إذا لم يكن قد نشر أي مشاركات عندما يتم تعيين هذا الإعداد على صفر.
لقد أنشأت للتو حساب مستخدم وهمي، بدون أي منشورات، ويظهر خيار “حذف حسابي” بالقيمة “0”.
بعد إنشاء منشور واحد من الحساب الوهمي، اضطررت إلى تسجيل الخروج وتسجيل الدخول مرة أخرى، ثم اختفى خيار “حذف حسابي”. لذا، نعم، نحن بحاجة إلى القدرة على إدخال “-1” لتعطيل الحذف الذاتي للحساب لجميع المستخدمين بما في ذلك المستخدمون الذين لديهم 0 منشورات.
إعجاب واحد (1)
martin
(Martin Brennan)
16 نوفمبر 2023، 2:12ص
13
الإصلاح لهذا سيكون هنا، يجب دمجه لاحقًا اليوم:
main ← dev/fix-min-max-for-number-field
opened 02:08AM - 16 Nov 23 UTC
When we started using NumberField for integer site settings
in e113eff6634c9b39… 8b0541ea6a0d1626f6732dcc, we did not end up
passing down a min/max value for the integer to the field, which
meant that for some fields where negative numbers were allowed
we were not accepting that as valid input.
This commit passes down the min/max options from the server for
integer settings then in turn passes them down to NumberField.
c.f. https://meta.discourse.org/t/delete-user-self-max-post-count-not-accepting-1-to-disable/285162
4 إعجابات
تم إغلاق هذا الموضوع تلقائيًا بعد يومين. لم يعد يُسمح بالردود الجديدة.