-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add intro dialog #3571
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
base: develop
Are you sure you want to change the base?
feat: add intro dialog #3571
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ package api | |
|
|
||
| import ( | ||
| "errors" | ||
| "fmt" | ||
| "net/http" | ||
|
|
||
| "github.com/semaphoreui/semaphore/api/helpers" | ||
|
|
@@ -76,6 +77,17 @@ func (c *SystemInfoController) GetSystemInfo(w http.ResponseWriter, r *http.Requ | |
| plan = token.Plan | ||
| } | ||
|
|
||
| // Check if the user has seen the intro | ||
| seenIntroKey := fmt.Sprintf("seen_intro_%d", user.ID) | ||
| seenIntroVersion, err := helpers.Store(r).GetOption(seenIntroKey) | ||
| seenIntro := seenIntroVersion == util.Ver | ||
|
|
||
| if err != nil { | ||
| log.WithError(err).Error("Failed to get seen_intro option") | ||
| http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) | ||
| return | ||
| } | ||
|
Comment on lines
+85
to
+89
|
||
|
|
||
| body := map[string]any{ | ||
| "version": util.Version(), | ||
| "ansible": util.AnsibleVersion(), | ||
|
|
@@ -87,7 +99,33 @@ func (c *SystemInfoController) GetSystemInfo(w http.ResponseWriter, r *http.Requ | |
| "schedule_timezone": timezone, | ||
| "teams": util.Config.Teams, | ||
| "roles": roles, | ||
| "seen_intro": seenIntro, | ||
| } | ||
|
|
||
| helpers.WriteJSON(w, http.StatusOK, body) | ||
| } | ||
|
|
||
| func (c *SystemInfoController) SetSeenIntro(w http.ResponseWriter, r *http.Request) { | ||
| user := helpers.GetFromContext(r, "user").(*db.User) | ||
|
|
||
| var reqBody struct { | ||
| Version string `json:"version"` | ||
| } | ||
|
|
||
| if !helpers.Bind(w, r, &reqBody) { | ||
| return | ||
| } | ||
|
|
||
| seenIntroKey := fmt.Sprintf("seen_intro_%d", user.ID) | ||
|
|
||
| err := helpers.Store(r).SetOption(seenIntroKey, reqBody.Version) | ||
| if err != nil { | ||
| log.WithError(err).Error("Failed to set seen_intro option") | ||
| http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) | ||
| return | ||
| } | ||
|
|
||
| helpers.WriteJSON(w, http.StatusOK, map[string]string{ | ||
| "status": "ok", | ||
| }) | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,73 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <template> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <EditDialog | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| v-model="dialog" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| :max-width="1000" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hide-buttons | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| :expandable="true" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| no-body-paddings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @close="onClose()" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| test-id="introDialog" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| title="New release v2.17 🎉" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <template v-slot:form="{}"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <v-carousel> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <v-carousel-item> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </v-carousel-item> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <v-carousel-item> </v-carousel-item> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+13
to
+17
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <v-carousel> | |
| <v-carousel-item> | |
| </v-carousel-item> | |
| <v-carousel-item> </v-carousel-item> | |
| <v-carousel | |
| cycle | |
| hide-delimiter-background | |
| > | |
| <v-carousel-item> | |
| <v-container fluid> | |
| <v-row> | |
| <v-col cols="12"> | |
| <h2 class="text-h5 mb-4">What's new in v2.17</h2> | |
| </v-col> | |
| <v-col cols="12"> | |
| <ul class="mb-2"> | |
| <li>Improved job log viewer for large outputs.</li> | |
| <li>Faster project dashboard loading times.</li> | |
| <li>Enhanced secrets management and permissions.</li> | |
| </ul> | |
| <p class="mt-2 mb-0"> | |
| Explore these improvements in your existing projects, or create a new project to try them out. | |
| </p> | |
| </v-col> | |
| </v-row> | |
| </v-container> | |
| </v-carousel-item> | |
| <v-carousel-item> | |
| <v-container fluid> | |
| <v-row> | |
| <v-col cols="12"> | |
| <h2 class="text-h5 mb-4">Getting started & tips</h2> | |
| </v-col> | |
| <v-col cols="12"> | |
| <ul class="mb-2"> | |
| <li>Review your project settings to configure notifications and access control.</li> | |
| <li>Use templates to standardize common jobs across your team.</li> | |
| <li>Check the documentation for detailed upgrade notes for v2.17.</li> | |
| </ul> | |
| <p class="mt-2 mb-0"> | |
| You can reopen this dialog from the help menu if you want to review these notes later. | |
| </p> | |
| </v-col> | |
| </v-row> | |
| </v-container> | |
| </v-carousel-item> |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The component accepts 'projectId', 'itemId', 'template', and 'systemInfo' props that are never used. These props appear to be copied from a template or another component and should be removed to avoid confusion.
| projectId: Number, | |
| itemId: Number, | |
| systemInfo: Object, |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The watcher sets 'this.item' and 'this.template' to null, but these properties don't exist in the component's data object. This suggests incomplete refactoring from a template component.
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'loadData' method is called but never implemented. This will attempt to call an undefined method when the dialog value changes, potentially causing runtime errors.
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'model' data property is defined but never used in the component. This should be removed to keep the code clean.
| model: 0, |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no API call to persist that the user has seen the intro dialog. When the dialog is closed, the backend should be notified via the '/info/seen_intro' endpoint so the dialog doesn't show again on the next login.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'seenIntro' variable is calculated before checking if 'GetOption' returned an error. If an error occurs, 'seenIntroVersion' may be an empty string or other unexpected value, leading to incorrect comparison with 'util.Ver'. The calculation should happen after the error check, or a default value should be used on error.