diff --git a/.forgejo/issue_template/bug.yml b/.forgejo/issue_template/bug.yml new file mode 100644 index 0000000..96be203 --- /dev/null +++ b/.forgejo/issue_template/bug.yml @@ -0,0 +1,36 @@ +name: Bug Report +about: File a bug report +labels: + - Kind/Bug +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + placeholder: Tell us what you see! + value: "A bug happened!" + validations: + required: true + - type: dropdown + id: browsers + attributes: + label: What browsers are you seeing the problem on? + multiple: true + options: + - Firefox (Windows) + - Firefox (MacOS) + - Firefox (Linux) + - Firefox (Android) + - Firefox (iOS) + - Chrome (Windows) + - Chrome (MacOS) + - Chrome (Linux) + - Chrome (Android) + - Chrome (iOS) + - Safari + - Microsoft Edge \ No newline at end of file diff --git a/.forgejo/issue_template/feature.yml b/.forgejo/issue_template/feature.yml new file mode 100644 index 0000000..c8cf794 --- /dev/null +++ b/.forgejo/issue_template/feature.yml @@ -0,0 +1,27 @@ +name: 'New Feature' +about: 'This template is for new features' +labels: + - Kind/Feature +body: + - type: markdown + attributes: + value: | + Before creating a Feature Ticket, please check for duplicates. + - type: markdown + attributes: + value: | + ### Implementation Checklist + - [ ] concept + - [ ] frontend + - [ ] backend + - [ ] unittests + - [ ] tested on staging + visible: [ content ] + - type: textarea + id: description + attributes: + label: 'Feature Description' + description: 'Explain the the feature.' + placeholder: Description + validations: + required: true \ No newline at end of file diff --git a/.forgejo/workflows/pull_request.yml b/.forgejo/workflows/pull_request.yml new file mode 100644 index 0000000..1171616 --- /dev/null +++ b/.forgejo/workflows/pull_request.yml @@ -0,0 +1,20 @@ +on: + pull_request: + +jobs: + test: + runs-on: docker + container: + image: ghcr.io/catthehacker/ubuntu:act-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache-dependency-path: '**/requirements.dev.txt' + - name: Install dependencies + working-directory: core + run: pip3 install -r requirements.dev.txt + - name: Run django tests + working-directory: core + run: python3 manage.py test diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml new file mode 100644 index 0000000..3b44d24 --- /dev/null +++ b/.forgejo/workflows/testing.yml @@ -0,0 +1,60 @@ +on: + push: + branches: + - testing + +jobs: + test: + runs-on: docker + container: + image: ghcr.io/catthehacker/ubuntu:act-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache-dependency-path: '**/requirements.dev.txt' + - name: Install dependencies + working-directory: core + run: pip3 install -r requirements.dev.txt + - name: Run django tests + working-directory: core + run: python3 manage.py test + + deploy: + needs: [test] + runs-on: docker + steps: + - uses: actions/checkout@v4 + - name: Install ansible + run: | + apt update -y + apt install python3-pip -y + python3 -m pip install ansible + python3 -m pip install ansible-lint + + - name: Populate relevant files + run: | + mkdir ~/.ssh + echo "${{ secrets.C3LF_SSH_TESTING }}" > ~/.ssh/id_ed25519 + chmod 0600 ~/.ssh/id_ed25519 + ls -lah ~/.ssh + command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y ) + eval $(ssh-agent -s) + ssh-add ~/.ssh/id_ed25519 + echo "andromeda.lab.or.it ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDXPoO0PE+B9PYwbGaLo98zhbmjAkp6eBtVeZe43v/+T" >> ~/.ssh/known_hosts + mkdir /etc/ansible + echo "${{ secrets.C3LF_INVENTORY_TESTING }}" > /etc/ansible/hosts + + - name: Check ansible version + run: | + ansible --version + + - name: List ansible hosts + run: | + ansible -m ping Andromeda + + - name: Deploy testing + run: | + cd deploy/ansible + ansible-playbook playbooks/deploy-c3lf-sys3.yml diff --git a/core/mail/migrations/0006_alter_eventaddress_address.py b/core/mail/migrations/0006_alter_eventaddress_address.py deleted file mode 100644 index 5a03261..0000000 --- a/core/mail/migrations/0006_alter_eventaddress_address.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.2.7 on 2024-11-06 06:13 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('mail', '0005_alter_eventaddress_event'), - ] - - operations = [ - migrations.AlterField( - model_name='eventaddress', - name='address', - field=models.CharField(max_length=255, unique=True), - ), - ] diff --git a/core/mail/migrations/0007_email_raw_file.py b/core/mail/migrations/0007_email_raw_file.py deleted file mode 100644 index 03d0db0..0000000 --- a/core/mail/migrations/0007_email_raw_file.py +++ /dev/null @@ -1,36 +0,0 @@ -# Generated by Django 4.2.7 on 2024-11-08 20:37 -from django.core.files.base import ContentFile -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('mail', '0006_alter_eventaddress_address'), - ] - - def move_raw_mails_to_file(apps, schema_editor): - Email = apps.get_model('mail', 'Email') - for email in Email.objects.all(): - raw_content = email.raw - email.raw_file = ContentFile(raw_content) - email.raw = None - email.save() - - operations = [ - migrations.AddField( - model_name='email', - name='raw_file', - field=models.FileField(null=True, upload_to='raw_mail/'), - ), - migrations.RunPython(move_raw_mails_to_file), - migrations.RemoveField( - model_name='email', - name='raw', - ), - migrations.AlterField( - model_name='email', - name='raw_file', - field=models.FileField(upload_to='raw_mail/'), - ), - ] diff --git a/web/src/views/Ticket.vue b/web/src/views/Ticket.vue index cbb372c..f666ee8 100644 --- a/web/src/views/Ticket.vue +++ b/web/src/views/Ticket.vue @@ -125,6 +125,10 @@ export default { }, mounted() { this.scheduleAfterInit(() => [Promise.all([this.fetchTicketStates(), this.loadTickets(), this.loadUsers(), this.fetchShippingVouchers()]).then(()=>{ + if (this.ticket.state == "pending_new"){ + this.selected_state = "pending_open"; + this.changeTicketStatus(this.ticket) + }; this.selected_state = this.ticket.state; this.selected_assignee = this.ticket.assigned_to })]);