-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
refactor: move settings in app #18729
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
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.
packages/app/src/runs/RunsEmpty.vue
Outdated
const firstRecordKey = computed(() => { | ||
const allRecordKeys = props.gql.cloudProject?.recordKeys | ||
|
||
return allRecordKeys?.length ? allRecordKeys[0] : '<record-key>' |
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.
If you like to be concise you can do something like
return allRecordKeys?.[0] ?? '<record-key>'
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.
Done in e7a1872
@@ -12,7 +12,7 @@ describe('<SettingsCard />', () => { | |||
|
|||
cy.mount(() => ( | |||
<div class=""> | |||
<SettingsCard title={title} description={description} icon={IconLaptop}> | |||
<SettingsCard title={title} description={description} icon={IconLaptop} maxHeight="800px"> |
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 this just be passed as style
and inherited by the first node in the SettingsCard
?
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 really don't want the whole style to be modifiable here. This is only an attribute meant to enable the smooth expansion of the collapsible.
What do you think?
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.
No strong opinion, happy to go with this if you think it makes sense!
|
||
<script lang="ts" setup> | ||
// eslint-disable-next-line no-duplicate-imports | ||
import type { FunctionalComponent, SVGAttributes } from 'vue' |
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.
We don't have duplicate imports, can remove this eslint disable
edit: this might be to do with script setup
adding import { defineComponent } from 'vue'
, if so ignore this comment
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 can and did remove it
@@ -85,5 +85,5 @@ const externalEditors = [ | |||
] | |||
|
|||
const { t } = useI18n() | |||
const selectedEditor = ref() | |||
const selectedEditor = ref<Record<string, any>>() |
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.
Wouldn't this be the type defined above?
const externalEditors = [
{
name: 'Visual Studio Code',
key: 'vscode',
icon: VSCode,
},
So Record<String, Editor>
or something to that meaning, where Editor
is an interface with those three keys.
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, but I figured these types should all come from GQL anyway so I left it as the simplest iteration.
}> | ||
}>() | ||
|
||
// a bug in vite ddemands that we do this passthrough |
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 bug in vite ddemands that we do this passthrough | |
// a bug in vite demands that we do this passthrough |
<div> | ||
<div | ||
class="flex items-center w-full text-left rounded py-12px" | ||
:class="props.class" |
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 think we can get this for free (along with any other attrs we might add in the future, like id
) with
<script lang="ts">
export default {
inheritAttrs: true
}
</script>
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 don't even think we need the inheritAttrs
.
This was an artifact of when the class was passed to a lower-level item.
Removed in d6dc8a7
<div | ||
class="flex items-center w-full text-left rounded py-12px" | ||
:class="props.class" | ||
v-if="$slots.right" |
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 think we should stick to composition API consistently, that would mean doing
const slots = useSlots()
I wonder if we can strongly type this yet 🤔
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.
Done in 35da101
@@ -44,5 +41,9 @@ const props = defineProps<{ | |||
class?: string | string[] | Record<string, any> | |||
description?: string | |||
icon?: FunctionalComponent<SVGAttributes> | |||
gray?: boolean | |||
bigHeader?: boolean |
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 this have a default value?
cy.get('[href="#/settings"]').click() | ||
cy.findByText('Project Settings').click() | ||
|
||
cy.findByText('projectId') |
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.
Not sure coupling our e2e tests to the DOM hierarchy is ideal, is there really no other way to do this? Maybe just a data-cy="setting-projectid"
would be more clear and less brittle.
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.
Fixed in commit f89aab5
packages/app/package.json
Outdated
"check-more-types", | ||
"cli-cursor", | ||
"cli-table3", | ||
"commander", |
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.
Why did all of these get added? This really doesn't seem correct. Some may make sense but things like commander
and execa
and fs-extra
(and a bunch of others) are Node.js only, they don't make sense here.
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.
Probably a mistake at some point made all the node stuff go through vite. I removed it in d455ca9
I added a couple of style tweaks to this branch, looks great when I run it, did not get to do a full code review. |
…ve-activeProject * unified-desktop-gui: (57 commits) chore: Add e2e tests for global mode (#18719) chore: add percy to app and launchpad package (#18781) chore: update test refactor: move settings in app (#18729) feat: setup launchpad lifecycle (#18734) feat(app): decouple event manager from driver (#18695) chore: Force single resolution for core modules, infinite loop guard (#18764) fix(driver): Sticky elements within a fixed container will not prevent an element from being scrolled to (#18441) chore: cleaning up the runner container pattern (#18741) feat: Use .config files (#18578) chore(app): basic style and example to stop scrollIntoView bug (#18736) chore: make `create` function on server.ts obsolete (#18615) feat: add codegen utility (#18708) docs: Add instructions to squash commits to develop in Contributing (#18728) fix(@cypress/react): throw if using Next.js swc-loader without nodeVersion=system (#18686) refactor: remove Ramda (#18723) fix: support using create-cypress-tests as part of build process (#18714) chore: Increase paralleled machines for desktop-gui tests (#18725) fix(app): do not cache graphql (#18716) chore: Update Chrome (stable) to 95.0.4638.69 (#18696) ...
User facing changelog
Additional details
How has the user experience changed?
To test it
yarn dev
__vite__/#/
Caveats
specPatterns
don't exist yet so the value is there just for showexperiments
are not wired either