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

Added option to @Everyone in DingTalk notification method #4712

Closed
wants to merge 11 commits into from
Closed

Added option to @Everyone in DingTalk notification method #4712

wants to merge 11 commits into from

Conversation

niujinkai
Copy link
Contributor

⚠️⚠️⚠️ Since we do not accept all types of pull requests and do not want to waste your time. Please be sure that you have read pull request rules:
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma

Tick the checkbox if you understand [x]:

  • I have read and understand the pull request rules.

Description

Added option to @everyone in DingTalk notification method

Type of change

Please delete any options that are not relevant.

  • User interface (UI)
  • Other

Checklist

  • My code follows the style guidelines of this project
  • I ran ESLint and other linters for modified files
  • I have performed a self-review of my own code and tested it
  • I have commented my code, particularly in hard-to-understand areas (including JSDoc for methods)
  • My changes generates no new warnings
  • My code needed automated testing. I have added them (this is optional task)

Screenshots (if any)

Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.

@niujinkai niujinkai changed the base branch from master to 1.23.X April 26, 2024 13:34
@niujinkai
Copy link
Contributor Author

The writing may not be correct. Please help to check. But according to the official DingTalk documentation, the parameters and fields are correct. Thank you very much.

@CommanderStorm CommanderStorm changed the base branch from 1.23.X to master April 26, 2024 14:48
Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

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

  • see inline comments
  • please attach screenshots of the reelvant events and this change
  • please fix the linting errors

.github/workflows/npm-grunt.yml Outdated Show resolved Hide resolved
@@ -6,11 +6,14 @@
<label for="secretKey" class="form-label">{{ $t("SecretKey") }}<span style="color: red;"><sup>*</sup></span></label>
<input id="secretKey" v-model="$parent.notification.secretKey" type="text" class="form-control" required>

<label for="isAtAll" class="form-label">{{ $t("isAtAll") }}<span style="color: red;"><sup>*</sup></span></label>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change this to a selection box with the options Don't mention people, Notify <code>@everyone</code> (see https://vue-i18n.intlify.dev/guide/advanced/component.html)
With a selection box, implemneting things like @userId is possible (=> "future-proof")

server/notification-providers/dingding.js Outdated Show resolved Hide resolved
server/notification-providers/dingding.js Outdated Show resolved Hide resolved
@niujinkai

This comment was marked as resolved.

dependabot bot and others added 2 commits April 26, 2024 17:02
Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.28.3...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
src/lang/zh-CN.json Outdated Show resolved Hide resolved
.github/workflows/npm-grunt.yml Outdated Show resolved Hide resolved
.github/workflows/npm-grunt.yml Outdated Show resolved Hide resolved
@niujinkai
Copy link
Contributor Author

What else needs to be adjusted?

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

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

I think there was some misunderstanding what I meant in #4712 (comment)

Could you add the screenshots of the notification provider working as intended to ensure that this works as intended? ^^

Comment on lines +9 to +13
<label for="isAtAll" class="form-label">{{ $t("isAtAll") }}<span style="color: red;"><sup>*</sup></span></label>
<select id="isAtAll" v-model="$parent.notification.isAtAll" class="form-select" required>
<option value="false">{{ $t("false") }}</option>
<option value="true">{{ $t("true") }}</option>
</select>
Copy link
Collaborator

Choose a reason for hiding this comment

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

What I meant was something like this, but

  • with the respective translations in en.json,
  • the respective changes to dingding.js and
  • testing that I did not make a typo in the github webeditor ^^^

What do you think about the label? Is this self-explaiantory enough? Do we need to add an helptext? (would not know what to put there, but still would like to have your oppinon on this one)

Suggested change
<label for="isAtAll" class="form-label">{{ $t("isAtAll") }}<span style="color: red;"><sup>*</sup></span></label>
<select id="isAtAll" v-model="$parent.notification.isAtAll" class="form-select" required>
<option value="false">{{ $t("false") }}</option>
<option value="true">{{ $t("true") }}</option>
</select>
<label for="metioning" class="form-label">{{ $t("Mentioning") }}<span style="color: red;"><sup>*</sup></span></label>
<select id="metioning" v-model="$parent.notification.metioning" class="form-select" required>
<option value="nobody">{{ $t("Don't mention people") }}</option>
<i18n-t keypath="Notify everyone" tag="option" value="@everyone">
<code>@everyone</code>
</i18n-t>
</select>

Comment on lines +456 to +458
"isAtAll":"是否通知所有人",
"true":"是",
"false":"否",
Copy link
Collaborator

Choose a reason for hiding this comment

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

To prevent merge conflicts with weblate (more painfull than worth it), we only allow adding translation keys in en.json.
Please translate this after the PR is merged on weblate.kuma.pet

Suggested change
"isAtAll":"是否通知所有人",
"true":"",
"false":"",

@niujinkai niujinkai closed this Apr 26, 2024
@CommanderStorm
Copy link
Collaborator

?

@niujinkai
Copy link
Contributor Author

?

I feel that I have changed the problem, intend to re-comb the next, and then re-submit, thank you very much for your support!

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.

3 participants