-
Notifications
You must be signed in to change notification settings - Fork 112
feat: Add support for project titles #2470
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: master
Are you sure you want to change the base?
Conversation
741e134
to
e2ff38f
Compare
/ok-to-test |
a4ab6d6
to
9f26762
Compare
<v-tooltip | ||
activator="parent" | ||
location="top" | ||
> | ||
{{ selectedProjectTitle }} | ||
</v-tooltip> |
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.
Since project titles longer than 10 characters can be used, the text can be truncated with an ellipsis if too long. Therefore, a tooltip is added to be able to inspect the entire title if necessary.
width: 153px !important; | ||
text-align: left !important; | ||
overflow: hidden; | ||
white-space: nowrap; | ||
text-overflow: ellipsis; |
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.
A fixed width or max width is required so that the element cuts off overflowing text with the ellipsis.
Even on a widescreen, the element does not grow larger than the previously configured min-width: 153px
.
Could you add some screenshots |
:deep(.v-list-item__prepend > .v-list-item__spacer) { | ||
width: 16px; | ||
} |
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.
9f26762
to
b76d410
Compare
@grolu Added to the PR description :) |
b76d410
to
4d3be08
Compare
f4af4f8
to
20967fa
Compare
97cef3a
to
310816f
Compare
310816f
to
451e222
Compare
451e222
to
d4f0b98
Compare
- create project dialog - edit project Signed-off-by: klocke-io <[email protected]>
Signed-off-by: klocke-io <[email protected]>
d4f0b98
to
9e2839f
Compare
Signed-off-by: klocke-io <[email protected]>
Looking at the screenshots, I have some concerns. The way the technical name is replaced with the title makes it unclear whether the currently displayed label is the title or the technical name. This can easily confuse users or even mislead them into selecting a project that looks legitimate but is actually incorrect or misleading — essentially a "honeypot" project. I suggest keeping the technical name as it is and displaying the project title (if available) on a second line. If no title is set, that line can remain empty. The owner could move to a third line, or we might consider removing it from the main menu entirely — this should be discussed further. Another option would be a complete overhaul of the project selection or introducing a new project selection page (e.g., in table format). |
Isn't there some chance to strike a middle ground here? Right now it already changes color which amusingly in my eyes upgrades it visually. I find the current prominent presentation of the project name in its limitations weird. It's the identifier, so it must be presented. But it feels wrong to tell anyone that their |
Sure, as I already pointed out in the kickoff call, this is the main challenge :) |
Ideas how to solve this:
Obviously all of those are tradeoffs, given the intend of this change is to allow removing the project name from the center of presentation. This will inherently reduce visual uniqueness and increase risks of impersonation. |
:counter="counter" | ||
:maxlength="maxLength" |
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.
I get the following warnings in the browser console:
Invalid prop: type check failed for prop "counter". Expected Boolean, got String with value "true".
at <GEditableText read-only=false color="action-button" model-value="core" ... >
Invalid prop: type check failed for prop "maxLength". Expected Number with value 64, got String with value "64".
<v-tooltip | ||
activator="parent" | ||
location="top" | ||
text="Technical, unique project name." | ||
/> | ||
</v-text-field> |
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.
instead of a tooltip, use hint
prop on text-field
<v-tooltip | ||
activator="parent" | ||
location="top" | ||
text="Human-readable project title." | ||
/> | ||
</v-text-field> |
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.
instead of a tooltip, use hint
prop on text-field
@@ -26,7 +26,12 @@ SPDX-License-Identifier: Apache-2.0 | |||
</v-icon> | |||
</template> | |||
<div class="text-body-2 text-medium-emphasis"> | |||
Name | |||
<span>Name</span> | |||
<v-tooltip |
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 tooltip is misaligned. It should be displayed for the span, not for the parent div
</template> | ||
<div class="text-body-2 text-medium-emphasis"> | ||
<span>Title</span> | ||
<v-tooltip |
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 tooltip is misaligned. It should be displayed for the span, not for the parent div
@@ -522,6 +553,8 @@ import { | |||
getDateFormatted, | |||
} from '@/utils' | |||
import { errorDetailsFromError } from '@/utils/error' | |||
import { annotations } from '@/utils/annotations.js' |
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.
this comment is not related to this particuluar line:
The confirm project deletion popup only shows the name, same for the GRemoveProjectMember and maybe others?
import { maxLength } from '@vuelidate/validators' | ||
|
||
export function truncateProjectTitle (title, maxLength = 64) { | ||
if (title.length > maxLength) { |
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.
should the title also be trimmed (e.g. leading and trailing whitespace)? rather move this function to the project helper composable (see other comment)
const selectedProjectTitle = computed(() => { | ||
return getProjectTitle(selectedProject.value) ?? selectedProjectName | ||
}) | ||
|
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.
use (selected)projectName and (selected)projectTitle from useProjectMetadata composable
function getProjectTitle (project) { | ||
return get(project, ['metadata', 'annotations', annotations.projectTitle]) | ||
} |
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.
{{ getProjectOwner(project) }} | ||
<abbr :title="hasProjectTitle(project) ? '' : null"> | ||
<span v-if="hasProjectTitle(project)"> | ||
{{ project.metadata.name }} • |
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.
I agree with Lukas regarding how the title and project name is shown here
What this PR does / why we need it:
This PR adds support for
Project
"display names" via a new annotation:dashboard.gardener.cloud/project-title: "..."
See the issue for more context:
Project
display names viaproject-title
annotations #2469Screenshots:
Navigation on the left-hand side:

Shoot
cluster list in the "All Projects"-scope:Project creation dialog:

Project administration view:

Which issue(s) this PR fixes:
Fixes #2469
Special notes for your reviewer:
/cc @klocke-io @benedikt-haug
/cc @petersutter @grolu
Release note: