diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0fb44f62b..82300969c 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -4,7 +4,15 @@ module.exports = { extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], plugins: ['svelte3', '@typescript-eslint'], ignorePatterns: ['*.cjs'], - overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], + overrides: [ + { + files: ['*.svelte'], + processor: 'svelte3/svelte3', + rules: { + 'no-redeclare': 'off' + } + } + ], settings: { 'svelte3/typescript': () => require('typescript') }, diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1c666816b..ac0650510 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,7 @@ jobs: with: node-version: 16 - name: Audit dependencies - run: npm audit --audit-level high + run: npm audit --audit-level low - name: Install dependencies run: npm ci - name: Build Console diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c7787329e..512e71552 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,10 @@ # Contributing -We would ❤️ for you to contribute to Appwrite and help make it better! We want contributing to Appwrite to be fun, enjoyable, and educational for anyone and everyone. All contributions are welcome, including issues, new docs as well as updates and tweaks, blog posts, workshops, and more. +We would ❤️ for you to contribute to Appwrite and help make it better! We want your experience while contributing to Appwrite to be fun, enjoyable, and educational for anyone and everyone. All contributions are welcome, including issues, and new docs, as well as updates and tweaks, blog posts, workshops, and more. ## How to Start? -If you are worried or don’t know where to start, check out our next section explaining what kind of help is needed and where you can get involved. You can reach out with questions on our [Discord](https://appwrite.io/discord) server. You can also submit an issue and a maintainer can guide you! +If you are worried about or don’t know where to start, check out the next section that explains what kind of help is needed and how you can get involved. You can reach out with any questions on our [Discord](https://appwrite.io/discord) server. You can also submit an issue and a maintainer can guide you! ## Repo Structure @@ -62,7 +62,7 @@ This will run tests in the `tests/` directory. ### Format -Code should like everywhere the same, for this reason a code-formatter is mandatory. +Code should be consistently formatted everywhere. Before committing code, run the code-formatter. ```bash npm run format @@ -76,7 +76,7 @@ npm run lint ### Diagnostics -Diagnostic tool that checks for following: +Diagnostic tool that checks for the following: - Unused CSS - Svelte A11y hints @@ -88,7 +88,7 @@ npm run check ## Submit a Pull Request 🚀 -Branch naming convention is as follows +The branch naming convention is as follows `TYPE-ISSUE_ID-DESCRIPTION` @@ -106,11 +106,11 @@ When `TYPE` can be: - **fix** - a bug fix - **refactor** - code change that neither fixes a bug nor adds a feature -**All PRs must include a commit message with the description of the changes made!** +**All PRs must include a commit message with a description of the changes made!** Start by forking the project and use the `git clone` command to download the repository to your computer. A standard procedure for working on an issue would be to: -1. Before creating a new branch, pull the changes from upstream to make sure your default branch is be up to date. +1. Before creating a new branch, pull the changes from upstream to make sure your default branch is up to date. ``` $ git pull @@ -143,7 +143,7 @@ $ git push origin [name_of_your_new_branch] ### Consistency -Before commiting always make sure to run all available tools to improve the codebase: +Before committing always make sure to run all available tools to improve the codebase: - Formatter - `npm run format` @@ -158,21 +158,21 @@ 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: -- Minimise HTTP requests -- Minimise 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) If you repeat anything that has already been defined in code, refactor it so that it only ever has one representation in the codebase. -If you stick to this principle, you will ensure that you will only ever need to change one implementation of a feature without worrying about needing to change any other part of the code. +If you stick to this principle, you will ensure that you will only ever need to change one implementation of a feature without worrying about the need to change any other part of the code. ### Separation of concerns -Separate _structure_ from _presentation_ from _behaviour_ to aid maintainability and understanding. +Separate _structure_ from _presentation_ from _behavior_ to aid maintainability and understanding. -- Keep CSS (presentation), JS (behaviour) and HTML (structure) in the same respective Svelte component +- 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 @@ -181,29 +181,29 @@ Separate _structure_ from _presentation_ from _behaviour_ to aid maintainability ### Write code to be read -Follow the principles of ['Keep It Simple, Stupid'](http://en.wikipedia.org/wiki/KISS_principle) (KISS); hard to read or obfuscated code is difficult to maintain and debug. Don't be too clever; write code to be read. +Follow the principles of ['Keep It Simple, Stupid'](http://en.wikipedia.org/wiki/KISS_principle) (KISS); hard-to-read or obfuscated code is difficult to maintain and debug. Don't be too clever; write code to be read. ### Identify technical debt Use code comment annotations (`@todo`) to mark parts of your code that require further work. This will allow the measurement and management of technical debt. -Don't use `@fixme` (which defines things that are broken) - you shouldn't be committing broken code to the repo. +Don't use `@fixme`, which defines things that are broken. Don't commit broken code in to the repo. ### Dependencies -Please avoid introducing new dependencies to Appwrite without consulting the team. New dependencies can be very helpful but also introduce new security and privacy issues, complexity, and impact total docker image size. +Please avoid introducing new dependencies to Appwrite without consulting the team. New dependencies can be very helpful, but they also introduce new security and privacy issues, complexity, and impact total docker image size. -Adding a new dependency should have vital value on the product with minimum possible risk. +Adding a new dependency should contribute vital value to the product with minimum possible risk. ## Introducing New Features -We would 💖 you to contribute to Appwrite, but we would also like to make sure Appwrite is as great as possible and loyal to its vision and mission statement 🙏. +We would 💖 you to contribute to Appwrite, but we also want to ensure Appwrite is loyal to its vision and mission statement 🙏. For us to find the right balance, please open an issue explaining your ideas before introducing a new pull request. -This will allow the Appwrite community to have sufficient discussion about the new feature value and how it fits in the product roadmap and vision. +This will allow the Appwrite community to sufficiently discuss the new feature value and how it fits within the product roadmap and vision. -This is also important for Appwrite maintainers to discuss the feature's design and architecture to help the contribution fit in organically in the Appwrite codebase. Some bigger features might need to go through our [RFC process](https://github.com/appwrite/rfc). +This is also important for the Appwrite lead developers to be able to provide technical input and potentially a different emphasis regarding the feature design and architecture. Some bigger features might need to go through our [RFC process](https://github.com/appwrite/rfc). ## Other Ways to Help @@ -211,27 +211,27 @@ Pull requests are great, but there are many other areas where you can help Appwr ### Blogging & Speaking -Blogging, speaking about, or creating tutorials about one of Appwrite’s many features. Mention [@appwrite](https://twitter.com/appwrite) on Twitter and/or email [team@appwrite.io](mailto:team@appwrite.io) so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite](https://github.com/appwrite/awesome-appwrite) repo on GitHub. +When blogging, speaking about, or creating tutorials about one of Appwrite's many features, mention [@appwrite](https://twitter.com/appwrite) on Twitter and/or email [team@appwrite.io](mailto:team@appwrite.io) so we can give pointers and tips and help you spread the word by promoting your content on the different Appwrite communication channels. Please add your blog posts and videos of talks to our [Awesome Appwrite](https://github.com/appwrite/awesome-appwrite) repo on GitHub. ### Presenting at Meetups -Presenting at meetups and conferences about your Appwrite projects. Your unique challenges and successes in building things with Appwrite can provide great speaking material. We’d love to review your talk abstract/CFP, so get in touch with us if you’d like some help! +Presenting at meetups and conferences about your Appwrite projects is another excellent way to get the word out about Appwrite. Your unique challenges and successes in building things with Appwrite can provide great speaking material. We’d love to review your talk abstract/CFP, so get in touch with us if you’d like some help! -### Sending Feedbacks & Reporting Bugs +### Sending Feedback & Reporting Bugs -Sending feedback is a great way for us to understand your different use cases of Appwrite better. If you had any issues, bugs, or want to share about your experience, feel free to do so on our GitHub issues page or at our [Discord channel](https://discord.gg/GSeTUeA). +Sending feedback is an excellent way for us to understand different use cases for Appwrite. If you have any issues or want to share your experience, feel free to do so on our GitHub issues page or our [Discord channel](https://discord.gg/GSeTUeA). ### Submitting New Ideas -If you think Appwrite could use a new feature, please open an issue on our GitHub repository, stating as much information as you can think about your new idea and it's implications. We would also use this issue to gather more information, get more feedback from the community, and have a proper discussion about the new feature. +If you think Appwrite could use a new feature, please open an issue on our GitHub repository, stating as much information as you can think about your new idea and its implications. We would also use this issue to gather more information, get more feedback from the community, and have a proper discussion about the new feature. ### Improving Documentation -Submitting documentation updates, enhancements, designs, or bug fixes. Spelling or grammar fixes will be very much appreciated. +Submitting documentation updates, enhancements, designs, or bug fixes help us to improve our documentation. Spelling or grammar fixes are also very much appreciated. ### Helping Someone -Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Appwrite's repo! +You can also help by teaching others how to contribute to Appwrite's repo! Please consider searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. ## Code of Conduct diff --git a/README.md b/README.md index 0dd094894..d9365176b 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ The new console is more maintainable and welcoming to community contributions. C ## Contributing -All code contributions - including those of people having commit access - must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code. +All code contributions, including those of people with commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code. We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the [contribution guide](CONTRIBUTING.md). @@ -45,7 +45,7 @@ For security issues, kindly email us at [security@appwrite.io](mailto:security@a ## Follow Us -Join our growing community around the world! See our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/), [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://appwrite.io/discord) for more help, ideas, and discussions. +Join our growing community around the world! See our official [Blog](https://medium.com/appwrite-io). Follow us on [Twitter](https://twitter.com/appwrite), [Facebook Page](https://www.facebook.com/appwrite.io), [Facebook Group](https://www.facebook.com/groups/appwrite.developers/), and [Dev Community](https://dev.to/appwrite) or join our live [Discord server](https://appwrite.io/discord) for more help, ideas, and discussions. ## License diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts index d02bebb8c..cad336312 100644 --- a/src/lib/actions/analytics.ts +++ b/src/lib/actions/analytics.ts @@ -4,7 +4,10 @@ import { get } from 'svelte/store'; import { page } from '$app/stores'; import { user } from '$lib/stores/user'; import { growthEndpoint, Mode } from '$lib/constants'; +import { AppwriteException } from '@aw-labs/appwrite-console'; +const isDevelopment = + import.meta.env.DEV || import.meta.env?.VITE_VERCEL_ENV?.toString() === 'preview'; const analytics = Analytics({ app: 'appwrite', plugins: [ @@ -18,9 +21,32 @@ export function trackEvent(name: string, data: object = null): void { if (!isTrackingAllowed()) { return; } - const path = get(page).route.id; - analytics.track(name, { ...data, path }); - sendEventToGrowth(name, path, data); + + const currentPage = get(page); + const path = currentPage.route.id; + + if (currentPage.params?.project) { + data = { + ...data, + project: currentPage.params.project + }; + } + + if (isDevelopment) { + console.debug(`[Analytics] Event ${name} ${path}`, data); + } else { + analytics.track(name, { ...data, path }); + sendEventToGrowth(name, path, data); + } +} + +export function trackError(exception: Error, event: Submit): void { + if (exception instanceof AppwriteException && exception.type) { + trackEvent(Submit.Error, { + type: exception.type, + form: event + }); + } } export function trackPageView(path: string) { @@ -28,14 +54,19 @@ export function trackPageView(path: string) { return; } - analytics.page({ - path - }); + if (isDevelopment) { + console.debug(`[Analytics] Pageview ${path}`); + } else { + analytics.page({ + path + }); + } } function sendEventToGrowth(event: string, path: string, data: object = null): void { - let email: string, name: string; + if (!growthEndpoint) return; const userStore = get(user); + let email: string, name: string; if (userStore) { email = userStore.email; name = userStore.name; @@ -60,6 +91,9 @@ function sendEventToGrowth(event: string, path: string, data: object = null): vo } function isTrackingAllowed() { + if (import.meta.env?.VITEST) { + return; + } if (window.navigator?.doNotTrack) { if (navigator.doNotTrack === '1' || navigator.doNotTrack === 'yes') { return false; @@ -70,3 +104,109 @@ function isTrackingAllowed() { return true; } } + +export enum Submit { + Error = 'submit_error', + AccountCreate = 'submit_account_create', + AccountLogin = 'submit_account_login', + AccountLogout = 'submit_account_logout', + AccountRecover = 'submit_account_recover', + AccountUpdateName = 'submit_account_update_name', + AccountUpdateEmail = 'submit_account_update_email', + AccountUpdatePassword = 'submit_account_update_password', + AccountDelete = 'submit_account_delete', + AccountDeleteSession = 'submit_account_delete_session', + AccountDeleteAllSessions = 'submit_account_delete_all_sessions', + UserCreate = 'submit_user_create', + UserDelete = 'submit_user_delete', + UserUpdateEmail = 'submit_user_update_email', + UserUpdateName = 'submit_user_update_name', + UserUpdatePassword = 'submit_user_update_password', + UserUpdatePhone = 'submit_user_update_phone', + UserUpdatePreferences = 'submit_user_update_preferences', + UserUpdateStatus = 'submit_user_update_status', + UserUpdateVerificationEmail = 'submit_user_update_verification_email', + UserUpdateVerificationPhone = 'submit_user_update_verification_phone', + OrganizationCreate = 'submit_organization_create', + OrganizationDelete = 'submit_organization_delete', + OrganizationUpdateName = 'submit_organization_update_name', + ProjectCreate = 'submit_project_create', + ProjectDelete = 'submit_project_delete', + ProjectUpdateName = 'submit_project_update_name', + ProjectService = 'submit_project_service', + MemberCreate = 'submit_member_create', + MemberDelete = 'submit_member_delete', + MembershipUpdateStatus = 'submit_membership_update_status', + ProviderUpdate = 'submit_provider_update', + TeamCreate = 'submit_team_create', + TeamDelete = 'submit_team_delete', + TeamUpdateName = 'submit_team_update_name', + AuthLimitUpdate = 'submit_auth_limit_update', + AuthStatusUpdate = 'submit_auth_status_update', + SessionsLengthUpdate = 'submit_sessions_length_update', + SessionsLimitUpdate = 'submit_sessions_limit_update', + SessionDelete = 'submit_session_delete', + SessionDeleteAll = 'submit_session_delete_all', + DatabaseCreate = 'submit_database_create', + DatabaseDelete = 'submit_database_delete', + DatabaseUpdateName = 'submit_database_update_name', + AttributeCreate = 'submit_attribute_create', + AttributeDelete = 'submit_attribute_delete', + DocumentCreate = 'submit_document_create', + DocumentDelete = 'submit_document_delete', + DocumentUpdate = 'submit_document_update', + DocumentUpdatePermissions = 'submit_document_update_permissions', + IndexCreate = 'submit_index_create', + IndexDelete = 'submit_index_delete', + CollectionCreate = 'submit_collection_create', + CollectionDelete = 'submit_collection_delete', + CollectionUpdateName = 'submit_collection_update_name', + CollectionUpdatePermissions = 'submit_collection_update_permissions', + CollectionUpdateSecurity = 'submit_collection_update_security', + CollectionUpdateEnabled = 'submit_collection_update_enabled', + FunctionCreate = 'submit_function_create', + FunctionDelete = 'submit_function_delete', + FunctionUpdateName = 'submit_function_update_name', + FunctionUpdatePermissions = 'submit_function_update_permissions', + FunctionUpdateSchedule = 'submit_function_update_schedule', + FunctionUpdateTimeout = 'submit_function_update_timeout', + FunctionUpdateEvents = 'submit_function_update_events', + DeploymentCreate = 'submit_deployment_create', + DeploymentDelete = 'submit_deployment_delete', + DeploymentUpdate = 'submit_deployment_update', + ExecutionCreate = 'submit_execution_create', + VariableCreate = 'submit_variable_create', + VariableDelete = 'submit_variable_delete', + VariableUpdate = 'submit_variable_update', + KeyCreate = 'submit_key_create', + KeyDelete = 'submit_key_delete', + KeyUpdateName = 'submit_key_update_name', + KeyUpdateScopes = 'submit_key_update_scopes', + KeyUpdateExpire = 'submit_key_update_expire', + PlatformCreate = 'submit_platform_create', + PlatformDelete = 'submit_platform_delete', + PlatformUpdate = 'submit_platform_update', + DomainCreate = 'submit_domain_create', + DomainDelete = 'submit_domain_delete', + DomainUpdateVerification = 'submit_domain_update_verification', + WebhookCreate = 'submit_webhook_create', + WebhookDelete = 'submit_webhook_delete', + WebhookUpdateSignature = 'submit_webhook_update_signature', + WebhookUpdateUrl = 'submit_webhook_update_url', + WebhookUpdateEvents = 'submit_webhook_update_events', + WebhookUpdateName = 'submit_webhook_update_name', + WebhookUpdateSecurity = 'submit_webhook_update_security', + BucketCreate = 'submit_bucket_create', + BucketDelete = 'submit_bucket_delete', + BucketUpdateEnabled = 'submit_bucket_update_enabled', + BucketUpdateName = 'submit_bucket_update_name', + BucketUpdatePermissions = 'submit_bucket_update_permissions', + BucketUpdateSecurity = 'submit_bucket_update_security', + BucketUpdateFileSecurity = 'submit_bucket_update_file_security', + BucketUpdateSize = 'submit_bucket_update_size', + BucketUpdateCompression = 'submit_bucket_update_compression', + BucketUpdateExtensions = 'submit_bucket_update_extensions', + FileCreate = 'submit_file_create', + FileDelete = 'submit_file_delete', + FileUpdatePermissions = 'submit_file_update_permissions' +} diff --git a/src/lib/actions/selectionStart.ts b/src/lib/actions/selectionStart.ts new file mode 100644 index 000000000..bd4299927 --- /dev/null +++ b/src/lib/actions/selectionStart.ts @@ -0,0 +1,28 @@ +import type { Action } from 'svelte/action'; + +type Props = { + onChange: (selectionStart: number) => void; +}; + +export const selectionStart: Action = (node, { onChange }) => { + const handler = () => { + onChange(node.selectionStart); + }; + node.addEventListener('click', handler); + node.addEventListener('keydown', handler); + node.addEventListener('keyup', handler); + + return { + update({ onChange }) { + const handler = () => { + onChange(node.selectionStart); + }; + node.addEventListener('click', handler); + node.addEventListener('keydown', handler); + node.addEventListener('keyup', handler); + }, + destroy() { + onChange(-1); + } + }; +}; diff --git a/src/lib/actions/timer.ts b/src/lib/actions/timer.ts new file mode 100644 index 000000000..1e5f9411e --- /dev/null +++ b/src/lib/actions/timer.ts @@ -0,0 +1,40 @@ +import { calculateTime } from '$lib/helpers/timeConversion'; +import type { Action } from 'svelte/action'; + +type Props = { + start?: string; + enabled?: boolean; +}; + +const defaultProps: Props = { + enabled: true +}; + +export const timer: Action = (node, props) => { + let startDate: Date; + let frame: number; + + function init(props: Props) { + const { start, enabled } = { ...defaultProps, ...props }; + startDate = start ? new Date(start) : new Date(); + frame = enabled ? window.requestAnimationFrame(step) : null; + } + + function step() { + const diffInSeconds = Math.floor((new Date().getTime() - startDate.getTime()) / 1000); + node.textContent = calculateTime(diffInSeconds); + frame = window.requestAnimationFrame(step); + } + + init(props); + + return { + update(props) { + window.cancelAnimationFrame(frame); + init(props); + }, + destroy() { + window.cancelAnimationFrame(frame); + } + }; +}; diff --git a/src/lib/actions/tooltip.ts b/src/lib/actions/tooltip.ts index 1636a14ec..b4dc14a5f 100644 --- a/src/lib/actions/tooltip.ts +++ b/src/lib/actions/tooltip.ts @@ -1,17 +1,24 @@ import type { Action } from 'svelte/action'; -import type { Props } from 'tippy.js'; +import type { Props as TippyProps } from 'tippy.js'; import tippy from 'tippy.js'; +type Props = TippyProps & { + disabled?: boolean; +}; + export const tooltip: Action> = (node, config) => { const instance = tippy(node, config); + if (config.disabled) instance.disable(); return { - update({ content }) { + update({ content, disabled }) { if (content !== instance.props.content) { instance.setProps({ content }); } + + disabled ? instance.disable() : instance.enable(); }, destroy() { instance.destroy(); diff --git a/src/lib/charts/base.svelte b/src/lib/charts/base.svelte index 09f5b5ee2..2bdd702dc 100644 --- a/src/lib/charts/base.svelte +++ b/src/lib/charts/base.svelte @@ -9,6 +9,7 @@ import type { ECharts } from 'echarts/core'; import type { BarSeriesOption, LineSeriesOption } from 'echarts/charts'; import type { EChartsOption } from 'echarts'; + import { wizard } from '$lib/stores/wizard'; registerTheme('light', { ...base, ...light }); registerTheme('dark', { ...base, ...dark }); @@ -70,7 +71,7 @@ let timeoutId: unknown; const onResize = () => { - if (timeoutId == undefined) { + if (timeoutId == undefined && !$wizard.show) { timeoutId = setTimeout(() => { if (chart && !chart.isDisposed()) { chart.resize(); @@ -79,6 +80,10 @@ }, 250); } }; + + $: if (!$wizard.show) { + onResize(); + } diff --git a/src/lib/charts/dark.json b/src/lib/charts/dark.json index 94a660131..ec07fda73 100644 --- a/src/lib/charts/dark.json +++ b/src/lib/charts/dark.json @@ -119,6 +119,11 @@ "crossStyle": { "color": "#444444" } + }, + "backgroundColor": "#373B4D", + "borderColor": "#373B4D", + "textStyle": { + "color": "#F2F2F8" } }, "timeline": { diff --git a/src/lib/components/copy.svelte b/src/lib/components/copy.svelte index 0e859e79c..c6cc8fe7d 100644 --- a/src/lib/components/copy.svelte +++ b/src/lib/components/copy.svelte @@ -7,6 +7,8 @@ export let value: string; export let event: string = null; + export let eventContext = 'click_id_tag'; + export let appendTo: Parameters['1']['appendTo'] = undefined; let content = 'Click to copy'; @@ -23,7 +25,7 @@ } if (event) { - trackEvent('click_id_tag', { + trackEvent(eventContext, { name: event }); } @@ -36,7 +38,8 @@ on:mouseenter={() => setTimeout(() => (content = 'Click to copy'))} use:tooltip={{ content, - hideOnClick: false + hideOnClick: false, + appendTo }}> diff --git a/src/lib/components/customId.svelte b/src/lib/components/customId.svelte index 0596f9c70..9dd9fa0c4 100644 --- a/src/lib/components/customId.svelte +++ b/src/lib/components/customId.svelte @@ -1,7 +1,7 @@ - -
  • - -
  • diff --git a/src/lib/components/dropTabsLink.svelte b/src/lib/components/dropTabsLink.svelte deleted file mode 100644 index 1b5ca8253..000000000 --- a/src/lib/components/dropTabsLink.svelte +++ /dev/null @@ -1,16 +0,0 @@ - - -
  • - {#if disabled} - - {:else} - - - - {/if} -
  • diff --git a/src/lib/components/eventModal.svelte b/src/lib/components/eventModal.svelte index e80f89130..7d728dcdb 100644 --- a/src/lib/components/eventModal.svelte +++ b/src/lib/components/eventModal.svelte @@ -1,323 +1,376 @@ Create Event - +

    Choose a service

    - {#each services as service} + {#each available.services as service} { - selectedService = service; - inputData = null; - }}>{service.name} + on:click={() => select('service', service)}> + {service.name} + {/each}
    - {#if selectedService} + + {#if !empty(available.resources)}

    Choose a resource (optional)

    - {#each selectedService.resources as resource} + {#each available.resources as resource} { - selectedResource === resource - ? (selectedResource = null) - : (selectedResource = resource); - inputData = null; - }}>{resource.name} + on:click={() => select('resource', resource)}> + {resource.name} + {/each}
    + {/if} + + {#if !empty(available.actions)}

    Choose an action (optional)

    - {#each selectedResource?.actions ?? selectedService?.actions as action} + {#each available.actions as action} { - selectedAction === action - ? (selectedAction = null) - : (selectedAction = action); - inputData = null; - }}>{action.name} + on:click={() => select('action', action)}> + {action.name} + {/each}
    - {#if selectedAction?.attributes} -
    -

    Choose an attribute (optional)

    -
    - {#each selectedAction.attributes as attribute} - { - selectedAttribute === attribute - ? (selectedAttribute = null) - : (selectedAttribute = attribute); - inputData = null; - }}>{attribute} - {/each} -
    -
    - {/if} {/if} + + {#if !empty(available.attributes)} +
    +

    Choose an attribute (optional)

    +
    + {#each available.attributes as attribute} + select('attribute', attribute)}> + {attribute} + + {/each} +
    +
    + {/if} + {#if showInput}
    - + (customInputCursor = newValue) }} />
    - -
    +

    {helper ?? ''}

    {:else} -
    -
    - {#if inputData} - {inputData} - {:else} - {#each Array.from(eventString.values()) as route, i} - - - {i + 1 < eventString?.size ? '.' : ''} - - {/each} - {/if} +
    + +
    + {#each eventString as route, i} + (helper = route.description)} + on:mouseleave={() => (helper = null)}> + {route.value} + + + {i + 1 < eventString?.length ? '.' : ''} + + {/each}
    - - + {#key copyParent} + + + {/key}

    {helper ?? ''}

    @@ -325,6 +378,7 @@ - + diff --git a/src/lib/components/feedbackGeneral.svelte b/src/lib/components/feedbackGeneral.svelte index 830a69dca..fc380d0b1 100644 --- a/src/lib/components/feedbackGeneral.svelte +++ b/src/lib/components/feedbackGeneral.svelte @@ -18,13 +18,18 @@ async function handleSubmit() { try { await feedback.submitFeedback('feedback-general', message, name, email); - show = false; + + addNotification({ + type: 'success', + message: 'Feedback submitted successfully' + }); } catch (error) { - show = false; addNotification({ type: 'error', message: error.message }); + } finally { + show = false; } } diff --git a/src/lib/components/index.ts b/src/lib/components/index.ts index 9ee984091..54b2251a5 100644 --- a/src/lib/components/index.ts +++ b/src/lib/components/index.ts @@ -20,9 +20,8 @@ export { default as DropListItem } from './dropListItem.svelte'; export { default as DropListLink } from './dropListLink.svelte'; export { default as Collapsible } from './collapsible.svelte'; export { default as CollapsibleItem } from './collapsibleItem.svelte'; -export { default as DropTabs } from './dropTabs.svelte'; -export { default as DropTabsItem } from './dropTabsItem.svelte'; -export { default as DropTabsLink } from './dropTabsLink.svelte'; +export { default as SecondaryTabs } from './secondaryTabs.svelte'; +export { default as SecondaryTabsItem } from './secondaryTabsItem.svelte'; export { default as Avatar } from './avatar.svelte'; export { default as AvatarInitials } from './avatarInitials.svelte'; export { default as AvatarGroup } from './avatarGroup.svelte'; diff --git a/src/lib/components/permissions/permissions.svelte b/src/lib/components/permissions/permissions.svelte index 048ddd56f..e50feb9a6 100644 --- a/src/lib/components/permissions/permissions.svelte +++ b/src/lib/components/permissions/permissions.svelte @@ -154,7 +154,7 @@ - {#each [...$groups].sort(sortRoles) as [role, permission]} + {#each [...$groups].sort(sortRoles) as [role, permission] (role)} diff --git a/src/lib/components/permissions/row.svelte b/src/lib/components/permissions/row.svelte index e69f66616..e4d369af2 100644 --- a/src/lib/components/permissions/row.svelte +++ b/src/lib/components/permissions/row.svelte @@ -65,7 +65,7 @@ {#if data} {@const isUser = role.startsWith('user')} {@const isTeam = role.startsWith('team')} - {@const isAnonymous = !data.email && !data.phone} + {@const isAnonymous = !data.email && !data.phone && isUser}