mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: tests.
This commit is contained in:
1 parent
b3460c1b83
commit
cd2825f4e8
17 files changed
+67
-44
No files matched your search
+23
-23
@@ -108,9 +108,9 @@ pnpm run lint
|
||||
|
||||
Diagnostic tool that checks for the following:
|
||||
|
||||
- Unused CSS
|
||||
- Svelte A11y hints
|
||||
- TypeScript compiler errors
|
||||
- Unused CSS
|
||||
- Svelte A11y hints
|
||||
- TypeScript compiler errors
|
||||
|
||||
```bash
|
||||
pnpm run check
|
||||
@@ -130,11 +130,11 @@ doc-548-submit-a-pull-request-section-to-contribution-guide
|
||||
|
||||
When `TYPE` can be:
|
||||
|
||||
- **feat** - is a new feature
|
||||
- **doc** - documentation only changes
|
||||
- **cicd** - changes related to CI/CD system
|
||||
- **fix** - a bug fix
|
||||
- **refactor** - code change that neither fixes a bug nor adds a feature
|
||||
- **feat** - is a new feature
|
||||
- **doc** - documentation only changes
|
||||
- **cicd** - changes related to CI/CD system
|
||||
- **fix** - a bug fix
|
||||
- **refactor** - code change that neither fixes a bug nor adds a feature
|
||||
|
||||
**All PRs must include a commit message with a description of the changes made!**
|
||||
|
||||
@@ -175,12 +175,12 @@ $ git push origin [name_of_your_new_branch]
|
||||
|
||||
Before committing always make sure to run all available tools to improve the codebase:
|
||||
|
||||
- Formatter
|
||||
- `pnpm run format`
|
||||
- Tests
|
||||
- `pnpm test`
|
||||
- Diagnostics
|
||||
- `pnpm run check`
|
||||
- Formatter
|
||||
- `pnpm run format`
|
||||
- Tests
|
||||
- `pnpm test`
|
||||
- Diagnostics
|
||||
- `pnpm run check`
|
||||
|
||||
### Performance
|
||||
|
||||
@@ -188,9 +188,9 @@ Page load times are a key consideration for users of all browsers and device typ
|
||||
|
||||
There are some general things we can do in front-end development:
|
||||
|
||||
- Minimize HTTP requests
|
||||
- Minimize blocking – content should be readable before client-side processing
|
||||
- Lazy load "supplementary" content, especially images
|
||||
- Minimize HTTP requests
|
||||
- Minimize blocking – content should be readable before client-side processing
|
||||
- Lazy load "supplementary" content, especially images
|
||||
|
||||
### Don't Repeat Yourself (DRY)
|
||||
|
||||
@@ -202,12 +202,12 @@ If you stick to this principle, you will ensure that you will only ever need to
|
||||
|
||||
Separate _structure_ from _presentation_ from _behavior_ to aid maintainability and understanding.
|
||||
|
||||
- Keep CSS (presentation), JS (behavior) and HTML (structure) in the same respective Svelte component
|
||||
- Avoid writing inline CSS or Javascript in HTML
|
||||
- Avoid writing CSS or HTML in Javascript
|
||||
- Don't choose HTML elements to imply style
|
||||
- Where appropriate, use CSS or Svelte rather than Javascript for animations and transitions
|
||||
- Try to use templates when defining markup in Javascript
|
||||
- Keep CSS (presentation), JS (behavior) and HTML (structure) in the same respective Svelte component
|
||||
- Avoid writing inline CSS or Javascript in HTML
|
||||
- Avoid writing CSS or HTML in Javascript
|
||||
- Don't choose HTML elements to imply style
|
||||
- Where appropriate, use CSS or Svelte rather than Javascript for animations and transitions
|
||||
- Try to use templates when defining markup in Javascript
|
||||
|
||||
### Write code to be read
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
Appwrite Console has been built with the following frameworks:
|
||||
|
||||
- [Svelte](https://svelte.dev/)
|
||||
- [Svelte Kit](https://kit.svelte.dev/)
|
||||
- [Svelte](https://svelte.dev/)
|
||||
- [Svelte Kit](https://kit.svelte.dev/)
|
||||
|
||||
## Developer Experience
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
</Modal>
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
|
||||
.card {
|
||||
position: fixed;
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</ModalWrapper>
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/mixins/scroll';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/mixins/scroll';
|
||||
|
||||
.mk-grid {
|
||||
overflow: hidden;
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</dialog>
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
|
||||
.modal.is-huge {
|
||||
block-size: 100%;
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
</FormItem>
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
|
||||
/* Default (including mobile) */
|
||||
ol {
|
||||
|
||||
@@ -24,7 +24,7 @@ export function getProjectId() {
|
||||
}
|
||||
|
||||
const pathname = window.location.pathname + '/';
|
||||
const projectMatch = pathname.match(/\/project-(?:[a-z]+-)?(.*?)\//);
|
||||
const projectMatch = pathname.match(/\/project-(?:[a-z]{2,3}-)?([^/]+)/);
|
||||
|
||||
return projectMatch?.[1] || null;
|
||||
}
|
||||
@@ -222,7 +222,7 @@
|
||||
</main>
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
|
||||
.side-bg {
|
||||
position: relative;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
</Unauthenticated>
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
|
||||
.top {
|
||||
inset-block-start: 5.85rem;
|
||||
|
||||
@@ -318,7 +318,7 @@
|
||||
factors={$factors} />
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
|
||||
/* Default (including mobile) */
|
||||
.method {
|
||||
|
||||
+1
-1
@@ -106,7 +106,7 @@
|
||||
</CardGrid>
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
|
||||
.stats-grid-box {
|
||||
display: grid;
|
||||
|
||||
+6
-6
@@ -173,9 +173,9 @@
|
||||
id={`${rowIndex}-key`}
|
||||
isMultiple
|
||||
fullWidth
|
||||
bind:value={$messageParams[MessagingProviderType.Push].data[
|
||||
rowIndex
|
||||
][0]}
|
||||
bind:value={
|
||||
$messageParams[MessagingProviderType.Push].data[rowIndex][0]
|
||||
}
|
||||
placeholder="Enter key"
|
||||
label="Key"
|
||||
showLabel={false} />
|
||||
@@ -184,9 +184,9 @@
|
||||
id={`${rowIndex}-value`}
|
||||
isMultiple
|
||||
fullWidth
|
||||
bind:value={$messageParams[MessagingProviderType.Push].data[
|
||||
rowIndex
|
||||
][1]}
|
||||
bind:value={
|
||||
$messageParams[MessagingProviderType.Push].data[rowIndex][1]
|
||||
}
|
||||
placeholder="Enter value"
|
||||
label="Value"
|
||||
showLabel={false}
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
alt="statistics" />
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
|
||||
.card {
|
||||
:global(.theme-dark) & {
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
{/await}
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
// override padding for screens bigger than mobile
|
||||
@media #{devices.$break2open} {
|
||||
article.card {
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
{/await}
|
||||
|
||||
<style lang="scss">
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
// override padding for screens bigger than mobile
|
||||
@media #{devices.$break2open} {
|
||||
article.card {
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<Progress />
|
||||
|
||||
<style lang="scss" global>
|
||||
@use '@appwrite.io/pink/src/abstract/variables/devices';
|
||||
@use '@appwrite.io/pink-legacy/src/abstract/variables/devices';
|
||||
|
||||
.tippy-box {
|
||||
--p-tooltip-text-color: var(--color-neutral-10);
|
||||
|
||||
@@ -6,6 +6,7 @@ test('getProjectId', () => {
|
||||
pathname: string;
|
||||
expected: string | null;
|
||||
}> = [
|
||||
// legacy
|
||||
{
|
||||
pathname: '/console/project-6374e9031588b25d1841/databases',
|
||||
expected: '6374e9031588b25d1841'
|
||||
@@ -34,6 +35,28 @@ test('getProjectId', () => {
|
||||
{
|
||||
pathname: '/console',
|
||||
expected: null
|
||||
},
|
||||
|
||||
// multi-region
|
||||
{
|
||||
pathname: '/console/project-fra-6374e9031588b25d1841/databases',
|
||||
expected: '6374e9031588b25d1841'
|
||||
},
|
||||
{
|
||||
pathname: '/console/project-/databases',
|
||||
expected: null
|
||||
},
|
||||
{
|
||||
pathname: '/console/project-nyc-project-project-abc/databases',
|
||||
expected: 'project-project-abc'
|
||||
},
|
||||
{
|
||||
pathname: '/console/project-fra-abc/databases',
|
||||
expected: 'abc'
|
||||
},
|
||||
{
|
||||
pathname: '/console/project-syd-abc/databases/project-123',
|
||||
expected: 'abc'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in new issue
Block a user